Method FindEssentialMat
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
FindEssentialMat(InputArray, InputArray, InputArray, EssentialMatMethod, double, double, OutputArray)
Calculates an essential matrix from the corresponding points in two images.
public static Mat FindEssentialMat(InputArray points1, InputArray points2, InputArray cameraMatrix, EssentialMatMethod method = EssentialMatMethod.Ransac, double prob = 0.999, double threshold = 1, OutputArray mask = default)
Parameters
points1InputArrayArray of N (N >= 5) 2D points from the first image. The point coordinates should be floating-point (single or double precision).
points2InputArrayArray of the second image points of the same size and format as points1 .
cameraMatrixInputArrayCamera matrix K=⎡⎣⎢fx000fy0cxcy1⎤⎦⎥ . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix.
methodEssentialMatMethodMethod for computing an essential matrix. RANSAC for the RANSAC algorithm. LMEDS for the LMedS algorithm.
probdoubleParameter used for the RANSAC or LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
thresholddoubleParameter 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.
maskOutputArrayOutput 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.
Returns
- Mat
essential matrix
FindEssentialMat(InputArray, InputArray, double, Point2d, EssentialMatMethod, double, double, OutputArray)
Calculates an essential matrix from the corresponding points in two images.
public static Mat FindEssentialMat(InputArray points1, InputArray points2, double focal, Point2d pp, EssentialMatMethod method = EssentialMatMethod.Ransac, double prob = 0.999, double threshold = 1, OutputArray mask = default)
Parameters
points1InputArrayArray of N (N >= 5) 2D points from the first image. The point coordinates should be floating-point (single or double precision).
points2InputArrayArray of the second image por LMedS methods only. It specifies a desirable level of confidence (probability) that the estimated matrix is correct.
focaldoubleFocal length of the camera. Note that this function assumes that points1 and points2 are feature points from cameras with same focal length and principal point.
ppPoint2dprincipal point of the camera.
methodEssentialMatMethodMethod for computing an essential matrix. RANSAC for the RANSAC algorithm. LMEDS for the LMedS algorithm.
probdoubleParameter used for the RANSAC othe accuracy of the point localization, image resolution, and the image noise.
thresholddoubleParameter 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 ints of the same size and format as points1 .
maskOutputArrayOutput 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.
Returns
- Mat
essential matrix