From e49ea39a1f2c1e91f91a3d666388f885f0913df7 Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Thu, 19 Apr 2012 12:16:45 +0000 Subject: [PATCH] Fixed parsing cmd args bug (videostab) --- samples/cpp/videostab.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/cpp/videostab.cpp b/samples/cpp/videostab.cpp index 5002bf269c..3420941c05 100644 --- a/samples/cpp/videostab.cpp +++ b/samples/cpp/videostab.cpp @@ -93,7 +93,7 @@ void printHelp() " --stdev=(|auto)\n" " Set smoothing weights standard deviation. The default is auto\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" " --lp-trim-ratio=(|auto)\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 PyrLkRobustMotionEstimatorGpu *est = 0; - if (arg("ws-model") == "transl") + if (arg("model") == "transl") 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); - else if (arg("ws-model") == "similarity") + else if (arg("model") == "similarity") est = new PyrLkRobustMotionEstimatorGpu(MM_SIMILARITY); - else if (arg("ws-model") == "affine") + else if (arg("model") == "affine") est = new PyrLkRobustMotionEstimatorGpu(MM_AFFINE); - else if (arg("ws-model") == "homography") + else if (arg("model") == "homography") est = new PyrLkRobustMotionEstimatorGpu(MM_HOMOGRAPHY); else { @@ -426,12 +426,12 @@ int main(int argc, const char **argv) } RansacParams ransac = est->ransacParams(); - if (arg("ws-subset") != "auto") ransac.size = argi("ws-subset"); - if (arg("ws-thresh") != "auto") ransac.thresh = argi("ws-thresh"); - ransac.eps = argf("ws-outlier-ratio"); + if (arg("subset") != "auto") ransac.size = argi("subset"); + if (arg("thresh") != "auto") ransac.thresh = argi("thresh"); + ransac.eps = argf("outlier-ratio"); est->setRansacParams(ransac); - est->setMinInlierRatio(argf("ws-min-inlier-ratio")); + est->setMinInlierRatio(argf("min-inlier-ratio")); stabilizer->setMotionEstimator(est); #else throw runtime_error("OpenCV is built without GPU support"); -- GitLab