MTF
Public Member Functions | List of all members
MCSPSS Class Reference
Inheritance diagram for MCSPSS:
SPSS AppearanceModel ImageBase

Public Member Functions

 MCSPSS (const ParamType *spss_params=nullptr)
 
- Public Member Functions inherited from SPSS
 SPSS (const ParamType *spss_params=nullptr, const int _n_channels=1)
 
double getLikelihood () const override
 returns a normalized version of the similarity that lies between 0 and 1 and can be interpreted as the likelihood that the current patch represents the same object as the initial patch
 
void initializePixVals (const Matrix2Xd &init_pts) override
 initialization methods - to be called once when the tracker is initialized
 
void initializeSimilarity () override
 methods to initialize the state variables - to be called once when the tracker is initialized. More...
 
void initializeGrad () override
 
void initializeHess () override
 even though the Hessian of the error norm w.r.t. More...
 
void updatePixVals (const Matrix2Xd &curr_pts) override
 
void updateSimilarity (bool prereq_only=true) override
 functions for updating state variables when a new image arrives More...
 
void updateInitGrad () override
 
void updateCurrGrad () override
 
void cmptInitHessian (MatrixXd &d2f_dp2, const MatrixXd &dI0_dp) override
 compute the S x S Hessian of the error norm using the supplied N x S Jacobian of pixel values w.r.t. More...
 
void cmptInitHessian (MatrixXd &d2f_dp2, const MatrixXd &dI0_dp, const MatrixXd &d2I0_dp2) override
 compute the exact Hessian by considering the second order terms too
 
void cmptCurrHessian (MatrixXd &d2f_dp2, const MatrixXd &dIt_dp) override
 
void cmptCurrHessian (MatrixXd &d2f_dp2, const MatrixXd &dIt_dp, const MatrixXd &d2It_dp2) override
 
void cmptSelfHessian (MatrixXd &d2f_dp2, const MatrixXd &dIt_dp) override
 
void cmptSelfHessian (MatrixXd &d2f_dp2, const MatrixXd &dIt_dp, const MatrixXd &d2It_dp2) override
 
const DistTypegetDistFunc () override
 
unsigned int getDistFeatSize () override
 returns the size of the distance vector
 
void initializeDistFeat () override
 to be called once during initialization if any of the distance feature functionality is to be used
 
void updateDistFeat (double *feat_addr) override
 overloaded version to write the distance feature directly to a row (or column) of a matrix storing the distance features corresponding to several patches;
 
const double * getDistFeat () override
 
void updateDistFeat () override
 computes a "distance" vector using the current image patch such that, when the distance vectors corresponding to two patches are passed to the distance operator above, it uses these to compute a scalar that measures the distance or dissimilarity between the two patches; this distance vector should be designed so as to offload as much computation as possible from the distance operator, i.e. More...
 
- Public Member Functions inherited from AppearanceModel
 AppearanceModel (const AMParams *params=nullptr, const int _n_channels=1)
 default and value constructor
 
virtual ~AppearanceModel ()
 destructor
 
virtual int getStateSize () const
 accessor methods
 
virtual double getSimilarity () const
 
virtual const VectorXd & getState ()
 
virtual const RowVectorXd & getInitGrad () const
 
virtual const RowVectorXd & getCurrGrad () const
 
virtual void setSimilarity (double _similarity)
 modifier methods
 
virtual void setInitGrad (const RowVectorXd &df_dI)
 
virtual void setCurrGrad (const RowVectorXd &df_dI)
 
virtual void reinitialize ()
 
virtual void updateState (const VectorXd &state_update)
 
virtual void invertState (VectorXd &inv_p, const VectorXd &p)
 
virtual void updateParamGrad ()
 
virtual void cmptInitJacobian (RowVectorXd &df_dp, const MatrixXd &dI0_dpssm)
 –— interfacing functions that take pixel jacobians/Hessians w.r.t. More...
 
virtual void cmptCurrJacobian (RowVectorXd &df_dp, const MatrixXd &dIt_dpssm)
 
virtual void cmptDifferenceOfJacobians (RowVectorXd &df_dp_diff, const MatrixXd &dI0_dpssm, const MatrixXd &dIt_dpssm)
 multiplies the gradients of the current error norm w.r.t. More...
 
virtual void cmptSumOfHessians (MatrixXd &d2f_dp2_sum, const MatrixXd &dI0_dpssm, const MatrixXd &dIt_dpssm)
 analogous to cmptDifferenceOfJacobians except for computing the mean of the current and initial Hessians
 
