use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class TestStereoConsistencyCheck method checkRectification.
@Test
public void checkRectification() {
Se3_F64 leftToRight = new Se3_F64();
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.01, -0.001, 0.005, leftToRight.getR());
leftToRight.getT().set(-0.1, 0, 0);
StereoParameters param = new StereoParameters();
param.rightToLeft = leftToRight.invert(null);
param.left = new CameraPinholeRadial(400, 500, 0.1, 160, 120, 320, 240).fsetRadial(0, 0);
param.right = new CameraPinholeRadial(380, 505, 0.05, 165, 115, 320, 240).fsetRadial(0, 0);
Point3D_F64 X = new Point3D_F64(0.02, -0.5, 3);
Point2D_F64 leftP = new Point2D_F64();
Point2D_F64 rightP = new Point2D_F64();
SfmTestHelper.renderPointPixel(param, X, leftP, rightP);
StereoConsistencyCheck alg = new StereoConsistencyCheck(1, 2);
alg.setCalibration(param);
alg.checkPixel(leftP, rightP);
assertEquals(alg.rectLeft.y, alg.rectRight.y, 1e-5);
assertTrue(alg.rectLeft.x > alg.rectRight.x);
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class TestStereoProcessingBase method createStereoParam.
public static StereoParameters createStereoParam(int width, int height) {
StereoParameters ret = new StereoParameters();
ret.setRightToLeft(new Se3_F64());
ret.getRightToLeft().getT().set(-0.2, 0.001, -0.012);
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.001, -0.01, 0.0023, ret.getRightToLeft().getR());
ret.left = new CameraPinholeRadial().fsetK(300, 320, 0, width / 2, height / 2, width, height).fsetRadial(0.1, 1e-4);
ret.right = new CameraPinholeRadial().fsetK(290, 310, 0, width / 2 + 2, height / 2 - 6, width, height).fsetRadial(0.05, -2e-4);
return ret;
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class CheckVisualOdometryStereoSim method createStereoParam.
public StereoParameters createStereoParam() {
StereoParameters ret = new StereoParameters();
ret.setRightToLeft(new Se3_F64());
ret.getRightToLeft().getT().set(-0.2, 0.001, -0.012);
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.001, -0.01, 0.0023, ret.getRightToLeft().getR());
ret.left = new CameraPinholeRadial(200, 201, 0, width / 2, height / 2, width, height).fsetRadial(0, 0);
ret.right = new CameraPinholeRadial(199, 200, 0, width / 2 + 2, height / 2 - 6, width, height).fsetRadial(0, 0);
return ret;
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class TestMonocularPlaneVisualOdometryScaleInput method setCalibration.
@Test
public void setCalibration() {
param = null;
CameraPinholeRadial intrinsic = createIntrinsic();
Se3_F64 extrinsic = new Se3_F64();
extrinsic.T.x = 8;
Dummy dummy = new Dummy();
MonocularPlaneVisualOdometry<GrayF32> alg = new MonocularPlaneVisualOdometryScaleInput<>(dummy, 0.5);
assertTrue(this.param == null);
alg.setCalibration(new MonoPlaneParameters(intrinsic, extrinsic));
assertEquals(320, this.param.intrinsic.width);
assertEquals(160, this.param.intrinsic.height);
assertTrue(this.param.planeToCamera.T.x == extrinsic.T.x);
}
use of boofcv.struct.calib.CameraPinholeRadial in project BoofCV by lessthanoptimal.
the class TestStereoVisualOdometryScaleInput method createStereoParam.
public StereoParameters createStereoParam() {
StereoParameters ret = new StereoParameters();
ret.setRightToLeft(new Se3_F64());
ret.getRightToLeft().getT().set(-0.2, 0.001, -0.012);
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.001, -0.01, 0.0023, ret.getRightToLeft().getR());
ret.left = new CameraPinholeRadial(200, 201, 0, width / 2, height / 2, width, height).fsetRadial(0, 0);
ret.right = new CameraPinholeRadial(199, 200, 0, width / 2 + 2, height / 2 - 6, width, height).fsetRadial(0, 0);
return ret;
}
Aggregations