use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class GenericAztecCodeDetectorChecks method skewed.
/**
* The marker is at a skewed angle and rotating
*/
@Test
void skewed() {
AztecCodeDetector<GrayF32> detector = createDetector();
CameraPinholeBrown model = CalibrationIO.load(getClass().getResource("calib/pinhole_radial.yaml"));
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
simulator.resetScene();
Se3_F64 markerToWorld = new Se3_F64();
simulator.addSurface(markerToWorld, simulatedTargetWidth, generateMarker());
markerToWorld.T.setTo(0, 0, 0.5);
for (int i = 0; i < 30; i++) {
double roll = 2 * Math.PI * i / 30.0;
double pitch = Math.PI * 0.3;
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, pitch, Math.PI, roll, markerToWorld.R);
renderAndCheck(detector, simulator);
}
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class GenericAztecCodeDetectorChecks method scale.
/**
* The marker zooming in and out of the frame
*/
@Test
void scale() {
AztecCodeDetector<GrayF32> detector = createDetector();
CameraPinholeBrown model = CalibrationIO.load(getClass().getResource("calib/pinhole_radial.yaml"));
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
simulator.resetScene();
Se3_F64 markerToWorld = new Se3_F64();
simulator.addSurface(markerToWorld, simulatedTargetWidth, generateMarker());
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0, Math.PI, 0, markerToWorld.R);
markerToWorld.T.setTo(0, 0, 0.3);
for (int i = 0; i < 30; i++) {
renderAndCheck(detector, simulator);
markerToWorld.T.z += 0.03;
}
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class GenericAztecCodeDetectorChecks method multipleMarkers.
/**
* See if it can detect multiple fiducials in the image at the same time
*/
@Test
void multipleMarkers() {
AztecCodeDetector<GrayF32> detector = createDetector();
CameraPinholeBrown model = CalibrationIO.load(getClass().getResource("calib/pinhole_radial.yaml"));
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
simulator.resetScene();
Se3_F64 markerToWorld0 = new Se3_F64();
Se3_F64 markerToWorld1 = new Se3_F64();
simulator.addSurface(markerToWorld0, simulatedTargetWidth, generateMarker());
simulator.addSurface(markerToWorld1, simulatedTargetWidth, generateMarker());
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0, Math.PI, 0, markerToWorld0.R);
markerToWorld0.T.setTo(0.2, 0, 0.6);
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0, Math.PI, 0, markerToWorld1.R);
markerToWorld1.T.setTo(-0.2, 0, 0.6);
simulator.render();
detector.process(simulator.getOutput());
if (display) {
ShowImages.showWindow(simulator.getOutput(), ShowImages.Colorization.MAGNITUDE, "Foo", true);
BoofMiscOps.sleep(10000);
}
List<AztecCode> detections = detector.getDetections();
assertEquals(2, detections.size());
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class GenericAztecCodeDetectorChecks method rotation.
/**
* See if a clear well defined qr code can be detected while rating
*/
@Test
void rotation() {
AztecCodeDetector<GrayF32> detector = createDetector();
CameraPinholeBrown model = CalibrationIO.load(getClass().getResource("calib/pinhole_radial.yaml"));
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
simulator.resetScene();
Se3_F64 markerToWorld = new Se3_F64();
simulator.addSurface(markerToWorld, simulatedTargetWidth, generateMarker());
markerToWorld.T.setTo(0, 0, 0.5);
for (int i = 0; i < 30; i++) {
double roll = 2 * Math.PI * i / 30.0;
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, 0, Math.PI, roll, markerToWorld.R);
renderAndCheck(detector, simulator);
}
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class GenericQrCodeDetectorChecks method skewed.
/**
* The marker is at a skewed angle and rotating
*/
@Test
void skewed() {
QrCodeDetector<GrayF32> detector = createDetector();
CameraPinholeBrown model = CalibrationIO.load(getClass().getResource("calib/pinhole_radial.yaml"));
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
simulator.resetScene();
Se3_F64 markerToWorld = new Se3_F64();
simulator.addSurface(markerToWorld, simulatedTargetWidth, generateMarker());
markerToWorld.T.setTo(0, 0, 0.5);
for (int i = 0; i < 30; i++) {
double roll = 2 * Math.PI * i / 30.0;
double pitch = Math.PI * 0.3;
ConvertRotation3D_F64.eulerToMatrix(EulerType.XYZ, pitch, Math.PI, roll, markerToWorld.R);
renderAndCheck(detector, simulator);
}
}
Aggregations