[][src]Function opencv::calib3d::stereo_rectify_uncalibrated

pub fn stereo_rectify_uncalibrated(
    points1: &dyn ToInputArray,
    points2: &dyn ToInputArray,
    f: &dyn ToInputArray,
    img_size: Size,
    h1: &mut dyn ToOutputArray,
    h2: &mut dyn ToOutputArray,
    threshold: f64
) -> Result<bool>

Computes a rectification transform for an uncalibrated stereo camera.

Parameters

  • points1: Array of feature points in the first image.
  • points2: The corresponding points in the second image. The same formats as in findFundamentalMat are supported.
  • F: Input fundamental matrix. It can be computed from the same set of point pairs using findFundamentalMat .
  • imgSize: Size of the image.
  • H1: Output rectification homography matrix for the first image.
  • H2: Output rectification homography matrix for the second image.
  • threshold: Optional threshold used to filter out the outliers. If the parameter is greater than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points for which inline formula ) are rejected prior to computing the homographies. Otherwise, all the points are considered inliers.

The function computes the rectification transformations without knowing intrinsic parameters of the cameras and their relative position in the space, which explains the suffix "uncalibrated". Another related difference from stereoRectify is that the function outputs not the rectification transformations in the object (3D) space, but the planar perspective transformations encoded by the homography matrices H1 and H2 . The function implements the algorithm Hartley99 .

Note: While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion, it would be better to correct it before computing the fundamental matrix and calling this function. For example, distortion coefficients can be estimated for each head of stereo camera separately by using calibrateCamera . Then, the images can be corrected using undistort , or just the point coordinates can be corrected with undistortPoints .

C++ default parameters

  • threshold: 5