Search in sources :

Example 1 with Rodrigues_F32

use of georegression.struct.so.Rodrigues_F32 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

PointToPixelTransform_F32 (boofcv.struct.distort.PointToPixelTransform_F32)1 UtilVector3D_F32 (georegression.geometry.UtilVector3D_F32)1 Point3D_F32 (georegression.struct.point.Point3D_F32)1 Vector3D_F32 (georegression.struct.point.Vector3D_F32)1 Rodrigues_F32 (georegression.struct.so.Rodrigues_F32)1 FMatrixRMaj (org.ejml.data.FMatrixRMaj)1