From 30431b94d9558dc98f4e9a1e4b3c74bb96248a12 Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Fri, 27 Apr 2012 12:38:33 +0000 Subject: [PATCH] Replaced CV_RANSAC in findHomography with CV_LMEDS (videostab) --- modules/videostab/src/global_motion.cpp | 2 +- modules/videostab/src/motion_stabilizing.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/videostab/src/global_motion.cpp b/modules/videostab/src/global_motion.cpp index a835943..c9998ab 100644 --- a/modules/videostab/src/global_motion.cpp +++ b/modules/videostab/src/global_motion.cpp @@ -429,7 +429,7 @@ Mat MotionEstimatorRansacL2::estimate(InputArray points0, InputArray points1, bo else { vector mask; - M = findHomography(points0, points1, mask, CV_RANSAC, ransacParams_.thresh); + M = findHomography(points0, points1, mask, CV_LMEDS); for (int i = 0; i < npoints; ++i) if (mask[i]) ninliers++; } diff --git a/modules/videostab/src/motion_stabilizing.cpp b/modules/videostab/src/motion_stabilizing.cpp index 417ccf7..800ac80 100644 --- a/modules/videostab/src/motion_stabilizing.cpp +++ b/modules/videostab/src/motion_stabilizing.cpp @@ -264,8 +264,10 @@ void LpMotionStabilizer::stabilize( { set(r, c, pt[i].x); set(r, c+1, pt[i].y); set(r, c+2, 1); set(r+1, c, pt[i].y); set(r+1, c+1, -pt[i].x); set(r+1, c+3, 1); - rowlb_[r] = pt[i].x-tw; rowub_[r] = pt[i].x+tw; - rowlb_[r+1] = pt[i].y-th; rowub_[r+1] = pt[i].y+th; + rowlb_[r] = pt[i].x-tw; + rowub_[r] = pt[i].x+tw; + rowlb_[r+1] = pt[i].y-th; + rowub_[r+1] = pt[i].y+th; } } -- 2.7.4