Estimates transformation between the 2 cameras making a stereo pair. If we have a stereo camera, where the relative position and orientatation of the 2 cameras is fixed, and if we computed poses of an object relative to the fist camera and to the second camera, (R1, T1) and (R2, T2), respectively (that can be done with cvFindExtrinsicCameraParams2), obviously, those poses will relate to each other, i.e. given (R1, T1) it should be possible to compute (R2, T2) - we only need to know the position and orientation of the 2nd camera relative to the 1st camera. That's what the described function does. It computes (R, T) such that:
R2=R*R1,
T2=R*T1 + T

C# | Visual Basic | Visual C++ |
public static void StereoCalibrate( Point3D<float>[][] objectPoints, Point2D<float>[][] imagePoints1, Point2D<float>[][] imagePoints2, IntrinsicCameraParameters intrinsicParam1, IntrinsicCameraParameters intrinsicParam2, ref MCvSize imageSize, CALIB_TYPE flags, ref MCvTermCriteria termCrit, out ExtrinsicCameraParameters extrinsicParams, out Matrix<float> foundamentalMatrix, out Matrix<float> essentialMatrix )
Public Shared Sub StereoCalibrate ( _ objectPoints As Point3D(Of Single)()(), _ imagePoints1 As Point2D(Of Single)()(), _ imagePoints2 As Point2D(Of Single)()(), _ intrinsicParam1 As IntrinsicCameraParameters, _ intrinsicParam2 As IntrinsicCameraParameters, _ ByRef imageSize As MCvSize, _ flags As CALIB_TYPE, _ ByRef termCrit As MCvTermCriteria, _ <OutAttribute> ByRef extrinsicParams As ExtrinsicCameraParameters, _ <OutAttribute> ByRef foundamentalMatrix As Matrix(Of Single), _ <OutAttribute> ByRef essentialMatrix As Matrix(Of Single) _ )
public: static void StereoCalibrate( array<array<Point3D<float>^>^>^ objectPoints, array<array<Point2D<float>^>^>^ imagePoints1, array<array<Point2D<float>^>^>^ imagePoints2, IntrinsicCameraParameters^ intrinsicParam1, IntrinsicCameraParameters^ intrinsicParam2, MCvSize% imageSize, CALIB_TYPE flags, MCvTermCriteria% termCrit, [OutAttribute] ExtrinsicCameraParameters^% extrinsicParams, [OutAttribute] Matrix<float>^% foundamentalMatrix, [OutAttribute] Matrix<float>^% essentialMatrix )

- objectPoints (array< array< Point3D<(Of <(Single>)>) >[]()[] >[]()[])
- The 3D location of the object points. The first index is the index of image, second index is the index of the point
- imagePoints1 (array< array< Point2D<(Of <(Single>)>) >[]()[] >[]()[])
- The 2D image location of the points. The first index is the index of the image, second index is the index of the point
- imagePoints2 (array< array< Point2D<(Of <(Single>)>) >[]()[] >[]()[])
- The 2D image location of the points. The first index is the index of the image, second index is the index of the point
- intrinsicParam1 (IntrinsicCameraParameters)
- The intrisinc parameters, might contains some initial values. The values will be modified by this function.
- intrinsicParam2 (IntrinsicCameraParameters)
- The intrisinc parameters, might contains some initial values. The values will be modified by this function.
- imageSize ( MCvSize %)
- Size of the image, used only to initialize intrinsic camera matrix
- flags (CALIB_TYPE)
- Different flags
- termCrit ( MCvTermCriteria %)
- Termination criteria for the iterative optimiziation algorithm
- extrinsicParams ( ExtrinsicCameraParameters %)
- The extrinsic parameters which contains: R - The rotation matrix between the 1st and the 2nd cameras' coordinate systems; T - The translation vector between the cameras' coordinate systems.