Search in sources :

Example 96 with CameraPinholeBrown

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));
}
Also used : CameraPinholeBrown(boofcv.struct.calib.CameraPinholeBrown) LensDistortionNarrowFOV(boofcv.alg.distort.LensDistortionNarrowFOV)

Example 97 with CameraPinholeBrown

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);
}
Also used : CameraPinholeBrown(boofcv.struct.calib.CameraPinholeBrown)

Example 98 with CameraPinholeBrown

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);
}
Also used : CameraPinholeBrown(boofcv.struct.calib.CameraPinholeBrown) Test(org.junit.jupiter.api.Test)

Example 99 with CameraPinholeBrown

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);
}
Also used : CameraPinholeBrown(boofcv.struct.calib.CameraPinholeBrown) Test(org.junit.jupiter.api.Test)

Aggregations

CameraPinholeBrown (boofcv.struct.calib.CameraPinholeBrown)99 Test (org.junit.jupiter.api.Test)62 Se3_F64 (georegression.struct.se.Se3_F64)39 GrayF32 (boofcv.struct.image.GrayF32)29 Point2D_F64 (georegression.struct.point.Point2D_F64)19 SimulatePlanarWorld (boofcv.simulation.SimulatePlanarWorld)16 LensDistortionBrown (boofcv.alg.distort.brown.LensDistortionBrown)14 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)14 BufferedImage (java.awt.image.BufferedImage)14 ArrayList (java.util.ArrayList)12 CameraPinhole (boofcv.struct.calib.CameraPinhole)11 Point2Transform2_F64 (boofcv.struct.distort.Point2Transform2_F64)10 DMatrixRMaj (org.ejml.data.DMatrixRMaj)10 File (java.io.File)9 StereoParameters (boofcv.struct.calib.StereoParameters)6 GrayU8 (boofcv.struct.image.GrayU8)6 Point3D_F64 (georegression.struct.point.Point3D_F64)6 ImageBase (boofcv.struct.image.ImageBase)5 ImageType (boofcv.struct.image.ImageType)5 DogArray (org.ddogleg.struct.DogArray)5