From 4bd55c6f734d986465e25619704c87c77ee194b1 Mon Sep 17 00:00:00 2001 From: Ernest Galbrun Date: Fri, 4 Jul 2014 15:33:34 +0200 Subject: [PATCH] added comments and reference for Chambolle paper --- modules/cudaoptflow/include/opencv2/cudaoptflow.hpp | 5 ++++- modules/video/src/tvl1flow.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/cudaoptflow/include/opencv2/cudaoptflow.hpp b/modules/cudaoptflow/include/opencv2/cudaoptflow.hpp index 2cd78fac54..fa66ec1666 100644 --- a/modules/cudaoptflow/include/opencv2/cudaoptflow.hpp +++ b/modules/cudaoptflow/include/opencv2/cudaoptflow.hpp @@ -213,7 +213,10 @@ public: double gamma; /** - * parameter for robustness + * parameter used for motion estimation. It adds a variable allowing for illumination variations + * Set this parameter to 1. if you have varying illumination. + * See: Chambolle et al, A First-Order Primal-Dual Algorithm for Convex Problems with Applications to Imaging + * Journal of Mathematical imaging and vision, may 2011 Vol 40 issue 1, pp 120-145 */ double theta; diff --git a/modules/video/src/tvl1flow.cpp b/modules/video/src/tvl1flow.cpp index ebecc9bde8..25096683b5 100644 --- a/modules/video/src/tvl1flow.cpp +++ b/modules/video/src/tvl1flow.cpp @@ -100,7 +100,7 @@ protected: double tau; double lambda; double theta; - double gamma; + double gamma; int nscales; int warps; double epsilon; @@ -1320,7 +1320,7 @@ void OpticalFlowDual_TVL1::procOneScale(const Mat_& I0, const Mat_ remap(I1, I1w, flowMap1, flowMap2, INTER_CUBIC); remap(I1x, I1wx, flowMap1, flowMap2, INTER_CUBIC); remap(I1y, I1wy, flowMap1, flowMap2, INTER_CUBIC); - //calculate I1(x+u0) and its gradient + //calculate I1(x+u0) and its gradient calcGradRho(I0, I1w, I1wx, I1wy, u1, u2, grad, rho_c); float error = std::numeric_limits::max(); @@ -1440,7 +1440,7 @@ CV_INIT_ALGORITHM(OpticalFlowDual_TVL1, "DenseOpticalFlow.DualTVL1", obj.info()->addParam(obj, "outerIterations", obj.outerIterations, false, 0, 0, "outer iterations (number of inner loops) used in the numerical scheme"); obj.info()->addParam(obj, "gamma", obj.gamma, false, 0, 0, - "coefficient for additional Ali term"); + "coefficient for additional illumination variation term"); obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow)) } // namespace