[][src]Function opencv::calib3d::find_essential_mat_1

pub fn find_essential_mat_1(
    points1: &dyn ToInputArray,
    points2: &dyn ToInputArray,
    camera_matrix1: &dyn ToInputArray,
    dist_coeffs1: &dyn ToInputArray,
    camera_matrix2: &dyn ToInputArray,
    dist_coeffs2: &dyn ToInputArray,
    method: i32,
    prob: f64,
    threshold: f64,
    mask: &mut dyn ToOutputArray
) -> Result<Mat>

Calculates an essential matrix from the corresponding points in two images from potentially two different cameras.

Parameters

  • points1: Array of N (N >= 5) 2D points from the first image. The point coordinates should be floating-point (single or double precision).
  • points2: Array of the second image points of the same size and format as points1 .
  • cameraMatrix1: Camera matrix inline formula . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix. If this assumption does not hold for your use case, use undistortPoints() with P = cv::NoArray() for both cameras to transform image points to normalized image coordinates, which are valid for the identity camera matrix. When passing these coordinates, pass the identity matrix for this parameter.
  • cameraMatrix2: Camera matrix inline formula . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix. If this assumption does not hold for your use case, use undistortPoints() with P = cv::NoArray() for both cameras to transform image points to normalized image coordinates, which are valid for the identity camera matrix. When passing these coordinates, pass the identity matrix for this parameter.
  • distCoeffs1: Input vector of distortion coefficients inline formula of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
  • distCoeffs2: Input vector of distortion coefficients inline formula of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
  • method: Method for computing an essential matrix.
  • RANSAC for the RANSAC algorithm.
  • LMEDS for the LMedS algorithm.
  • prob: Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
  • threshold: Parameter used for RANSAC. It is the maximum distance from a point to an epipolar line in pixels, beyond which the point is considered an outlier and is not used for computing the final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the point localization, image resolution, and the image noise.
  • mask: Output array of N elements, every element of which is set to 0 for outliers and to 1 for the other points. The array is computed only in the RANSAC and LMedS methods.

This function estimates essential matrix based on the five-point algorithm solver in Nister03 . SteweniusCFS is also a related. The epipolar geometry is described by the following equation:

block formula

where inline formula is an essential matrix, inline formula and inline formula are corresponding points in the first and the second images, respectively. The result of this function may be passed further to decomposeEssentialMat or recoverPose to recover the relative pose between cameras.

C++ default parameters

  • method: RANSAC
  • prob: 0.999
  • threshold: 1.0
  • mask: noArray()