Commit 673f879c authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

Fixed bug in videostab sample. Fixed model size in global estimators.

parent bf00eba0
...@@ -80,11 +80,11 @@ struct CV_EXPORTS RansacParams ...@@ -80,11 +80,11 @@ struct CV_EXPORTS RansacParams
RansacParams(int size, float thresh, float eps, float prob) RansacParams(int size, float thresh, float eps, float prob)
: size(size), thresh(thresh), eps(eps), prob(prob) {} : size(size), thresh(thresh), eps(eps), prob(prob) {}
static RansacParams translation2dMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); } static RansacParams translation2dMotionStd() { return RansacParams(1, 0.5f, 0.5f, 0.99f); }
static RansacParams translationAndScale2dMotionStd() { return RansacParams(3, 0.5f, 0.5f, 0.99f); } static RansacParams translationAndScale2dMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }
static RansacParams linearSimilarity2dMotionStd() { return RansacParams(4, 0.5f, 0.5f, 0.99f); } static RansacParams linearSimilarity2dMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }
static RansacParams affine2dMotionStd() { return RansacParams(6, 0.5f, 0.5f, 0.99f); } static RansacParams affine2dMotionStd() { return RansacParams(3, 0.5f, 0.5f, 0.99f); }
static RansacParams homography2dMotionStd() { return RansacParams(8, 0.5f, 0.5f, 0.99f); } static RansacParams homography2dMotionStd() { return RansacParams(4, 0.5f, 0.5f, 0.99f); }
}; };
CV_EXPORTS Mat estimateGlobalMotionRobust( CV_EXPORTS Mat estimateGlobalMotionRobust(
......
...@@ -377,7 +377,7 @@ Mat PyrLkRobustMotionEstimator::estimate(const Mat &frame0, const Mat &frame1) ...@@ -377,7 +377,7 @@ Mat PyrLkRobustMotionEstimator::estimate(const Mat &frame0, const Mat &frame1)
else else
{ {
vector<uchar> mask; vector<uchar> mask;
M = findHomography(pointsPrevGood_, pointsGood_, CV_RANSAC, ransacParams_.thresh, mask); M = findHomography(pointsPrevGood_, pointsGood_, mask, CV_RANSAC, ransacParams_.thresh);
ninliers = 0; ninliers = 0;
rmse = 0; rmse = 0;
......
...@@ -262,8 +262,12 @@ int main(int argc, const char **argv) ...@@ -262,8 +262,12 @@ int main(int argc, const char **argv)
} }
if (arg("save-motions") != "no") if (arg("save-motions") != "no")
{
MotionModel model = stabilizer->motionEstimator()->motionModel();
stabilizer->setMotionEstimator( stabilizer->setMotionEstimator(
new ToFileMotionWriter(arg("save-motions"), stabilizer->motionEstimator())); new ToFileMotionWriter(arg("save-motions"), stabilizer->motionEstimator()));
stabilizer->motionEstimator()->setMotionModel(model);
}
stabilizer->setRadius(argi("radius")); stabilizer->setRadius(argi("radius"));
if (arg("deblur") == "yes") if (arg("deblur") == "yes")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment