diff --git a/modules/videostab/src/global_motion.cpp b/modules/videostab/src/global_motion.cpp index 3fc4c2b39b..a835943d7e 100644 --- a/modules/videostab/src/global_motion.cpp +++ b/modules/videostab/src/global_motion.cpp @@ -460,9 +460,6 @@ Mat MotionEstimatorL1::estimate(InputArray points0, InputArray points1, bool *ok const int npoints = points0.getMat().checkVector(2); CV_Assert(points1.getMat().checkVector(2) == npoints); - const Point2f *points0_ = points0.getMat().ptr(); - const Point2f *points1_ = points1.getMat().ptr(); - #ifndef HAVE_CLP CV_Error(CV_StsError, "The library is built without Clp support"); @@ -475,6 +472,9 @@ Mat MotionEstimatorL1::estimate(InputArray points0, InputArray points1, bool *ok // prepare LP problem + const Point2f *points0_ = points0.getMat().ptr(); + const Point2f *points1_ = points1.getMat().ptr(); + int ncols = 6 + 2*npoints; int nrows = 4*npoints;