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;
}