1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 08:44:11 +08:00

Median flow tracker update (#952)

* Fix several issues in TrackerMedianFlow implementation

Particularly, add possibility to tune optical flow parameters for a median
flow tracker.

* Improve code of TrackerMedianFlow

Replace a lot of calls of std::vector::erase by one call of
std::remove_if.

* Delete unused code, use norm from OpenCV

* medianFlow:turn getMedian method into function, small code cleanup

* TrackerMedianFlow:fixes in parameters I/O, add test for them

* TrackerMedianFlow:replace double with float in temp buffers

* Fix indentation

* TrackerMedianFlow:add absent parameter case handling in read()

* TrackerMedianFlow:use ROI instead of copy when getting a patch

* TrackerMedianFlow:don't calc image pyramids 2 times

* MedianFlowTracker: use cvIsNan()

* MedianFlow: refactor vector filtration code

* MedianFlow: change if statements layout in filterPointsInVectors
This commit is contained in:
Vladislav Sovrasov
2017-02-08 16:53:48 +03:00
committed by Vadim Pisarevsky
parent 7e5ca520e3
commit f2c324a280
3 changed files with 342 additions and 182 deletions

View File

@@ -1156,9 +1156,16 @@ class CV_EXPORTS TrackerMedianFlow : public Tracker
public:
struct CV_EXPORTS Params
{
Params();
int pointsInGrid; //!<square root of number of keypoints used; increase it to trade
//!<accurateness for speed; default value is sensible and recommended
Params(); //!<default constructor
//!<note that the default values of parameters are recommended for most of use cases
int pointsInGrid; //!<square root of number of keypoints used; increase it to trade
//!<accurateness for speed
cv::Size winSize; //!<window size parameter for Lucas-Kanade optical flow
int maxLevel; //!<maximal pyramid level number for Lucas-Kanade optical flow
TermCriteria termCriteria; //!<termination criteria for Lucas-Kanade optical flow
cv::Size winSizeNCC; //!<window size around a point for normalized cross-correlation check
double maxMedianLengthOfDisplacementDifference; //!<criterion for loosing the tracked object
void read( const FileNode& /*fn*/ );
void write( FileStorage& /*fs*/ ) const;
};