OpenCvSharp.Cv2.StereoRectifyUncalibrated C# (CSharp) Method

StereoRectifyUncalibrated() public static method

computes the rectification transformation for an uncalibrated stereo camera (zero distortion is assumed)
public static StereoRectifyUncalibrated ( IEnumerable points1, IEnumerable points2, double F, Size imgSize, double &H1, double &H2, double threshold = 5 ) : bool
points1 IEnumerable Array of feature points in the first image.
points2 IEnumerable The corresponding points in the second image. /// The same formats as in findFundamentalMat() are supported.
F double Input fundamental matrix. It can be computed from the same set /// of point pairs using findFundamentalMat() .
imgSize Size Size of the image.
H1 double Output rectification homography matrix for the first image.
H2 double Output rectification homography matrix for the second image.
threshold double 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 |points2[i]^T * F * points1[i]| > threshold ) /// are rejected prior to computing the homographies. Otherwise, all the points are considered inliers.
return bool
        public static bool StereoRectifyUncalibrated(IEnumerable<Point2d> points1,
                                                     IEnumerable<Point2d> points2,
                                                     double[,] F, Size imgSize,
                                                     out double[,] H1, out double[,] H2,
                                                     double threshold = 5
            )
        {
            if (points1 == null)
                throw new ArgumentNullException(nameof(points1));
            if (points2 == null)
                throw new ArgumentNullException(nameof(points2));
            if (F == null)
                throw new ArgumentNullException(nameof(F));
            if (F.GetLength(0) != 3 || F.GetLength(1) != 3)
                throw new ArgumentException("F != double[3,3]");

            Point2d[] points1Array = EnumerableEx.ToArray(points1);
            Point2d[] points2Array = EnumerableEx.ToArray(points2);

            H1 = new double[3, 3];
            H2 = new double[3, 3];

            int ret = NativeMethods.calib3d_stereoRectifyUncalibrated_array(
                points1Array, points1Array.Length,
                points2Array, points2Array.Length,
                F, imgSize, H1, H2, threshold);
            return ret != 0;
        }

Same methods

Cv2::StereoRectifyUncalibrated ( InputArray points1, InputArray points2, InputArray F, Size imgSize, OutputArray H1, OutputArray H2, double threshold = 5 ) : bool
Cv2