Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpTemplateTrackerWarp Class Referenceabstract

#include <visp3/tt/vpTemplateTrackerWarp.h>

+ Inheritance diagram for vpTemplateTrackerWarp:

Public Member Functions

 vpTemplateTrackerWarp ()
 
virtual ~vpTemplateTrackerWarp ()
 
virtual void dWarp (const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, vpMatrix &dW)=0
 
virtual void dWarpCompo (const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, const double *dwdp0, vpMatrix &dW)=0
 
virtual void getdW0 (const int &i, const int &j, const double &dy, const double &dx, double *dIdW)=0
 
virtual void getdWdp0 (const int &i, const int &j, double *dIdW)=0
 
double getDistanceBetweenZoneAndWarpedZone (const vpTemplateTrackerZone &Z, const vpColVector &p)
 
unsigned int getNbParam () const
 
virtual void getParamInverse (const vpColVector &ParamM, vpColVector &ParamMinv) const =0
 
virtual void getParamPyramidDown (const vpColVector &p, vpColVector &pdown)=0
 
virtual void getParamPyramidUp (const vpColVector &p, vpColVector &pup)=0
 
virtual bool isESMcompatible () const =0
 
virtual void pRondp (const vpColVector &p1, const vpColVector &p2, vpColVector &pres) const =0
 
void setNbParam (unsigned int nb)
 
void warp (const double *ut0, const double *vt0, int nb_pt, const vpColVector &p, double *u, double *v)
 
virtual void warpX (const int &i, const int &j, double &i2, double &j2, const vpColVector &ParamM)=0
 
virtual void warpX (const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)=0
 
virtual void warpXInv (const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)=0
 
void warpTriangle (const vpTemplateTrackerTriangle &in, const vpColVector &p, vpTemplateTrackerTriangle &out)
 
void warpZone (const vpTemplateTrackerZone &in, const vpColVector &p, vpTemplateTrackerZone &out)
 

Protected Attributes

double denom
 
vpMatrix dW
 
unsigned int nbParam
 

Detailed Description

Examples:
templateTracker.cpp.

Definition at line 58 of file vpTemplateTrackerWarp.h.

Constructor & Destructor Documentation

vpTemplateTrackerWarp::vpTemplateTrackerWarp ( )
inline

Definition at line 67 of file vpTemplateTrackerWarp.h.

virtual vpTemplateTrackerWarp::~vpTemplateTrackerWarp ( )
inlinevirtual

Definition at line 68 of file vpTemplateTrackerWarp.h.

Member Function Documentation

virtual void vpTemplateTrackerWarp::dWarp ( const vpColVector X1,
const vpColVector X2,
const vpColVector ParamM,
vpMatrix dW 
)
pure virtual
virtual void vpTemplateTrackerWarp::dWarpCompo ( const vpColVector X1,
const vpColVector X2,
const vpColVector ParamM,
const double *  dwdp0,
vpMatrix dW 
)
pure virtual

Compute the compositionnal derivative of the warping function according to its parameters.

Parameters
X1: Point to consider in the derivative computation.
X2: Point to consider in the derivative computation.
ParamM: Parameters of the warping function.
dwdp0: Derivative matrix of the warping function according to the initial warping function parameters (p=0).
dW: Resulting compositionnal derivative matrix.

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

Referenced by vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), and vpTemplateTrackerMIESM::trackNoPyr().

double vpTemplateTrackerWarp::getDistanceBetweenZoneAndWarpedZone ( const vpTemplateTrackerZone Z,
const vpColVector p 
)

Compute the distance between a zone and its associated warped zone.

Parameters
Z: Zone to consider.
p: Parameters of the warping function.

Definition at line 70 of file vpTemplateTrackerWarp.cpp.

References vpTemplateTrackerTriangle::getCorner(), vpTemplateTrackerZone::getNbTriangle(), vpTemplateTrackerZone::getTriangle(), and warpX().

