use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class TestRectifyImageOps method allInsideLeft_calibrated.
@Test
public void allInsideLeft_calibrated() {
CameraPinholeRadial param = new CameraPinholeRadial().fsetK(300, 320, 0, 150, 130, width, height).fsetRadial(0.1, 1e-4);
// do nothing rectification
FMatrixRMaj rect1 = CommonOps_FDRM.identity(3);
FMatrixRMaj rect2 = CommonOps_FDRM.identity(3);
FMatrixRMaj rectK = PerspectiveOps.calibrationMatrix(param, (FMatrixRMaj) null);
RectifyImageOps.allInsideLeft(param, rect1, rect2, rectK);
// check left image
Point2Transform2_F32 tran = RectifyImageOps.transformRectToPixel(param, rect1);
checkInside(tran);
// the right view is not checked since it is not part of the contract
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class TestPinholeNtoP_F64 method basicTest.
@Test
public void basicTest() {
CameraPinholeRadial p = new CameraPinholeRadial().fsetK(1, 2, 3, 4, 5, 200, 300);
DMatrixRMaj K = PerspectiveOps.calibrationMatrix(p, (DMatrixRMaj) null);
Point2D_F64 pixel = new Point2D_F64(150, 200);
Point2D_F64 expected = new Point2D_F64();
Point2D_F64 found = new Point2D_F64();
GeometryMath_F64.mult(K, pixel, expected);
PinholeNtoP_F64 alg = new PinholeNtoP_F64();
alg.set(p.fx, p.fy, p.skew, p.cx, p.cy);
alg.compute(pixel.x, pixel.y, found);
assertEquals(expected.x, found.x, 1e-8);
assertEquals(expected.y, found.y, 1e-8);
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class WrapVisOdomDualTrackPnP method setCalibration.
@Override
public void setCalibration(StereoParameters parameters) {
Se3_F64 leftToRight = parameters.getRightToLeft().invert(null);
pnp.setLeftToRight(leftToRight);
if (refine != null)
refine.setLeftToRight(leftToRight);
alg.setCalibration(parameters);
CameraPinholeRadial left = parameters.left;
distanceMono.setIntrinsic(left.fx, left.fy, left.skew);
distanceStereo.setStereoParameters(parameters);
assoc.setCalibration(parameters);
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class WrapVisOdomQuadPnP method setCalibration.
@Override
public void setCalibration(StereoParameters parameters) {
Se3_F64 leftToRight = parameters.getRightToLeft().invert(null);
alg.setCalibration(parameters);
associateStereo.setCalibration(parameters);
distance.setStereoParameters(parameters);
CameraPinholeRadial left = parameters.left;
distanceMono.setIntrinsic(left.fx, left.fy, left.skew);
if (refine != null)
refine.setLeftToRight(leftToRight);
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class PnPStereoDistanceReprojectionSq method setStereoParameters.
public void setStereoParameters(StereoParameters param) {
this.leftToRight = param.getRightToLeft().invert(null);
CameraPinholeRadial left = param.left;
CameraPinholeRadial right = param.right;
leftPixelError = new NormalizedToPixelError(left.fx, left.fy, left.skew);
rightPixelError = new NormalizedToPixelError(right.fx, right.fy, right.skew);
}
Aggregations