5#ifndef OPENCV_VIDEO_DETAIL_TRACKING_HPP
6#define OPENCV_VIDEO_DETAIL_TRACKING_HPP
18#include "opencv2/core.hpp"
22inline namespace tracking {
41 void compute(
const std::vector<Mat>& images,
Mat& response);
44 virtual bool computeImpl(
const std::vector<Mat>& images,
Mat& response) = 0;
86 void clearResponses();
87 bool blockAddTrackerFeature;
89 std::vector<Ptr<TrackerFeature>> features;
90 std::vector<Mat> responses;
112 virtual bool sampling(
const Mat& image,
const Rect& boundingBox, std::vector<Mat>& sample) = 0;
143 const std::vector<Ptr<TrackerSamplerAlgorithm>>&
getSamplers()
const;
155 std::vector<Ptr<TrackerSamplerAlgorithm>> samplers;
156 std::vector<Mat> samples;
157 bool blockAddTrackerSampler;
214typedef std::vector<std::pair<Ptr<TrackerTargetState>,
float>>
ConfidenceMap;
243 void update(std::vector<ConfidenceMap>& confidenceMaps);
264 virtual void updateImpl(std::vector<ConfidenceMap>& confidenceMaps) = 0;
328 void clearCurrentConfidenceMap();
331 std::vector<ConfidenceMap> confidenceMaps;
337 virtual void modelEstimationImpl(
const std::vector<Mat>& responses) = 0;
338 virtual void modelUpdateImpl() = 0;
392 bool sampling(
const Mat& image,
const Rect& boundingBox, std::vector<Mat>& sample) CV_OVERRIDE;
399 std::vector<Mat> sampleImage(
const Mat& img,
int x,
int y,
int w,
int h,
float inrad,
float outrad = 0,
int maxnum = 1000000);
n-dimensional dense array class
Definition: mat.hpp:802
Random Number Generator
Definition: core.hpp:2783
Template class for 2D rectangles
Definition: core/types.hpp:421
Abstract base class for TrackerFeature that represents the feature.
Definition: tracking.detail.hpp:33
void compute(const std::vector< Mat > &images, Mat &response)
Compute the features in the images collection
Class that manages the extraction and selection of features
Definition: tracking.detail.hpp:60
void extraction(const std::vector< Mat > &images)
Extract features from the images collection
bool addTrackerFeature(const Ptr< TrackerFeature > &feature)
Add TrackerFeature in the collection. Return true if TrackerFeature is added, false otherwise
const std::vector< Mat > & getResponses() const
Get the responses
const std::vector< Ptr< TrackerFeature > > & getTrackerFeatures() const
Get the TrackerFeature collection (TrackerFeature name, TrackerFeature pointer)
Abstract class that represents the model of the target.
Definition: tracking.detail.hpp:277
bool setTrackerStateEstimator(Ptr< TrackerStateEstimator > trackerStateEstimator)
Set TrackerEstimator, return true if the tracker state estimator is added, false otherwise
Ptr< TrackerStateEstimator > getTrackerStateEstimator() const
Get the TrackerStateEstimator
void modelUpdate()
Update the model
void modelEstimation(const std::vector< Mat > &responses)
Estimate the most likely target location
Ptr< TrackerTargetState > getLastTargetState() const
Get the last TrackerTargetState from Trajectory
void setLastTargetState(const Ptr< TrackerTargetState > &lastTargetState)
Set the current TrackerTargetState in the Trajectory
bool runStateEstimator()
Run the TrackerStateEstimator, return true if is possible to estimate a new state,...
const ConfidenceMap & getLastConfidenceMap() const
Get the last ConfidenceMap for the current frame
const std::vector< ConfidenceMap > & getConfidenceMaps() const
Get the list of the ConfidenceMap
Abstract base class for TrackerSamplerAlgorithm that represents the algorithm for the specific sample...
Definition: tracking.detail.hpp:99
virtual bool sampling(const Mat &image, const Rect &boundingBox, std::vector< Mat > &sample)=0
Computes the regions starting from a position in an image.
TrackerSampler based on CSC (current state centered), used by MIL algorithm TrackerMIL
Definition: tracking.detail.hpp:350
void setMode(int samplingMode)
Set the sampling mode of TrackerSamplerCSC
bool sampling(const Mat &image, const Rect &boundingBox, std::vector< Mat > &sample) CV_OVERRIDE
Computes the regions starting from a position in an image.
TrackerSamplerCSC(const TrackerSamplerCSC::Params ¶meters=TrackerSamplerCSC::Params())
Constructor
MODE
Definition: tracking.detail.hpp:355
Class that manages the sampler in order to select regions for the update the model of the tracker [AA...
Definition: tracking.detail.hpp:129
bool addTrackerSamplerAlgorithm(const Ptr< TrackerSamplerAlgorithm > &sampler)
Add TrackerSamplerAlgorithm in the collection. Return true if sampler is added, false otherwise
const std::vector< Ptr< TrackerSamplerAlgorithm > > & getSamplers() const
Return the collection of the TrackerSamplerAlgorithm
const std::vector< Mat > & getSamples() const
Return the samples from all TrackerSamplerAlgorithm, Fig. 1 variable Sk
void sampling(const Mat &image, Rect boundingBox)
Computes the regions starting from a position in an image
Abstract base class for TrackerStateEstimator that estimates the most likely target state.
Definition: tracking.detail.hpp:231
static Ptr< TrackerStateEstimator > create(const String &trackeStateEstimatorType)
Create TrackerStateEstimator by tracker state estimator type
void update(std::vector< ConfidenceMap > &confidenceMaps)
Update the ConfidenceMap with the scores
String getClassName() const
Get the name of the specific TrackerStateEstimator
Ptr< TrackerTargetState > estimate(const std::vector< ConfidenceMap > &confidenceMaps)
Estimate the most likely target state, return the estimated state
Abstract base class for TrackerTargetState that represents a possible state of the target.
Definition: tracking.detail.hpp:172
Point2f getTargetPosition() const
Get the position
int getTargetHeight() const
Get the height of the target
void setTargetHeight(int height)
Set the height of the target
void setTargetPosition(const Point2f &position)
Set the position
void setTargetWidth(int width)
Set the width of the target
int getTargetWidth() const
Get the width of the target
std::vector< Ptr< TrackerTargetState > > Trajectory
Represents the estimate states for all frames
Definition: tracking.detail.hpp:222
std::vector< std::pair< Ptr< TrackerTargetState >, float > > ConfidenceMap
Represents the model of the target at frame (all states and scores)
Definition: tracking.detail.hpp:214
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74
Definition: tracking.detail.hpp:364
int trackMaxNegNum
Definition: tracking.detail.hpp:371
float initInRad
radius for gathering positive instances during init
Definition: tracking.detail.hpp:366
float trackInPosRad
radius for gathering positive instances during tracking
Definition: tracking.detail.hpp:367
int initMaxNegNum
Definition: tracking.detail.hpp:369
float searchWinSize
size of search window
Definition: tracking.detail.hpp:368
int trackMaxPosNum
Definition: tracking.detail.hpp:370