diff --git a/src/OpenCvSharp/Cv2/Cv2_video.cs b/src/OpenCvSharp/Cv2/Cv2_video.cs index 75bc68d71..f150ca1dd 100644 --- a/src/OpenCvSharp/Cv2/Cv2_video.cs +++ b/src/OpenCvSharp/Cv2/Cv2_video.cs @@ -202,9 +202,12 @@ public static void CalcOpticalFlowPyrLK( /// /// public static void CalcOpticalFlowPyrLK( - InputArray prevImg, InputArray nextImg, - Point2f[] prevPts, ref Point2f[] nextPts, - out byte[] status, out float[] err, + InputArray prevImg, + InputArray nextImg, + Point2f[] prevPts, + ref Point2f[] nextPts, + out byte[] status, + out float[] err, Size? winSize = null, int maxLevel = 3, TermCriteria? criteria = null, @@ -226,7 +229,7 @@ public static void CalcOpticalFlowPyrLK( var criteria0 = criteria.GetValueOrDefault( TermCriteria.Both(30, 0.01)); - using var nextPtsVec = new VectorOfPoint2f(); + using var nextPtsVec = new VectorOfPoint2f(nextPts); using var statusVec = new VectorOfByte(); using var errVec = new VectorOfFloat(); NativeMethods.HandleException(