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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations