mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 19:20:28 +08:00
Fixed bug in videostab sample. Fixed model size in global estimators.
This commit is contained in:
parent
bf00eba093
commit
673f879ccd
@ -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(
|
||||
|
@ -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;
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user