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

This commit is contained in:
Alexey Spizhevoy 2012-04-10 09:07:30 +00:00
parent bf00eba093
commit 673f879ccd
3 changed files with 10 additions and 6 deletions

View File

@ -80,11 +80,11 @@ struct CV_EXPORTS RansacParams
RansacParams(int size, float thresh, float eps, float prob)
: size(size), thresh(thresh), eps(eps), prob(prob) {}
static RansacParams translation2dMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }
static RansacParams translationAndScale2dMotionStd() { return RansacParams(3, 0.5f, 0.5f, 0.99f); }
static RansacParams linearSimilarity2dMotionStd() { return RansacParams(4, 0.5f, 0.5f, 0.99f); }
static RansacParams affine2dMotionStd() { return RansacParams(6, 0.5f, 0.5f, 0.99f); }
static RansacParams homography2dMotionStd() { return RansacParams(8, 0.5f, 0.5f, 0.99f); }
static RansacParams translation2dMotionStd() { return RansacParams(1, 0.5f, 0.5f, 0.99f); }
static RansacParams translationAndScale2dMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }
static RansacParams linearSimilarity2dMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); }
static RansacParams affine2dMotionStd() { return RansacParams(3, 0.5f, 0.5f, 0.99f); }
static RansacParams homography2dMotionStd() { return RansacParams(4, 0.5f, 0.5f, 0.99f); }
};
CV_EXPORTS Mat estimateGlobalMotionRobust(

View File

@ -377,7 +377,7 @@ Mat PyrLkRobustMotionEstimator::estimate(const Mat &frame0, const Mat &frame1)
else
{
vector<uchar> mask;
M = findHomography(pointsPrevGood_, pointsGood_, CV_RANSAC, ransacParams_.thresh, mask);
M = findHomography(pointsPrevGood_, pointsGood_, mask, CV_RANSAC, ransacParams_.thresh);
ninliers = 0;
rmse = 0;

View File

@ -262,8 +262,12 @@ int main(int argc, const char **argv)
}
if (arg("save-motions") != "no")
{
MotionModel model = stabilizer->motionEstimator()->motionModel();
stabilizer->setMotionEstimator(
new ToFileMotionWriter(arg("save-motions"), stabilizer->motionEstimator()));
stabilizer->motionEstimator()->setMotionModel(model);
}
stabilizer->setRadius(argi("radius"));
if (arg("deblur") == "yes")