Search in sources :

Example 46 with CameraPinhole

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

the class TestSelfCalibrationLinearRotationMulti method fillInConstraintMatrix_ZeroPP.

@Test
void fillInConstraintMatrix_ZeroPP() {
    camera = new CameraPinhole(400, 420, 0.5, 0, 0, 0, 0);
    PerspectiveOps.pinholeToMatrix(camera, K);
    renderRotationOnly(camera);
    List<Homography2D_F64> viewsI_to_view0 = computeHomographies();
    SelfCalibrationLinearRotationMulti alg = new SelfCalibrationLinearRotationMulti();
    alg.setConstraints(false, true, false, 1);
    alg.computeInverseH(viewsI_to_view0);
    alg.fillInConstraintMatrix();
    checkFillInConstraintMatrix(alg);
}
Also used : CameraPinhole(boofcv.struct.calib.CameraPinhole) Homography2D_F64(georegression.struct.homography.Homography2D_F64) Test(org.junit.jupiter.api.Test)

Example 47 with CameraPinhole

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

the class TestRefineDualQuadraticAlgebraicError method solveNoise.

@Test
void solveNoise() {
    List<CameraPinhole> expected = new ArrayList<>();
    List<CameraPinhole> found = new ArrayList<>();
    for (int i = 0; i < 30; i++) {
        expected.add(new CameraPinhole(400 + i * 5, 420, 0.0, 410, 420, 0, 0));
        found.add(new CameraPinhole(expected.get(i)));
        found.get(i).fx += 1.5 * rand.nextGaussian();
        found.get(i).fy += 1.5 * rand.nextGaussian();
        found.get(i).cx += 1.5 * rand.nextGaussian();
        found.get(i).cy += 1.5 * rand.nextGaussian();
    }
    var alg = new RefineDualQuadraticAlgebraicError();
    checkRefine(alg, expected, found, 1.5);
}
Also used : ArrayList(java.util.ArrayList) CameraPinhole(boofcv.struct.calib.CameraPinhole) Test(org.junit.jupiter.api.Test)

Example 48 with CameraPinhole

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

the class TestRefineDualQuadraticAlgebraicError method solvePerfect.

@Test
void solvePerfect() {
    List<CameraPinhole> expected = new ArrayList<>();
    List<CameraPinhole> found = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        expected.add(new CameraPinhole(400 + i * 5, 420, 0.0, 410, 420, 0, 0));
        found.add(new CameraPinhole(expected.get(i)));
    }
    var alg = new RefineDualQuadraticAlgebraicError();
    checkRefine(alg, expected, found, 1e-6);
}
Also used : ArrayList(java.util.ArrayList) CameraPinhole(boofcv.struct.calib.CameraPinhole) Test(org.junit.jupiter.api.Test)

Example 49 with CameraPinhole

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

the class TestRefineDualQuadraticAlgebraicError method solveNoise_solveSingleCamera.

@Test
void solveNoise_solveSingleCamera() {
    List<CameraPinhole> expected = new ArrayList<>();
    List<CameraPinhole> found = new ArrayList<>();
    // Just one camera as a constraint
    for (int i = 0; i < 30; i++) {
        expected.add(new CameraPinhole(400, 420, 0.0, 410, 420, 0, 0));
    }
    found.add(new CameraPinhole(expected.get(0)));
    found.get(0).fx += 1.5 * rand.nextGaussian();
    found.get(0).fy += 1.5 * rand.nextGaussian();
    found.get(0).cx += 1.5 * rand.nextGaussian();
    found.get(0).cy += 1.5 * rand.nextGaussian();
    var alg = new RefineDualQuadraticAlgebraicError();
    checkRefine(alg, expected, found, 0.5);
}
Also used : ArrayList(java.util.ArrayList) CameraPinhole(boofcv.struct.calib.CameraPinhole) Test(org.junit.jupiter.api.Test)

Example 50 with CameraPinhole

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

the class TestRefineDualQuadraticAlgebraicError method solveNoise_KnownPrinciplePoint.

@Test
void solveNoise_KnownPrinciplePoint() {
    List<CameraPinhole> expected = new ArrayList<>();
    List<CameraPinhole> found = new ArrayList<>();
    for (int i = 0; i < 30; i++) {
        expected.add(new CameraPinhole(400 + i * 5, 420, 0.0, 5, 6, 0, 0));
        found.add(new CameraPinhole(expected.get(i)));
        found.get(i).fx += 1 * rand.nextGaussian();
        found.get(i).fy += 1 * rand.nextGaussian();
    }
    var alg = new RefineDualQuadraticAlgebraicError();
    alg.setKnownPrinciplePoint(true);
    checkRefine(alg, expected, found, 5);
}
Also used : ArrayList(java.util.ArrayList) CameraPinhole(boofcv.struct.calib.CameraPinhole) Test(org.junit.jupiter.api.Test)

Aggregations

CameraPinhole (boofcv.struct.calib.CameraPinhole)154 Test (org.junit.jupiter.api.Test)81 Se3_F64 (georegression.struct.se.Se3_F64)36 DMatrixRMaj (org.ejml.data.DMatrixRMaj)32 Point2D_F64 (georegression.struct.point.Point2D_F64)24 ArrayList (java.util.ArrayList)23 Point3D_F64 (georegression.struct.point.Point3D_F64)19 Homography2D_F64 (georegression.struct.homography.Homography2D_F64)12 SceneStructureMetric (boofcv.abst.geo.bundle.SceneStructureMetric)11 CameraPinholeBrown (boofcv.struct.calib.CameraPinholeBrown)11 Test (org.junit.Test)10 GrayF32 (boofcv.struct.image.GrayF32)9 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)8 Point2Transform2_F32 (boofcv.struct.distort.Point2Transform2_F32)8 BufferedImage (java.awt.image.BufferedImage)8 Point2Transform2_F64 (boofcv.struct.distort.Point2Transform2_F64)7 VerbosePrint (org.ddogleg.struct.VerbosePrint)7 LensDistortionPinhole (boofcv.alg.distort.pinhole.LensDistortionPinhole)6 WorldToCameraToPixel (boofcv.alg.geo.WorldToCameraToPixel)6 CameraPinholeRadial (boofcv.struct.calib.CameraPinholeRadial)5