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));
}
Aggregations