Fixed parsing cmd args bug (videostab)
This commit is contained in:
parent
f355f798a4
commit
e49ea39a1f
@ -93,7 +93,7 @@ void printHelp()
|
|||||||
" --stdev=(<float_number>|auto)\n"
|
" --stdev=(<float_number>|auto)\n"
|
||||||
" Set smoothing weights standard deviation. The default is auto\n"
|
" Set smoothing weights standard deviation. The default is auto\n"
|
||||||
" (i.e. sqrt(radius)).\n"
|
" (i.e. sqrt(radius)).\n"
|
||||||
" -lp, --lp-stab=(yes|no)\n"
|
" -lps, --lin-prog-stab=(yes|no)\n"
|
||||||
" Turn on/off linear programming based stabilization method.\n"
|
" Turn on/off linear programming based stabilization method.\n"
|
||||||
" --lp-trim-ratio=(<float_number>|auto)\n"
|
" --lp-trim-ratio=(<float_number>|auto)\n"
|
||||||
" Trimming ratio used in linear programming based method.\n"
|
" Trimming ratio used in linear programming based method.\n"
|
||||||
@ -409,15 +409,15 @@ int main(int argc, const char **argv)
|
|||||||
#if HAVE_OPENCV_GPU
|
#if HAVE_OPENCV_GPU
|
||||||
PyrLkRobustMotionEstimatorGpu *est = 0;
|
PyrLkRobustMotionEstimatorGpu *est = 0;
|
||||||
|
|
||||||
if (arg("ws-model") == "transl")
|
if (arg("model") == "transl")
|
||||||
est = new PyrLkRobustMotionEstimatorGpu(MM_TRANSLATION);
|
est = new PyrLkRobustMotionEstimatorGpu(MM_TRANSLATION);
|
||||||
else if (arg("ws-model") == "transl_and_scale")
|
else if (arg("model") == "transl_and_scale")
|
||||||
est = new PyrLkRobustMotionEstimatorGpu(MM_TRANSLATION_AND_SCALE);
|
est = new PyrLkRobustMotionEstimatorGpu(MM_TRANSLATION_AND_SCALE);
|
||||||
else if (arg("ws-model") == "similarity")
|
else if (arg("model") == "similarity")
|
||||||
est = new PyrLkRobustMotionEstimatorGpu(MM_SIMILARITY);
|
est = new PyrLkRobustMotionEstimatorGpu(MM_SIMILARITY);
|
||||||
else if (arg("ws-model") == "affine")
|
else if (arg("model") == "affine")
|
||||||
est = new PyrLkRobustMotionEstimatorGpu(MM_AFFINE);
|
est = new PyrLkRobustMotionEstimatorGpu(MM_AFFINE);
|
||||||
else if (arg("ws-model") == "homography")
|
else if (arg("model") == "homography")
|
||||||
est = new PyrLkRobustMotionEstimatorGpu(MM_HOMOGRAPHY);
|
est = new PyrLkRobustMotionEstimatorGpu(MM_HOMOGRAPHY);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -426,12 +426,12 @@ int main(int argc, const char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RansacParams ransac = est->ransacParams();
|
RansacParams ransac = est->ransacParams();
|
||||||
if (arg("ws-subset") != "auto") ransac.size = argi("ws-subset");
|
if (arg("subset") != "auto") ransac.size = argi("subset");
|
||||||
if (arg("ws-thresh") != "auto") ransac.thresh = argi("ws-thresh");
|
if (arg("thresh") != "auto") ransac.thresh = argi("thresh");
|
||||||
ransac.eps = argf("ws-outlier-ratio");
|
ransac.eps = argf("outlier-ratio");
|
||||||
est->setRansacParams(ransac);
|
est->setRansacParams(ransac);
|
||||||
|
|
||||||
est->setMinInlierRatio(argf("ws-min-inlier-ratio"));
|
est->setMinInlierRatio(argf("min-inlier-ratio"));
|
||||||
stabilizer->setMotionEstimator(est);
|
stabilizer->setMotionEstimator(est);
|
||||||
#else
|
#else
|
||||||
throw runtime_error("OpenCV is built without GPU support");
|
throw runtime_error("OpenCV is built without GPU support");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user