virtual void cmptSumOfHessians (MatrixXd &d2f_dp2_sum, const MatrixXd &dI0_dpssm, const MatrixXd &dIt_dpssm, const MatrixXd &d2I0_dpssm2, const MatrixXd &d2It_dpssm2)
 
virtual void estimateOpticalFlow (std::vector< cv::Point2f > &curr_pts, const cv::Mat &prev_img, const std::vector< cv::Point2f > &prev_pts, const cv::Size &win_size, unsigned int n_pts, int max_iters, double term_eps, bool const_grad=true) const
 
virtual void setSPIMask (const bool *_spi_mask)
 
virtual const bool * getSPIMask () const
 
virtual void clearSPIMask ()
 
virtual bool supportsSPI () const
 should be overridden by an implementing class once it implements SPI functionality for all functions where it makes logical sense
 
virtual void setFirstIter ()
 should be called before performing the first iteration on a new image to indicate that the image has changed since the last time the update funcvtions were called
 
virtual void clearFirstIter ()
 should be called after the first iteration on a new frame is done
 
ImgStatusisInitialized () override
 
virtual void setInitStatus ()
 
virtual void clearInitStatus ()
 
virtual bool isSymmetrical () const
 return false if the similarity function f is not symmetrical, i.e. More...
 
virtual void updateModel (const PtsT &curr_pts)
 optional function to incorporate online learning or adaptation of the model used to represent the appearance of the object being tracked this should be called with the final location of the object (obtained by the search process) in each frame
 
virtual void initializeSampler (const VectorXd &state_sigma, const VectorXd &state_mean)
 
virtual void setSampler (const VectorXd &state_sigma, const VectorXd &state_mean)
 
virtual void setSamplerMean (const VectorXd &mean)
 
virtual void setSamplerSigma (const VectorXd &std)
 
virtual void getSamplerMean (VectorXd &mean)
 
virtual void getSamplerSigma (VectorXd &std)
 
virtual void generatePerturbation (VectorXd &perturbation)
 
- Public Member Functions inherited from ImageBase
 ImageBase (const ImgParams *img_params=nullptr, const int _n_channels=1)
 
virtual int inputType () const
 return the type of OpenCV Mat image the AM requires as input; typically either CV_32FC3 or CV_32FC1
 
