Search in sources :

Example 36 with FMatrixRMaj

use of org.ejml.data.FMatrixRMaj in project BoofCV by lessthanoptimal.

the class DisplayFisheyeCalibrationPanel method setPinholeCenter.

public void setPinholeCenter(double pixelX, double pixelY) {
    this.pixelX = pixelX;
    this.pixelY = pixelY;
    var norm = new Point3D_F32();
    Objects.requireNonNull(fisheyeDistort);
    fisheyeDistort.undistortPtoS_F32().compute((float) pixelX, (float) pixelY, norm);
    var rotation = new Rodrigues_F32();
    var canonical = new Vector3D_F32(0, 0, 1);
    rotation.theta = UtilVector3D_F32.acute(new Vector3D_F32(norm), canonical);
    GeometryMath_F32.cross(canonical, norm, rotation.unitAxisRotation);
    rotation.unitAxisRotation.normalize();
    FMatrixRMaj R = ConvertRotation3D_F32.rodriguesToMatrix(rotation, null);
    Objects.requireNonNull(distorter);
    distorter.setRotationWideToNarrow(R);
    distortImage.setModel(new PointToPixelTransform_F32(distorter));
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) Vector3D_F32(georegression.struct.point.Vector3D_F32) UtilVector3D_F32(georegression.geometry.UtilVector3D_F32) FMatrixRMaj(org.ejml.data.FMatrixRMaj) Rodrigues_F32(georegression.struct.so.Rodrigues_F32) PointToPixelTransform_F32(boofcv.struct.distort.PointToPixelTransform_F32)

Aggregations

FMatrixRMaj (org.ejml.data.FMatrixRMaj)36 DMatrixRMaj (org.ejml.data.DMatrixRMaj)10 Test (org.junit.Test)8 Point2D_F32 (georegression.struct.point.Point2D_F32)7 Se3_F64 (georegression.struct.se.Se3_F64)7 RectifyCalibrated (boofcv.alg.geo.rectify.RectifyCalibrated)6 PointTransformHomography_F32 (boofcv.alg.distort.PointTransformHomography_F32)5 Point2Transform2_F32 (boofcv.struct.distort.Point2Transform2_F32)5 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)4 CameraPinholeRadial (boofcv.struct.calib.CameraPinholeRadial)4 BufferedImage (java.awt.image.BufferedImage)4 RectifiedPairPanel (boofcv.gui.stereo.RectifiedPairPanel)3 GrayF32 (boofcv.struct.image.GrayF32)3 GrayU8 (boofcv.struct.image.GrayU8)3 Planar (boofcv.struct.image.Planar)3 ArrayList (java.util.ArrayList)3 Test (org.junit.jupiter.api.Test)3 Estimate1ofEpipolar (boofcv.abst.geo.Estimate1ofEpipolar)2 CameraPinhole (boofcv.struct.calib.CameraPinhole)2 PointToPixelTransform_F32 (boofcv.struct.distort.PointToPixelTransform_F32)2