Search in sources :

Example 6 with SimulatePlanarWorld

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);
}
Also used : SimulatePlanarWorld(boofcv.simulation.SimulatePlanarWorld) DetectorFiducialCalibration(boofcv.abst.geo.calibration.DetectorFiducialCalibration) GrayF32(boofcv.struct.image.GrayF32) CameraUniversalOmni(boofcv.struct.calib.CameraUniversalOmni) Point2D_F64(georegression.struct.point.Point2D_F64) ArrayList(java.util.ArrayList) Se3_F64(georegression.struct.se.Se3_F64) Test(org.junit.Test)

Example 7 with SimulatePlanarWorld

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();
}
Also used : SimulatePlanarWorld(boofcv.simulation.SimulatePlanarWorld) GrayF32(boofcv.struct.image.GrayF32) CameraPinholeRadial(boofcv.struct.calib.CameraPinholeRadial) ArrayList(java.util.ArrayList) Se3_F64(georegression.struct.se.Se3_F64)

Aggregations

SimulatePlanarWorld (boofcv.simulation.SimulatePlanarWorld)7 GrayF32 (boofcv.struct.image.GrayF32)7 Se3_F64 (georegression.struct.se.Se3_F64)7 CameraPinholeRadial (boofcv.struct.calib.CameraPinholeRadial)6 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)3 DetectorFiducialCalibration (boofcv.abst.geo.calibration.DetectorFiducialCalibration)2 Point2D_F64 (georegression.struct.point.Point2D_F64)2 QrCode (boofcv.alg.fiducial.qrcode.QrCode)1 CameraUniversalOmni (boofcv.struct.calib.CameraUniversalOmni)1