Search in sources :

Example 1 with CameraUniversalOmni

use of boofcv.struct.calib.CameraUniversalOmni in project BoofCV by lessthanoptimal.

the class TestNarrowToWidePtoP_F64 method createModelWide.

public static LensDistortionWideFOV createModelWide() {
    CameraUniversalOmni model = new CameraUniversalOmni(2);
    model.fsetK(1.349e3, 1.343e3, 0, 480, 480, 960, 1080);
    model.fsetMirror(3.61);
    model.fsetRadial(7.308e-1, 1.855e1);
    model.fsetTangental(-1.288e-2, -1.1342e-2);
    return new LensDistortionUniversalOmni(model);
}
Also used : CameraUniversalOmni(boofcv.struct.calib.CameraUniversalOmni) LensDistortionUniversalOmni(boofcv.alg.distort.universal.LensDistortionUniversalOmni)

Example 2 with CameraUniversalOmni

use of boofcv.struct.calib.CameraUniversalOmni in project BoofCV by lessthanoptimal.

the class TestUniOmniPtoS_F32 method back_and_forth.

private void back_and_forth(float mirror) {
    CameraUniversalOmni model = createModel(mirror);
    UniOmniPtoS_F32 pixelToUnit = new UniOmniPtoS_F32();
    pixelToUnit.setModel(model);
    UniOmniStoP_F32 unitToPixel = new UniOmniStoP_F32();
    unitToPixel.setModel(model);
    List<Point2D_F32> listPixels = new ArrayList<>();
    listPixels.add(new Point2D_F32(320, 240));
    listPixels.add(new Point2D_F32(320, 200));
    listPixels.add(new Point2D_F32(320, 280));
    listPixels.add(new Point2D_F32(280, 240));
    listPixels.add(new Point2D_F32(360, 240));
    listPixels.add(new Point2D_F32(280, 240));
    listPixels.add(new Point2D_F32(240, 180));
    for (Point2D_F32 pixel : listPixels) {
        Point3D_F32 circle = new Point3D_F32(10, 10, 10);
        // directly forward on unit sphere
        pixelToUnit.compute(pixel.x, pixel.y, circle);
        // it should be on the unit circle
        assertEquals(1.0f, circle.norm(), GrlConstants.TEST_F32);
        Point2D_F32 found = new Point2D_F32();
        unitToPixel.compute(circle.x, circle.y, circle.z, found);
        assertEquals(pixel.x, found.x, GrlConstants.TEST_SQ_F32);
        assertEquals(pixel.y, found.y, GrlConstants.TEST_SQ_F32);
    }
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) CameraUniversalOmni(boofcv.struct.calib.CameraUniversalOmni) ArrayList(java.util.ArrayList) Point2D_F32(georegression.struct.point.Point2D_F32)

Example 3 with CameraUniversalOmni

use of boofcv.struct.calib.CameraUniversalOmni in project BoofCV by lessthanoptimal.

the class TestUniOmniPtoS_F32 method centerIsCenter.

private void centerIsCenter(float mirror) {
    CameraUniversalOmni model = createModel(mirror);
    UniOmniPtoS_F32 alg = new UniOmniPtoS_F32();
    alg.setModel(model);
    Point3D_F32 found = new Point3D_F32(10, 10, 10);
    // directly forward on unit sphere
    alg.compute(320, 240, found);
    assertEquals(0, found.x, GrlConstants.TEST_F32);
    assertEquals(0, found.y, GrlConstants.TEST_F32);
    assertEquals(1, found.z, GrlConstants.TEST_F32);
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) CameraUniversalOmni(boofcv.struct.calib.CameraUniversalOmni)

Example 4 with CameraUniversalOmni

use of boofcv.struct.calib.CameraUniversalOmni in project BoofCV by lessthanoptimal.

the class TestUniOmniPtoS_F32 method createModel.

public static CameraUniversalOmni createModel(float mirror) {
    CameraUniversalOmni model = new CameraUniversalOmni(2);
    model.fsetK(400, 405, 0.01f, 320, 240, 640, 480);
    model.fsetMirror(mirror);
    model.fsetRadial(0.01f, -0.03f);
    model.fsetTangental(0.001f, 0.002f);
    return model;
}
Also used : CameraUniversalOmni(boofcv.struct.calib.CameraUniversalOmni)

Example 5 with CameraUniversalOmni

use of boofcv.struct.calib.CameraUniversalOmni in project BoofCV by lessthanoptimal.

the class TestUniOmniPtoS_F64 method back_and_forth.

private void back_and_forth(double mirror) {
    CameraUniversalOmni model = createModel(mirror);
    UniOmniPtoS_F64 pixelToUnit = new UniOmniPtoS_F64();
    pixelToUnit.setModel(model);
    UniOmniStoP_F64 unitToPixel = new UniOmniStoP_F64();
    unitToPixel.setModel(model);
    List<Point2D_F64> listPixels = new ArrayList<>();
    listPixels.add(new Point2D_F64(320, 240));
    listPixels.add(new Point2D_F64(320, 200));
    listPixels.add(new Point2D_F64(320, 280));
    listPixels.add(new Point2D_F64(280, 240));
    listPixels.add(new Point2D_F64(360, 240));
    listPixels.add(new Point2D_F64(280, 240));
    listPixels.add(new Point2D_F64(240, 180));
    for (Point2D_F64 pixel : listPixels) {
        Point3D_F64 circle = new Point3D_F64(10, 10, 10);
        // directly forward on unit sphere
        pixelToUnit.compute(pixel.x, pixel.y, circle);
        // it should be on the unit circle
        assertEquals(1.0, circle.norm(), GrlConstants.TEST_F64);
        Point2D_F64 found = new Point2D_F64();
        unitToPixel.compute(circle.x, circle.y, circle.z, found);
        assertEquals(pixel.x, found.x, GrlConstants.TEST_SQ_F64);
        assertEquals(pixel.y, found.y, GrlConstants.TEST_SQ_F64);
    }
}
Also used : Point3D_F64(georegression.struct.point.Point3D_F64) CameraUniversalOmni(boofcv.struct.calib.CameraUniversalOmni) Point2D_F64(georegression.struct.point.Point2D_F64) ArrayList(java.util.ArrayList)

Aggregations

CameraUniversalOmni (boofcv.struct.calib.CameraUniversalOmni)19 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)6 GrayF32 (boofcv.struct.image.GrayF32)6 BufferedImage (java.awt.image.BufferedImage)6 File (java.io.File)6 LensDistortionUniversalOmni (boofcv.alg.distort.universal.LensDistortionUniversalOmni)5 ArrayList (java.util.ArrayList)5 Point2D_F64 (georegression.struct.point.Point2D_F64)3 Test (org.junit.Test)3 CalibrateMonoPlanar (boofcv.abst.geo.calibration.CalibrateMonoPlanar)2 DetectorFiducialCalibration (boofcv.abst.geo.calibration.DetectorFiducialCalibration)2 LensDistortionPinhole (boofcv.alg.distort.pinhole.LensDistortionPinhole)2 GrayU8 (boofcv.struct.image.GrayU8)2 Planar (boofcv.struct.image.Planar)2 Point2D_F32 (georegression.struct.point.Point2D_F32)2 Point3D_F32 (georegression.struct.point.Point3D_F32)2 Point3D_F64 (georegression.struct.point.Point3D_F64)2 Se3_F64 (georegression.struct.se.Se3_F64)2 ConfigChessboard (boofcv.abst.fiducial.calib.ConfigChessboard)1 LensDistortionWideFOV (boofcv.alg.distort.LensDistortionWideFOV)1