virtual void vpTemplateTrackerWarp::getdW0 ( const int &  i,
const int &  j,
const double &  dy,
const double &  dx,
double *  dIdW 
)
pure virtual

Compute the derivative of the image with relation to the warping function parameters.

Parameters
i: i coordinate (along the rows) of the point to consider in the image.
j: j coordinate (along the columns) of the point to consider in the image.
dy: Derivative on the y-axis (along the rows) of the point (i,j).
dx: Derivative on the x-axis (along the columns) of the point (i,j).
dIdW: Resulting derivative matrix (Image according to the warping function).

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

Referenced by vpTemplateTrackerSSDESM::initCompInverse(), vpTemplateTrackerZNCCInverseCompositional::initCompInverse(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerMIESM::initCompInverse(), and vpTemplateTrackerMIInverseCompositional::initCompInverse().

virtual void vpTemplateTrackerWarp::getdWdp0 ( const int &  i,
const int &  j,
double *  dIdW 
)
pure virtual

Compute the derivative of the warping function according to the initial parameters.

Parameters
i: i coordinate (along the rows) of the point to consider in the image.
j: j coordinate (along the columns) of the point to consider in the image.
dIdW: Resulting derivative matrix (Image according to the warping function).

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

Referenced by vpTemplateTrackerSSDESM::initCompInverse(), vpTemplateTrackerMIESM::initCompInverse(), vpTemplateTrackerSSDForwardCompositional::initCompo(), and vpTemplateTrackerMIForwardCompositional::initCompo().

unsigned int vpTemplateTrackerWarp::getNbParam ( ) const
inline

Get the number of parameters of the warping function.

Returns
Number of parameters.

Definition at line 133 of file vpTemplateTrackerWarp.h.

Referenced by vpTemplateTracker::computeOptimalBrentGain(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), and vpTemplateTracker::vpTemplateTracker().

virtual void vpTemplateTrackerWarp::getParamInverse ( const vpColVector ParamM,
vpColVector ParamMinv 
) const
pure virtual
virtual void vpTemplateTrackerWarp::getParamPyramidDown ( const vpColVector p,
vpColVector pdown 
)
pure virtual

Get the parameters of the warping function one level down.

Parameters
p: Current parameters of the warping function.
pdown: Resulting parameters on level down.

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

Referenced by vpTemplateTracker::trackPyr().

virtual void vpTemplateTrackerWarp::getParamPyramidUp ( const vpColVector p,
vpColVector pup 
)
pure virtual

Get the parameters of the warping function one level up.

Parameters
p: Current parameters of the warping function.
pup: Resulting parameters one level up.

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

Referenced by vpTemplateTracker::trackPyr().

virtual bool vpTemplateTrackerWarp::isESMcompatible ( ) const
pure virtual
virtual void vpTemplateTrackerWarp::pRondp ( const vpColVector p1,
const vpColVector p2,
vpColVector pres 
) const
pure virtual
void vpTemplateTrackerWarp::setNbParam ( unsigned int  nb)
inline

Set the number of parameters of the warping function.

Parameters
nb: New number of parameters.

Definition at line 180 of file vpTemplateTrackerWarp.h.

void vpTemplateTrackerWarp::warp ( const double *  ut0,
const double *  vt0,
int  nb_pt,
const vpColVector p,
double *  u,
double *  v 
)

Warp a list of points.

Parameters
ut0: List of u coordinates of the points.
vt0: List of v coordinates of the points.
nb_pt: Number of points to consider.
p: Parameters of the warp.
u: Resulting u coordinates.
v: resulting v coordinates.

Definition at line 93 of file vpTemplateTrackerWarp.cpp.

References warpX().

Referenced by vpTemplateTrackerWarpHomographySL3::getParamPyramidDown(), and vpTemplateTrackerWarpHomographySL3::getParamPyramidUp().

void vpTemplateTrackerWarp::warpTriangle ( const vpTemplateTrackerTriangle in,
const vpColVector p,
vpTemplateTrackerTriangle out 
)

Warp a triangle and store the result in a new zone.

Parameters
in: Triangle to warp.
p: Parameters of the warping function. These parameters are estimated by the template tracker and returned using vpTemplateTracker::getp().
out: Resulting triangle.

Definition at line 41 of file vpTemplateTrackerWarp.cpp.

References vpException::dimensionError, vpTemplateTrackerTriangle::getCorners(), vpTemplateTrackerTriangle::init(), vpArray2D< Type >::size(), vpCTRACE, and warpX().

Referenced by warpZone().

virtual void vpTemplateTrackerWarp::warpX ( const int &  i,
const int &  j,
double &  i2,
double &  j2,
const vpColVector ParamM 
)
pure virtual

Warp a point.

Parameters
i: i coordinate (along the rows) of the point to warp.
j: j coordinate (along the columns) of the point to warp.
i2: i coordinate (along the rows) of the warped point.
j2: j coordinate (along the columns) of the warped point.
ParamM: Parameters of the warp.

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

Referenced by vpTemplateTrackerSSDInverseCompositional::computeEvalRMS(), vpTemplateTrackerZNCCInverseCompositional::computeEvalRMS(), vpTemplateTrackerMIForwardAdditional::computeEvalRMS(), vpTemplateTrackerMIInverseCompositional::computeEvalRMS(), vpTemplateTrackerSSD::getCost(), vpTemplateTrackerZNCC::getCost(), vpTemplateTrackerMI::getCost(), getDistanceBetweenZoneAndWarpedZone(), vpTemplateTrackerMI::getMI(), vpTemplateTrackerMI::getMI256(), vpTemplateTrackerMI::getNormalizedCost(), vpTemplateTrackerSSD::getSSD(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIInverseCompositional::initHessienDesired(), vpTemplateTrackerSSDInverseCompositional::initPosEvalRMS(), vpTemplateTrackerZNCCInverseCompositional::initPosEvalRMS(), vpTemplateTrackerMIForwardAdditional::initPosEvalRMS(), vpTemplateTrackerMIInverseCompositional::initPosEvalRMS(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerZNCCInverseCompositional::trackNoPyr(), vpTemplateTrackerSSDInverseCompositional::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), warp(), and warpTriangle().

virtual void vpTemplateTrackerWarp::warpX ( const vpColVector vX,
vpColVector vXres,
const vpColVector ParamM 
)
pure virtual

Warp a point.

Parameters
vX: Coordinates of the point to warp.
vXres: Coordinates of the warped point.
ParamM: Parameters of the warping function.

Implemented in vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

virtual void vpTemplateTrackerWarp::warpXInv ( const vpColVector vX,
vpColVector vXres,
const vpColVector ParamM 
)
pure virtual

Inverse Warp a point.

Parameters
vX: Coordinates of the point to warp.
vXres: Coordinates of the warped point.
ParamM: Parameters of the warping function.

Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpSRT, and vpTemplateTrackerWarpTranslation.

void vpTemplateTrackerWarp::warpZone ( const vpTemplateTrackerZone in,
const vpColVector p,
vpTemplateTrackerZone out 
)

Warp a zone and store the result in a new zone.

Parameters
in: Zone to warp.
p: Parameters of the warping function. These parameters are estimated by the template tracker and returned using vpTemplateTracker::getp().
out: Resulting zone.
Examples:
templateTracker.cpp.

Definition at line 58 of file vpTemplateTrackerWarp.cpp.

References vpTemplateTrackerZone::add(), vpTemplateTrackerZone::clear(), vpTemplateTrackerZone::getNbTriangle(), vpTemplateTrackerZone::getTriangle(), and warpTriangle().

Referenced by vpTemplateTracker::display().

Member Data Documentation