Skip to content

Commit 27da0bb

Browse files
committed
video: moved CSRT tracking algorithm from opencv_contrib
1 parent 250b500 commit 27da0bb

11 files changed

+2117
-0
lines changed

doc/opencv.bib

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,3 +1553,9 @@ @inproceedings{Zuliani2014RANSACFD
15531553
year = {2014},
15541554
url = {http://www.marcozuliani.com/docs/RANSAC4Dummies.pdf}
15551555
}
1556+
@article{Lukezic_IJCV2018,
1557+
author={Luke{\v{z}}i{\v{c}}, Alan and Voj{'i}{\v{r}}, Tom{'a}{\v{s}} and {\v{C}}ehovin Zajc, Luka and Matas, Ji{\v{r}}{'i} and Kristan, Matej},
1558+
title={Discriminative Correlation Filter Tracker with Channel and Spatial Reliability},
1559+
journal={International Journal of Computer Vision},
1560+
year={2018},
1561+
}

modules/video/include/opencv2/video/tracking.hpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,69 @@ class CV_EXPORTS_W TrackerVit : public Tracker
978978
// bool update(InputArray image, CV_OUT Rect& boundingBox) CV_OVERRIDE;
979979
};
980980

981+
982+
/** @brief the CSRT tracker
983+
984+
The implementation is based on @cite Lukezic_IJCV2018 Discriminative Correlation Filter with Channel and Spatial Reliability
985+
*/
986+
class CV_EXPORTS_W TrackerCSRT : public Tracker
987+
{
988+
protected:
989+
TrackerCSRT(); // use ::create()
990+
public:
991+
virtual ~TrackerCSRT() CV_OVERRIDE;
992+
993+
struct CV_EXPORTS_W_SIMPLE Params
994+
{
995+
CV_WRAP Params();
996+
997+
CV_PROP_RW bool use_hog;
998+
CV_PROP_RW bool use_color_names;
999+
CV_PROP_RW bool use_gray;
1000+
CV_PROP_RW bool use_rgb;
1001+
CV_PROP_RW bool use_channel_weights;
1002+
CV_PROP_RW bool use_segmentation;
1003+
1004+
CV_PROP_RW std::string window_function; //!< Window function: "hann", "cheb", "kaiser"
1005+
CV_PROP_RW float kaiser_alpha;
1006+
CV_PROP_RW float cheb_attenuation;
1007+
1008+
CV_PROP_RW float template_size;
1009+
CV_PROP_RW float gsl_sigma;
1010+
CV_PROP_RW float hog_orientations;
1011+
CV_PROP_RW float hog_clip;
1012+
CV_PROP_RW float padding;
1013+
CV_PROP_RW float filter_lr;
1014+
CV_PROP_RW float weights_lr;
1015+
CV_PROP_RW int num_hog_channels_used;
1016+
CV_PROP_RW int admm_iterations;
1017+
CV_PROP_RW int histogram_bins;
1018+
CV_PROP_RW float histogram_lr;
1019+
CV_PROP_RW int background_ratio;
1020+
CV_PROP_RW int number_of_scales;
1021+
CV_PROP_RW float scale_sigma_factor;
1022+
CV_PROP_RW float scale_model_max_area;
1023+
CV_PROP_RW float scale_lr;
1024+
CV_PROP_RW float scale_step;
1025+
1026+
CV_PROP_RW float psr_threshold; //!< we lost the target, if the psr is lower than this.
1027+
};
1028+
1029+
/** @brief Create CSRT tracker instance
1030+
@param parameters CSRT parameters TrackerCSRT::Params
1031+
*/
1032+
static CV_WRAP Ptr<TrackerCSRT> create(const TrackerCSRT::Params &parameters = TrackerCSRT::Params());
1033+
1034+
CV_WRAP virtual void setInitialMask(InputArray mask) = 0;
1035+
1036+
//! Return estimated tracking confidence
1037+
CV_WRAP virtual float getTrackingScore() const = 0;
1038+
};
1039+
1040+
9811041
//! @} video_track
9821042

9831043
} // cv
9841044

1045+
9851046
#endif

modules/video/misc/python/pyopencv_video.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#ifdef HAVE_OPENCV_VIDEO
22
typedef TrackerMIL::Params TrackerMIL_Params;
3+
typedef TrackerCSRT::Params TrackerCSRT_Params;
34
typedef TrackerGOTURN::Params TrackerGOTURN_Params;
45
typedef TrackerDaSiamRPN::Params TrackerDaSiamRPN_Params;
56
typedef TrackerNano::Params TrackerNano_Params;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy