Mercurial Hosting > traffic-intelligence
changeset 418:ca5784652d57
updated use of calcOpticalFlowPyrLK for new signature, added minEigThreshold parameter in configuration file
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 03 Oct 2013 17:43:15 -0400 |
parents | a2ff03a52b73 |
children | 17c5f378c283 |
files | c/Parameters.cpp c/feature-based-tracking.cpp include/Parameters.hpp tracking.cfg |
diffstat | 4 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/c/Parameters.cpp Thu Sep 26 17:07:44 2013 -0400 +++ b/c/Parameters.cpp Thu Oct 03 17:43:15 2013 -0400 @@ -52,6 +52,7 @@ ("smoothing-halfwidth", po::value<int>(&nFramesSmoothing), "number of frames to smooth positions (half window)") ("max-number-iterations", po::value<int>(&maxNumberTrackingIterations), "maximum number of iterations to stop feature tracking") ("min-tracking-error", po::value<float>(&minTrackingError), "minimum error to reach to stop feature tracking") + ("min-feature-eig-threshold", po::value<float>(&minFeatureEigThreshold)->default_value(1e-4), "minimum eigen value of a 2x2 normal matrix of optical flow equations") ("min-feature-time", po::value<unsigned int>(&minFeatureTime), "minimum length of a feature (number of frames) to consider a feature for grouping") ("mm-connection-distance", po::value<float>(&mmConnectionDistance), "connection distance in feature grouping") ("mm-segmentation-distance", po::value<float>(&mmSegmentationDistance), "segmentation distance in feature grouping")
--- a/c/feature-based-tracking.cpp Thu Sep 26 17:07:44 2013 -0400 +++ b/c/feature-based-tracking.cpp Thu Oct 03 17:43:15 2013 -0400 @@ -164,7 +164,7 @@ if (!prevPts.empty()) { //::keyPoints2Points(prevKpts, prevPts); currPts.clear(); - calcOpticalFlowPyrLK(previousFrameBW, currentFrameBW, prevPts, currPts, status, errors, window, params.pyramidLevel, TermCriteria(3 /*static_cast<int>(TermCriteria::COUNT)+static_cast<int>(TermCriteria::EPS)*/, params.maxNumberTrackingIterations, params.minTrackingError), 0.5 /* unused */, 0); // OPTFLOW_USE_INITIAL_FLOW + calcOpticalFlowPyrLK(previousFrameBW, currentFrameBW, prevPts, currPts, status, errors, window, params.pyramidLevel, TermCriteria(3 /*static_cast<int>(TermCriteria::COUNT)+static_cast<int>(TermCriteria::EPS)*/, params.maxNumberTrackingIterations, params.minTrackingError), /* int flags = */ 0, params.minFeatureEigThreshold); /// \todo try calcOpticalFlowFarneback std::vector<Point2f> trackedPts;
--- a/include/Parameters.hpp Thu Sep 26 17:07:44 2013 -0400 +++ b/include/Parameters.hpp Thu Oct 03 17:43:15 2013 -0400 @@ -47,6 +47,7 @@ //int nFramesVelocity; int maxNumberTrackingIterations; float minTrackingError; + float minFeatureEigThreshold; unsigned int minFeatureTime; float mmConnectionDistance; float mmSegmentationDistance;
--- a/tracking.cfg Thu Sep 26 17:07:44 2013 -0400 +++ b/tracking.cfg Thu Oct 03 17:43:15 2013 -0400 @@ -49,6 +49,8 @@ max-number-iterations = 20 # minimum error to reach to stop feature tracking min-tracking-error = 0.3 +# minimum eigen value of a 2x2 normal matrix of optical flow equations +min-feature-eig-threshold = 1e-4 # minimum length of a feature (number of frames) to consider a feature for grouping min-feature-time = 20 # Min Max similarity parameters (Beymer et al. method)