use of boofcv.simulation.SimulatePlanarWorld in project BoofCV by lessthanoptimal.
the class GenericPlanarCalibrationDetectorChecks method fisheye_fullview.
/**
* See if it can detect targets distorted by fisheye lens. Entire target is always seen
*/
@Test
public void fisheye_fullview() {
CameraUniversalOmni model = CalibrationIO.load(getClass().getResource("fisheye.yaml"));
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
List<Point2D_F64> locations2D = new ArrayList<>();
GrayF32 pattern = new GrayF32(1, 1);
for (int i = 0; i < targetConfigs.size(); i++) {
DetectorFiducialCalibration detector = createDetector(targetConfigs.get(i));
renderTarget(targetConfigs.get(i), simulatedTargetWidth, pattern, locations2D);
simulator.resetScene();
Se3_F64 markerToWorld = new Se3_F64();
simulator.addTarget(markerToWorld, simulatedTargetWidth, pattern);
failedToDetect = 0;
for (int j = 0; j < fisheye_poses.size(); j++) {
// System.out.println("fisheye pose = "+j);
markerToWorld.set(fisheye_poses.get(j));
checkRenderedResults(detector, simulator, locations2D);
}
}
assertTrue(failedToDetect <= fisheyeAllowedFails);
}
use of boofcv.simulation.SimulatePlanarWorld in project BoofCV by lessthanoptimal.
the class GenericPlanarCalibrationDetectorChecks method renderEasy.
protected GrayF32 renderEasy(Object layout, List<Point2D_F64> locations2D) {
CameraPinholeRadial model = CalibrationIO.load(getClass().getResource("pinhole_radial.yaml"));
if (locations2D == null)
locations2D = new ArrayList<>();
GrayF32 pattern = new GrayF32(1, 1);
renderTarget(layout, simulatedTargetWidth, pattern, locations2D);
SimulatePlanarWorld simulator = new SimulatePlanarWorld();
simulator.setCamera(model);
Se3_F64 markerToWorld = new Se3_F64();
markerToWorld.T.set(0, 0, 0.5);
simulator.addTarget(markerToWorld, simulatedTargetWidth, pattern);
simulator.render();
return simulator.getOutput();
}
Aggregations