Replaced CV_RANSAC in findHomography with CV_LMEDS (videostab)

pull/2/head
Alexey Spizhevoy 13 years ago
parent 54f92013b0
commit 30431b94d9
  1. 2
      modules/videostab/src/global_motion.cpp
  2. 6
      modules/videostab/src/motion_stabilizing.cpp

@ -429,7 +429,7 @@ Mat MotionEstimatorRansacL2::estimate(InputArray points0, InputArray points1, bo
else else
{ {
vector<uchar> mask; vector<uchar> mask;
M = findHomography(points0, points1, mask, CV_RANSAC, ransacParams_.thresh); M = findHomography(points0, points1, mask, CV_LMEDS);
for (int i = 0; i < npoints; ++i) for (int i = 0; i < npoints; ++i)
if (mask[i]) ninliers++; if (mask[i]) ninliers++;
} }

@ -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, 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); 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] = pt[i].x-tw;
rowlb_[r+1] = pt[i].y-th; rowub_[r+1] = pt[i].y+th; rowub_[r] = pt[i].x+tw;
rowlb_[r+1] = pt[i].y-th;
rowub_[r+1] = pt[i].y+th;
} }
} }

Loading…
Cancel
Save