44#ifndef OPENCV_TRACKING_HPP
45#define OPENCV_TRACKING_HPP
47#include "opencv2/core.hpp"
48#include "opencv2/imgproc.hpp"
56enum { OPTFLOW_USE_INITIAL_FLOW = 4,
57 OPTFLOW_LK_GET_MIN_EIGENVALS = 8,
58 OPTFLOW_FARNEBACK_GAUSSIAN = 256
122 Size winSize,
int maxLevel,
bool withDerivatives =
true,
125 bool tryReuseInputImage =
true );
181 Size winSize =
Size(21,21),
int maxLevel = 3,
183 int flags = 0,
double minEigThreshold = 1e-4 );
224 double pyr_scale,
int levels,
int winsize,
225 int iterations,
int poly_n,
double poly_sigma,
262 MOTION_TRANSLATION = 0,
263 MOTION_EUCLIDEAN = 1,
265 MOTION_HOMOGRAPHY = 3
279CV_EXPORTS_W
double computeECC(InputArray templateImage, InputArray inputImage, InputArray inputMask = noArray());
339 InputArray inputMask,
int gaussFiltSize);
346 InputArray inputMask = noArray());
370 CV_WRAP
KalmanFilter(
int dynamParams,
int measureParams,
int controlParams = 0,
int type = CV_32F );
379 void init(
int dynamParams,
int measureParams,
int controlParams = 0,
int type = CV_32F );
385 CV_WRAP
const Mat& predict(
const Mat& control =
Mat() );
391 CV_WRAP
const Mat& correct(
const Mat& measurement );
395 CV_PROP_RW
Mat transitionMatrix;
396 CV_PROP_RW
Mat controlMatrix;
397 CV_PROP_RW
Mat measurementMatrix;
398 CV_PROP_RW
Mat processNoiseCov;
399 CV_PROP_RW
Mat measurementNoiseCov;
400 CV_PROP_RW
Mat errorCovPre;
402 CV_PROP_RW
Mat errorCovPost;
448 CV_WRAP
virtual void collectGarbage() = 0;
466 CV_WRAP
virtual void calc(InputArray prevImg, InputArray nextImg,
478 CV_WRAP
virtual int getNumLevels()
const = 0;
479 CV_WRAP
virtual void setNumLevels(
int numLevels) = 0;
481 CV_WRAP
virtual double getPyrScale()
const = 0;
482 CV_WRAP
virtual void setPyrScale(
double pyrScale) = 0;
484 CV_WRAP
virtual bool getFastPyramids()
const = 0;
485 CV_WRAP
virtual void setFastPyramids(
bool fastPyramids) = 0;
487 CV_WRAP
virtual int getWinSize()
const = 0;
488 CV_WRAP
virtual void setWinSize(
int winSize) = 0;
490 CV_WRAP
virtual int getNumIters()
const = 0;
491 CV_WRAP
virtual void setNumIters(
int numIters) = 0;
493 CV_WRAP
virtual int getPolyN()
const = 0;
494 CV_WRAP
virtual void setPolyN(
int polyN) = 0;
496 CV_WRAP
virtual double getPolySigma()
const = 0;
497 CV_WRAP
virtual void setPolySigma(
double polySigma) = 0;
499 CV_WRAP
virtual int getFlags()
const = 0;
500 CV_WRAP
virtual void setFlags(
int flags) = 0;
504 double pyrScale = 0.5,
505 bool fastPyramids =
false,
509 double polySigma = 1.1,
532 CV_WRAP
virtual int getFixedPointIterations()
const = 0;
534 CV_WRAP
virtual void setFixedPointIterations(
int val) = 0;
539 CV_WRAP
virtual int getSorIterations()
const = 0;
541 CV_WRAP
virtual void setSorIterations(
int val) = 0;
545 CV_WRAP
virtual float getOmega()
const = 0;
547 CV_WRAP
virtual void setOmega(
float val) = 0;
551 CV_WRAP
virtual float getAlpha()
const = 0;
553 CV_WRAP
virtual void setAlpha(
float val) = 0;
557 CV_WRAP
virtual float getDelta()
const = 0;
559 CV_WRAP
virtual void setDelta(
float val) = 0;
563 CV_WRAP
virtual float getGamma()
const = 0;
565 CV_WRAP
virtual void setGamma(
float val) = 0;
589 PRESET_ULTRAFAST = 0,
597 CV_WRAP
virtual int getFinestScale()
const = 0;
599 CV_WRAP
virtual void setFinestScale(
int val) = 0;
604 CV_WRAP
virtual int getPatchSize()
const = 0;
606 CV_WRAP
virtual void setPatchSize(
int val) = 0;
611 CV_WRAP
virtual int getPatchStride()
const = 0;
613 CV_WRAP
virtual void setPatchStride(
int val) = 0;
618 CV_WRAP
virtual int getGradientDescentIterations()
const = 0;
620 CV_WRAP
virtual void setGradientDescentIterations(
int val) = 0;
626 CV_WRAP
virtual int getVariationalRefinementIterations()
const = 0;
628 CV_WRAP
virtual void setVariationalRefinementIterations(
int val) = 0;
632 CV_WRAP
virtual float getVariationalRefinementAlpha()
const = 0;
634 CV_WRAP
virtual void setVariationalRefinementAlpha(
float val) = 0;
638 CV_WRAP
virtual float getVariationalRefinementDelta()
const = 0;
640 CV_WRAP
virtual void setVariationalRefinementDelta(
float val) = 0;
644 CV_WRAP
virtual float getVariationalRefinementGamma()
const = 0;
646 CV_WRAP
virtual void setVariationalRefinementGamma(
float val) = 0;
654 CV_WRAP
virtual bool getUseMeanNormalization()
const = 0;
656 CV_WRAP
virtual void setUseMeanNormalization(
bool val) = 0;
663 CV_WRAP
virtual bool getUseSpatialPropagation()
const = 0;
665 CV_WRAP
virtual void setUseSpatialPropagation(
bool val) = 0;
685 CV_WRAP
virtual Size getWinSize()
const = 0;
686 CV_WRAP
virtual void setWinSize(
Size winSize) = 0;
688 CV_WRAP
virtual int getMaxLevel()
const = 0;
689 CV_WRAP
virtual void setMaxLevel(
int maxLevel) = 0;
691 CV_WRAP
virtual TermCriteria getTermCriteria()
const = 0;
692 CV_WRAP
virtual void setTermCriteria(
TermCriteria& crit) = 0;
694 CV_WRAP
virtual int getFlags()
const = 0;
695 CV_WRAP
virtual void setFlags(
int flags) = 0;
697 CV_WRAP
virtual double getMinEigThreshold()
const = 0;
698 CV_WRAP
virtual void setMinEigThreshold(
double minEigThreshold) = 0;
705 double minEigThreshold = 1e-4);
725 void init(InputArray image,
const Rect& boundingBox) = 0;
761 CV_PROP_RW
float samplerInitInRadius;
762 CV_PROP_RW
int samplerInitMaxNegNum;
763 CV_PROP_RW
float samplerSearchWinSize;
764 CV_PROP_RW
float samplerTrackInRadius;
765 CV_PROP_RW
int samplerTrackMaxPosNum;
766 CV_PROP_RW
int samplerTrackMaxNegNum;
767 CV_PROP_RW
int featureSetNumFeatures;
807 CV_PROP_RW std::string modelTxt;
808 CV_PROP_RW std::string modelBin;
831 CV_PROP_RW std::string model;
832 CV_PROP_RW std::string kernel_cls1;
833 CV_PROP_RW std::string kernel_r1;
834 CV_PROP_RW
int backend;
835 CV_PROP_RW
int target;
846 CV_WRAP
virtual float getTrackingScore() = 0;
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
DIS optical flow algorithm.
Definition: video/tracking.hpp:585
Definition: video/tracking.hpp:437
Class computing a dense optical flow using the Gunnar Farneback's algorithm.
Definition: video/tracking.hpp:476
Kalman filter class.
Definition: video/tracking.hpp:361
void init(int dynamParams, int measureParams, int controlParams=0, int type=CV_32F)
Re-initializes Kalman filter. The previous content is destroyed.
n-dimensional dense array class
Definition: mat.hpp:802
Template class for 2D rectangles
Definition: core/types.hpp:421
The class represents rotated (i.e. not up-right) rectangles on a plane.
Definition: core/types.hpp:504
Template class for specifying the size of an image or rectangle.
Definition: core/types.hpp:316
Base interface for sparse optical flow algorithms.
Definition: video/tracking.hpp:454
Class used for calculating a sparse optical flow.
Definition: video/tracking.hpp:683
The class defining termination criteria for iterative algorithms.
Definition: core/types.hpp:853
@ EPS
the desired accuracy or change in parameters at which the iterative algorithm stops
Definition: core/types.hpp:862
@ COUNT
the maximum number of iterations or elements to compute
Definition: core/types.hpp:860
Definition: video/tracking.hpp:822
static CV_WRAP Ptr< TrackerDaSiamRPN > create(const TrackerDaSiamRPN::Params ¶meters=TrackerDaSiamRPN::Params())
Constructor
the GOTURN (Generic Object Tracking Using Regression Networks) tracker
Definition: video/tracking.hpp:798
static CV_WRAP Ptr< TrackerGOTURN > create(const TrackerGOTURN::Params ¶meters=TrackerGOTURN::Params())
Constructor
Base abstract class for the long-term tracker
Definition: video/tracking.hpp:714
virtual CV_WRAP bool update(InputArray image, CV_OUT Rect &boundingBox)=0
Update the tracker, find the new most likely bounding box for the target
virtual CV_WRAP void init(InputArray image, const Rect &boundingBox)=0
Initialize the tracker with a known bounding box that surrounded the target
The MIL algorithm trains a classifier in an online manner to separate the object from the background.
Definition: video/tracking.hpp:751
static CV_WRAP Ptr< TrackerMIL > create(const TrackerMIL::Params ¶meters=TrackerMIL::Params())
Create MIL tracker instance
Variational optical flow refinement
Definition: video/tracking.hpp:524
@ BORDER_REFLECT_101
gfedcb|abcdefgh|gfedcba
Definition: base.hpp:273
@ BORDER_CONSTANT
iiiiii|abcdefgh|iiiiiii with some specified i
Definition: base.hpp:269
CV_EXPORTS_W RotatedRect CamShift(InputArray probImage, CV_IN_OUT Rect &window, TermCriteria criteria)
Finds an object center, size, and orientation.
CV_EXPORTS_W void calcOpticalFlowFarneback(InputArray prev, InputArray next, InputOutputArray flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags)
Computes a dense optical flow using the Gunnar Farneback's algorithm.
CV_EXPORTS_W int meanShift(InputArray probImage, CV_IN_OUT Rect &window, TermCriteria criteria)
Finds an object on a back projection image.
CV_EXPORTS_W int buildOpticalFlowPyramid(InputArray img, OutputArrayOfArrays pyramid, Size winSize, int maxLevel, bool withDerivatives=true, int pyrBorder=BORDER_REFLECT_101, int derivBorder=BORDER_CONSTANT, bool tryReuseInputImage=true)
Constructs the image pyramid which can be passed to calcOpticalFlowPyrLK.
CV_EXPORTS_W double findTransformECC(InputArray templateImage, InputArray inputImage, InputOutputArray warpMatrix, int motionType, TermCriteria criteria, InputArray inputMask, int gaussFiltSize)
Finds the geometric transform (warp) between two images in terms of the ECC criterion .
CV_EXPORTS_W double computeECC(InputArray templateImage, InputArray inputImage, InputArray inputMask=noArray())
Computes the Enhanced Correlation Coefficient value between two images .
CV_EXPORTS_W Mat readOpticalFlow(const String &path)
Read a .flo file
CV_EXPORTS_W void calcOpticalFlowPyrLK(InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray err, Size winSize=Size(21, 21), int maxLevel=3, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags=0, double minEigThreshold=1e-4)
Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyra...
CV_EXPORTS_W bool writeOpticalFlow(const String &path, InputArray flow)
Write a .flo to disk
CV_DEPRECATED CV_EXPORTS Mat estimateRigidTransform(InputArray src, InputArray dst, bool fullAffine)
Computes an optimal affine transformation between two 2D point sets.
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74
Definition: video/tracking.hpp:829
Definition: video/tracking.hpp:805
Definition: video/tracking.hpp:758