CvInvokeStereoRectify Method |
http://www.emgu.com
computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, that makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. On input the function takes the matrices computed by cvStereoCalibrate and on output it gives 2 rotation matrices and also 2 projection matrices in the new coordinates. The function is normally called after cvStereoCalibrate that computes both camera matrices, the distortion coefficients, R and T
Namespace:
Emgu.CV
Assembly:
Emgu.CV.World (in Emgu.CV.World.dll) Version: 4.1.1.3497 (4.1.1.3497)
Syntaxpublic static void StereoRectify(
IInputArray cameraMatrix1,
IInputArray distCoeffs1,
IInputArray cameraMatrix2,
IInputArray distCoeffs2,
Size imageSize,
IInputArray r,
IInputArray t,
IOutputArray r1,
IOutputArray r2,
IOutputArray p1,
IOutputArray p2,
IOutputArray q,
StereoRectifyType flags,
double alpha,
Size newImageSize,
ref Rectangle validPixRoi1,
ref Rectangle validPixRoi2
)
Public Shared Sub StereoRectify (
cameraMatrix1 As IInputArray,
distCoeffs1 As IInputArray,
cameraMatrix2 As IInputArray,
distCoeffs2 As IInputArray,
imageSize As Size,
r As IInputArray,
t As IInputArray,
r1 As IOutputArray,
r2 As IOutputArray,
p1 As IOutputArray,
p2 As IOutputArray,
q As IOutputArray,
flags As StereoRectifyType,
alpha As Double,
newImageSize As Size,
ByRef validPixRoi1 As Rectangle,
ByRef validPixRoi2 As Rectangle
)
public:
static void StereoRectify(
IInputArray^ cameraMatrix1,
IInputArray^ distCoeffs1,
IInputArray^ cameraMatrix2,
IInputArray^ distCoeffs2,
Size imageSize,
IInputArray^ r,
IInputArray^ t,
IOutputArray^ r1,
IOutputArray^ r2,
IOutputArray^ p1,
IOutputArray^ p2,
IOutputArray^ q,
StereoRectifyType flags,
double alpha,
Size newImageSize,
Rectangle% validPixRoi1,
Rectangle% validPixRoi2
)
static member StereoRectify :
cameraMatrix1 : IInputArray *
distCoeffs1 : IInputArray *
cameraMatrix2 : IInputArray *
distCoeffs2 : IInputArray *
imageSize : Size *
r : IInputArray *
t : IInputArray *
r1 : IOutputArray *
r2 : IOutputArray *
p1 : IOutputArray *
p2 : IOutputArray *
q : IOutputArray *
flags : StereoRectifyType *
alpha : float *
newImageSize : Size *
validPixRoi1 : Rectangle byref *
validPixRoi2 : Rectangle byref -> unit
Parameters
- cameraMatrix1
- Type: Emgu.CVIInputArray
The camera matrices [fx_k 0 cx_k; 0 fy_k cy_k; 0 0 1] - distCoeffs1
- Type: Emgu.CVIInputArray
The vectors of distortion coefficients for first camera, 4x1, 1x4, 5x1 or 1x5 - cameraMatrix2
- Type: Emgu.CVIInputArray
The camera matrices [fx_k 0 cx_k; 0 fy_k cy_k; 0 0 1] - distCoeffs2
- Type: Emgu.CVIInputArray
The vectors of distortion coefficients for second camera, 4x1, 1x4, 5x1 or 1x5 - imageSize
- Type: System.DrawingSize
Size of the image used for stereo calibration - r
- Type: Emgu.CVIInputArray
The rotation matrix between the 1st and the 2nd cameras' coordinate systems - t
- Type: Emgu.CVIInputArray
The translation vector between the cameras' coordinate systems - r1
- Type: Emgu.CVIOutputArray
3x3 Rectification transforms (rotation matrices) for the first camera - r2
- Type: Emgu.CVIOutputArray
3x3 Rectification transforms (rotation matrices) for the second camera - p1
- Type: Emgu.CVIOutputArray
3x4 Projection matrices in the new (rectified) coordinate systems - p2
- Type: Emgu.CVIOutputArray
3x4 Projection matrices in the new (rectified) coordinate systems - q
- Type: Emgu.CVIOutputArray
The optional output disparity-to-depth mapping matrix, 4x4, see cvReprojectImageTo3D. - flags
- Type: Emgu.CV.CvEnumStereoRectifyType
The operation flags, use ZeroDisparity for default - alpha
- Type: SystemDouble
Use -1 for default - newImageSize
- Type: System.DrawingSize
Use Size.Empty for default - validPixRoi1
- Type: System.DrawingRectangle
The valid pixel ROI for image1 - validPixRoi2
- Type: System.DrawingRectangle
The valid pixel ROI for image2
See Also