use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class RefineMetricWorkingGraph method createProjectionModel.
/**
* Add camera projection to and from normalized image coordinate for the specified intrinsic parameters
*/
void createProjectionModel(BundlePinholeSimplified intrinsic) {
CameraPinholeBrown brown = new CameraPinholeBrown();
BundleAdjustmentOps.convert(intrinsic, 0, 0, brown);
LensDistortionNarrowFOV model = LensDistortionFactory.narrow(brown);
listPixelToNorm.add(model.undistort_F64(true, false));
listNormToPixel.add(model.distort_F64(false, true));
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class LookUpCameraInfo method lookupViewShape.
public void lookupViewShape(String viewID, ImageDimension shape) {
int cameraIdx = viewToCamera(viewID);
CameraPinholeBrown camera = listCalibration.get(cameraIdx);
shape.setTo(camera.width, camera.height);
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestObjectSerialization method tebstIntrinsicParamters.
@Test
void tebstIntrinsicParamters() {
CameraPinholeBrown original = new CameraPinholeBrown().fsetK(1, 2, 3, 4, 5, 6, 7).fsetRadial(8, 9).fsetTangental(10, 11);
CameraPinholeBrown found = serializeDeSerialize(original);
assertNotNull(found);
assertEquals(original.fx, found.fx, 1e-8);
assertEquals(original.fy, found.fy, 1e-8);
assertEquals(original.skew, found.skew, 1e-8);
assertEquals(original.cx, found.cx, 1e-8);
assertEquals(original.cy, found.cy, 1e-8);
assertEquals(original.width, found.width);
assertEquals(original.height, found.height);
assertEquals(original.radial[0], found.radial[0], 1e-8);
assertEquals(original.radial[1], found.radial[1], 1e-8);
assertEquals(original.t1, found.t1, 1e-8);
assertEquals(original.t2, found.t2, 1e-8);
}
use of boofcv.struct.calib.CameraPinholeBrown in project BoofCV by lessthanoptimal.
the class TestBaseDetectFiducialSquare method heavyLensRemoval.
/**
* Apply heavy lens distortion. This test will only pass if it's correctly removed.
*/
@Test
void heavyLensRemoval() {
int width = 640, height = 640;
CameraPinholeBrown intrinsic = new CameraPinholeBrown(500, 500, 0, width / 2, height / 2, width, height).fsetRadial(-0.01, -0.15);
checkDetectRender(width, height, intrinsic, true);
}
Aggregations