use of boofcv.struct.calib.CameraPinholeBrown 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().setTo(-0.2, 0.001, -0.012);
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.001, -0.01, 0.0023, ret.getRightToLeft().getR());
ret.left = new CameraPinholeBrown(200, 201, 0, width / 2, height / 2, width, height).fsetRadial(0, 0);
ret.right = new CameraPinholeBrown(199, 200, 0, width / 2 + 2, height / 2 - 6, width, height).fsetRadial(0, 0);
return ret;
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestAssociateStereo2D method setup.
@BeforeEach
public void setup() {
leftToRight = new Se3_F64();
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.01, -0.001, 0.005, leftToRight.getR());
leftToRight.getT().setTo(-0.1, 0, 0);
param = new StereoParameters();
param.right_to_left = leftToRight.invert(null);
param.left = new CameraPinholeBrown(400, 500, 0.1, 160, 120, 320, 240).fsetRadial(0, 0);
param.right = new CameraPinholeBrown(380, 505, 0.05, 165, 115, 320, 240).fsetRadial(0, 0);
descLeft = new DogArray<>(() -> new TupleDesc_F64(10));
descRight = new DogArray<>(() -> new TupleDesc_F64(10));
pointsLeft.reset();
pointsRight.reset();
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestStereoConsistencyCheck method checkRectification.
@Test
void checkRectification() {
Se3_F64 leftToRight = new Se3_F64();
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.01, -0.001, 0.005, leftToRight.getR());
leftToRight.getT().setTo(-0.1, 0, 0);
StereoParameters param = new StereoParameters();
param.right_to_left = leftToRight.invert(null);
param.left = new CameraPinholeBrown(400, 500, 0.1, 160, 120, 320, 240).fsetRadial(0, 0);
param.right = new CameraPinholeBrown(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.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestMonocularPlaneVisualOdometryScaleInput method setCalibration.
@Test
void setCalibration() {
param = null;
CameraPinholeBrown 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.CameraPinholeBrown 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().setTo(-0.2, 0.001, -0.012);
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0.001, -0.01, 0.0023, ret.getRightToLeft().getR());
ret.left = new CameraPinholeBrown(200, 201, 0, width / 2, height / 2, width, height).fsetRadial(0, 0);
ret.right = new CameraPinholeBrown(199, 200, 0, width / 2 + 2, height / 2 - 6, width, height).fsetRadial(0, 0);
return ret;
}
Aggregations