use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class CalibrateStereoPlanar method calibrateMono.
/**
* Compute intrinsic calibration for one of the cameras
*/
private CameraPinholeBrown calibrateMono(CalibrateMonoPlanar calib, List<Se3_F64> location) {
calib.setVerbose(verbose, null);
CameraPinholeBrown intrinsic = calib.process();
SceneStructureMetric structure = calib.getStructure();
for (int i = 0; i < structure.motions.size; i++) {
location.add(structure.motions.data[i].motion);
}
return intrinsic;
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class CalibrateStereoPlanar method process.
/**
* Compute stereo calibration parameters
*
* @return Stereo calibration parameters
*/
public StereoParameters process() {
// calibrate left and right cameras
if (verbose != null)
verbose.println("Mono Left");
CameraPinholeBrown leftParam = calibrateMono(calibLeft, viewLeft);
if (verbose != null)
verbose.println("Mono right");
CameraPinholeBrown rightParam = calibrateMono(calibRight, viewRight);
// fit motion from right to left
Se3_F64 rightToLeft = computeRightToLeft();
var results = new StereoParameters(leftParam, rightParam, rightToLeft);
refineAll(results);
return results;
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestCameraToEquirectangular_F64 method copy.
@Test
void copy() {
CameraPinholeBrown intrinsic = new CameraPinholeBrown(400, 400, 0, imgWidth / 2, imgHeight / 2, imgWidth, imgHeight);
intrinsic.setRadial(0.1, 0.2);
CameraToEquirectangular_F64 origin = new CameraToEquirectangular_F64();
origin.setCameraModel(intrinsic);
copy(origin, equiWidth, equiHeight);
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestCameraToEquirectangular_F64 method setDirection.
/**
* Rotate the camera and see if the camera center is pointing in the right direction now
*/
@Test
void setDirection() {
CameraPinholeBrown intrinsic = new CameraPinholeBrown(400, 400, 0, imgWidth / 2, imgHeight / 2, imgWidth, imgHeight);
intrinsic.setRadial(0.1, 0.2);
CameraToEquirectangular_F64 alg = new CameraToEquirectangular_F64();
alg.setCameraModel(intrinsic);
alg.setEquirectangularShape(equiWidth, equiHeight);
alg.setDirection(0, Math.PI / 2, 0);
assertPointing(alg, imgWidth / 2, imgHeight / 2, 1, 0, 0);
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestLensDistortionOps_F64 method transformChangeModel_EXPAND.
/**
* Checks the border of the returned transform. Makes sure that no none-visible portion is visible.
* Also makes sure that the requested inverse transform is actually the inverse.
*/
@Test
void transformChangeModel_EXPAND() {
CameraPinholeBrown param;
param = new CameraPinholeBrown().fsetK(300, 320, 0, 150, 130, width, height).fsetRadial(0.1, 1e-4);
CameraPinhole desired = new CameraPinhole(param);
Point2Transform2_F64 adjToDist = LensDistortionOps_F64.transformChangeModel(AdjustmentType.EXPAND, param, desired, true, null);
Point2Transform2_F64 distToAdj = LensDistortionOps_F64.transformChangeModel(AdjustmentType.EXPAND, param, desired, false, null);
checkInside(adjToDist, distToAdj);
// distort it in the other direction
param = new CameraPinholeBrown().fsetK(300, 320, 0, 150, 130, width, height).fsetRadial(-0.1, -1e-4);
adjToDist = LensDistortionOps_F64.transformChangeModel(AdjustmentType.EXPAND, param, desired, true, null);
distToAdj = LensDistortionOps_F64.transformChangeModel(AdjustmentType.EXPAND, param, desired, false, null);
checkInside(adjToDist, distToAdj);
}
Aggregations