virtual const cv::Mat & getCurrImg () const
 accessor methods; these are not defined as 'const' since an appearance model may like to make some last moment changes to the variable being accessed before returning it to can avoid any unnecessary computations concerning the variable (e.g. More...
 
virtual unsigned int getImgHeight () const
 
virtual unsigned int getImgWidth () const
 
virtual unsigned int getResX () const
 
virtual unsigned int getResY () const
 
virtual unsigned int getNPix () const
 
virtual unsigned int getNChannels () const
 
virtual unsigned int getPatchSize () const
 
virtual double getGradOffset () const
 
virtual double getHessOffset () const
 
virtual const PixValT & getInitPixVals () const
 
virtual const PixGradT & getInitPixGrad () const
 
virtual const PixHessT & getInitPixHess () const
 
virtual const PixValT & getCurrPixVals () const
 
virtual const PixGradT & getCurrPixGrad () const
 
virtual const PixHessT & getCurrPixHess () const
 
virtual void setCurrImg (const cv::Mat &cv_img)
 modifier methods;
 
virtual void setInitPixVals (const PixValT &pix_vals)
 
virtual void setInitPixGrad (const PixGradT &pix_grad)
 
virtual void setInitPixHess (const PixHessT &pix_hess)
 
virtual void setCurrPixVals (const PixValT &pix_vals)
 
virtual void setCurrPixGrad (const PixGradT &pix_grad)
 
virtual void setCurrPixHess (const PixHessT &pix_hess)
 
virtual void initializePixGrad (const GradPtsT &warped_offset_pts)
 functions to compute image differentials (gradient and hessian) are overloaded since there are two ways to define them: More...
 
virtual void initializePixGrad (const PtsT &init_pts)
 
virtual void initializePixHess (const PtsT &init_pts, const HessPtsT &warped_offset_pts)
 
virtual void initializePixHess (const PtsT &init_pts)
 
virtual void updatePixGrad (const GradPtsT &warped_offset_pts)
 
virtual void updatePixGrad (const PtsT &curr_pts)
 
virtual void updatePixHess (const PtsT &curr_pts)
 
virtual void updatePixHess (const PtsT &curr_pts, const HessPtsT &warped_offset_pts)
 
virtual void extractPatch (VectorXd &pix_vals, const PtsT &curr_pts)
 general utility function to extract raw pixel values from the current image at the specified points; might be useful for visualization purposes as the curr_pix_vals might not have raw pixel values;
 
virtual VectorXd getPatch (const PtsT &curr_pts)
 returning variant
 

Additional Inherited Members

- Public Types inherited from SPSS
typedef SPSSParams ParamType
 
typedef SPSSDist DistType
 
- Public Types inherited from ImageBase
enum  InputType { MTF_32FC1 = CV_32FC1, MTF_32FC3 = CV_32FC3, MTF_8UC1 = CV_8UC1, MTF_8UC3 = CV_8UC3 }
 supported input image types
 
typedef EigImgT ImageT
 convenience type if floating point grayscale image is used as input by the AM
 
- Public Attributes inherited from AppearanceModel
string name
 name of the appearance model
 
- Protected Attributes inherited from SPSS
ParamType params
 
double c
 
VectorXd f_vec
 
VectorXd f_vec_den
 
VectorXd I0_sqr
 
VectorXd It_sqr
 
- Protected Attributes inherited from AppearanceModel
double f
 f(I_0, I_t, p_am): R(N) x R(N) x R(K) -> R measures the similarity between the current (I_t) and initial (I_0) patches using the photometric parameters (p_am) this is the quantity to be maximized by the optimization process
 
RowVectorXd df_dI0
 1 x N gradients of the similarity w.r.t. More...
 
RowVectorXd df_dIt
 
VectorXd p_am
 parameters of the photomtric model
 
int state_size
 size of p_am, i.e. More...
 
RowVectorXd df_dpam
 1 x K Jacobian of the similarity function w.r.t. More...
 
MatrixXd d2f_dpam2
 K x K Hessian of the similarity w.r.t. More...
 
RowVectorXd df_dg0
 1 x N gradient of the similarity w.r.t. More...
 
RowVectorXd df_dgt
 
MatrixXd d2f_dpam_dIt
 K x N cross Hessian of the similarity w.r.t. More...
 
MatrixXd d2f_dI02
 these NxN Hessians of the similarity wrt pixel values are usually not stored or computed explicitly because: More...
 
MatrixXd d2f_dIt2
 
bool first_iter
 indicator variable that can be set by iterative search methods to indicate if the initial or first iteration is being run on the current image; can be used to perform some costly operations/updates only once per frame rather than at every iteration
 
const bool * spi_mask
 pixels corresponding to false entries in the mask will be ignored in all respective computations where pixel values are used; it is up to the AM to do this in a way that makes sense; since none of the state variables are actually being resized they will still have entries corresponding to these ignored pixels but the AM s at liberty to put anything there assuming that the SM will not use these entries in its own computations; this is why all of these have default implementations that simply ignore the mask; these can be used by the AM when the non masked entries of the computed variable do not depend on the masked pixels;
 
AMStatus is_initialized
 indicator variables used to keep track of which state variables have been initialized;
 
- Protected Attributes inherited from ImageBase
const unsigned int resx
 horizontal and vertical sampling resolutions for the object patch
 
const unsigned int resy
 
const unsigned int n_pix
 no. of pixels in the sampled image patch to be tracked
 
const unsigned int n_channels
 no. More...
 
const unsigned int patch_size
 size of the vector that represents the object patch in the image, typically n_pix*n_channels
 
const double grad_eps
 offsets to use for computing the numerical image gradient and hessian
 
const double hess_eps
 
const InputType input_type
 
EigImgT curr_img
 Eigen structure shaing memory with the OpenCV image used by default with grayscale inputs.
 
cv::Mat curr_img_cv
 OpenCV image used by default with multi channel inputs.
 
unsigned int img_height
 height and width of the input images
 
unsigned int img_width
 
PixValT I0
 let N = n_pix = no. More...
 
PixValT It
 
PixGradT dI0_dx
 (N*C) x 2 jacobian of pixel values in the warped image w.r.t. More...
 
PixGradT dIt_dx
 
PixHessT d2I0_dx2
 4 x (N*C) Hessian of pixel values in the warped image w.r.t. More...
 
PixHessT d2It_dx2
 
double pix_norm_add
 additive and multiplicative factors for normalizing pixel values
 
double pix_norm_mult
 
unsigned int frame_count
 incremented once during initialization and thereafter everytime the template is updated
 

The documentation for this class was generated from the following file: