Class RectifyCalibrated
- java.lang.Object
-
- boofcv.alg.geo.rectify.RectifyCalibrated
-
public class RectifyCalibrated extends java.lang.ObjectRectifies a stereo pair with known camera calibration using a simple algorithm described in [1] such that the epipoles project to infinity along the x-axis. After rectification both images will have the same intrinsic calibration matrix, same extrinsic rotation matrix, but the optical centers are not modified.
The calibration matrix is the standard upper triangular matrix used throughout the library. A single calibration matrix is computed for both images by averaging the two original and setting the skew to zero.
The rectified view is chosen such that it will be most similar to the first camera. This is done by making the original z-axis and the rectified z-axis similar.
[1] A. Fusiello, E. Trucco, and A. Verri, "A Compact Algorithm for Rectification of Stereo Pairs" Machine Vision and Applications, 2000
-
-
Constructor Summary
Constructors Constructor Description RectifyCalibrated()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.ejml.data.DMatrixRMajgetCalibrationMatrix()If a single calibration matrix was requested then this returns it.org.ejml.data.DMatrixRMajgetRect1()Rectification transform for first cameraorg.ejml.data.DMatrixRMajgetRect2()Rectification transform for second cameraorg.ejml.data.DMatrixRMajgetRectifiedRotation()Rotation matrix of rectified coordinate system.voidprocess(org.ejml.data.DMatrixRMaj K1, georegression.struct.se.Se3_F64 worldToCamera1, org.ejml.data.DMatrixRMaj K2, georegression.struct.se.Se3_F64 worldToCamera2)Computes rectification transforms for both cameras and optionally a single calibration matrix.
-
-
-
Method Detail
-
process
public void process(org.ejml.data.DMatrixRMaj K1, georegression.struct.se.Se3_F64 worldToCamera1, org.ejml.data.DMatrixRMaj K2, georegression.struct.se.Se3_F64 worldToCamera2)Computes rectification transforms for both cameras and optionally a single calibration matrix.- Parameters:
K1- Calibration matrix for first camera.worldToCamera1- Location of the first camera.K2- Calibration matrix for second camera.worldToCamera2- Location of the second camera.
-
getRect1
public org.ejml.data.DMatrixRMaj getRect1()
Rectification transform for first camera
-
getRect2
public org.ejml.data.DMatrixRMaj getRect2()
Rectification transform for second camera
-
getCalibrationMatrix
public org.ejml.data.DMatrixRMaj getCalibrationMatrix()
If a single calibration matrix was requested then this returns it.- Returns:
- Calibration matrix for both cameras
-
getRectifiedRotation
public org.ejml.data.DMatrixRMaj getRectifiedRotation()
Rotation matrix of rectified coordinate system. To convert back into left camera reference frame multiply the triangulated point by the transpose of this matrix- Returns:
- Rotation matrix
-
-