Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpTemplateTrackerWarp Class Referenceabstract

#include <vpTemplateTrackerWarp.h>

Inheritance diagram for vpTemplateTrackerWarp:

Public Member Functions

 vpTemplateTrackerWarp ()
virtual ~vpTemplateTrackerWarp ()
virtual void dWarp (const vpColVector &X1, const vpColVector &X2, const vpColVector &p, vpMatrix &dM)=0
virtual void dWarpCompo (const vpColVector &X1, const vpColVector &X2, const vpColVector &p, const double *dwdp0, vpMatrix &dM)=0
virtual void getdW0 (const int &v, const int &u, const double &dv, const double &du, double *dIdW)=0
virtual void getdWdp0 (const int &v, const int &u, double *dIdW)=0
virtual void getParamInverse (const vpColVector &p, vpColVector &p_inv) const =0
virtual void getParamPyramidDown (const vpColVector &p, vpColVector &p_down)=0
virtual void getParamPyramidUp (const vpColVector &p, vpColVector &p_up)=0
virtual bool isESMcompatible () const =0
virtual void pRondp (const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const =0
virtual void warpX (const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p)=0
virtual void warpX (const vpColVector &X1, vpColVector &X2, const vpColVector &p)=0
virtual void warpXInv (const vpColVector &X1, vpColVector &X2, const vpColVector &p)=0
Inherited functionalities from vpTemplateTrackerWarp
double getDistanceBetweenZoneAndWarpedZone (const vpTemplateTrackerZone &Z, const vpColVector &p)
unsigned int getNbParam () const
void setNbParam (unsigned int nb)
void warp (const double *ut0, const double *vt0, int nb_pt, const vpColVector &p, double *u, double *v)
void warpTriangle (const vpTemplateTrackerTriangle &in, const vpColVector &p, vpTemplateTrackerTriangle &out)
void warpZone (const vpTemplateTrackerZone &in, const vpColVector &p, vpTemplateTrackerZone &out)

Protected Attributes

double denom
unsigned int nbParam

Detailed Description

Tutorials & Examples

Tutorials
If you are interested in the Template Tracker (TT), you may have a look at:

Examples
templateTracker.cpp.

Definition at line 64 of file vpTemplateTrackerWarp.h.

Constructor & Destructor Documentation

◆ vpTemplateTrackerWarp()

vpTemplateTrackerWarp::vpTemplateTrackerWarp ( )
inline

Default constructor.

Definition at line 74 of file vpTemplateTrackerWarp.h.

References denom, and nbParam.

◆ ~vpTemplateTrackerWarp()

virtual vpTemplateTrackerWarp::~vpTemplateTrackerWarp ( )
inlinevirtual

Destructor.

Definition at line 78 of file vpTemplateTrackerWarp.h.

Member Function Documentation

◆ dWarp()

virtual void vpTemplateTrackerWarp::dWarp ( const vpColVector & X1,
const vpColVector & X2,
const vpColVector & p,
vpMatrix & dM )
pure virtual

Compute the derivative matrix of the warping function at point $X=(u,v)$ according to the model parameters:

\‍[\frac{\partial M}{\partial p}(X_1, X_2, p)
\‍]

Parameters
X1: Vector corresponding to the coordinates $(u_1, v_1)$ of the point to consider in the derivative computation.
X2: Vector corresponding to the coordinates $(u_1, v_1)$ of the point to consider in the derivative computation.
p: Vector that contains the parameters of the warping function.
dM: Resulting warping model derivative returned as a matrix.

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

◆ dWarpCompo()

virtual void vpTemplateTrackerWarp::dWarpCompo ( const vpColVector & X1,
const vpColVector & X2,
const vpColVector & p,
const double * dwdp0,
vpMatrix & dM )
pure virtual

Compute the compositionnal derivative matrix of the warping function according to the model parameters.

Parameters
X1: Point to consider in the derivative computation.
X2: Point to consider in the derivative computation.
p: Vector that contains the parameters of the warping function.
dwdp0: Derivative matrix of the warping function according to the initial warping function parameters (p=0).
dM: Resulting warping model compositionnal derivative returned as a 2-by-3 matrix.

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

◆ getDistanceBetweenZoneAndWarpedZone()

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 69 of file vpTemplateTrackerWarp.cpp.

References vpTemplateTrackerTriangle::getCorner(), and warpX().

Referenced by warpXInv().

◆ getdW0()

virtual void vpTemplateTrackerWarp::getdW0 ( const int & v,
const int & u,
const double & dv,
const double & du,
double * dIdW )
pure virtual

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

Parameters
v: Coordinate (along the image rows axis) of the point to consider in the image.
u: Coordinate (along the image columns axis) of the point to consider in the image.
dv: Derivative on the v-axis (along the rows) of the point (u,v).
du: Derivative on the u-axis (along the columns) of the point (u,v).
dIdW: Resulting derivative matrix (image according to the warping function).

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

◆ getdWdp0()

virtual void vpTemplateTrackerWarp::getdWdp0 ( const int & v,
const int & u,
double * dIdW )
pure virtual

Compute the derivative of the warping model $M$ according to the initial parameters $p_0$ at point $X=(u,v)$:

\‍[\frac{\partial M}{\partial p}(X, p_0)
\‍]

Parameters
v: Coordinate (along the image rows axis) of the point X(u,v) to consider in the image.
u: Coordinate (along the image columns axis) of the point X(u,v) to consider in the image.
dIdW: Resulting 2-by-3 derivative matrix.

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

◆ getNbParam()

unsigned int vpTemplateTrackerWarp::getNbParam ( ) const
inline

Get the number of parameters of the warping function.

Returns
Number of parameters.

Definition at line 222 of file vpTemplateTrackerWarp.h.

References nbParam.

Referenced by vpTemplateTrackerWarpHomography::getParam(), and vpTemplateTrackerWarpHomography::getParam().

◆ getParamInverse()

virtual void vpTemplateTrackerWarp::getParamInverse ( const vpColVector & p,
vpColVector & p_inv ) const
pure virtual

Compute inverse of the RT warping transformation.

Parameters
p: Vector that contains the parameters corresponding to the transformation to inverse.
p_inv: Vector that contains the parameters of the inverse transformation $ {M(p)}^{-1}$.

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

◆ getParamPyramidDown()

virtual void vpTemplateTrackerWarp::getParamPyramidDown ( const vpColVector & p,
vpColVector & p_down )
pure virtual

Get the parameters of the warping function one level down where image size is divided by two along the lines and the columns.

Parameters
p: Vector that contains the current parameters of the warping function.
p_down: Vector that contains the resulting parameters one level down.

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

◆ getParamPyramidUp()

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

Get the parameters of the warping function one level up where image size is multiplied by two along the lines and the columns.

Parameters
p: Vector that contains the current parameters of the warping function.
p_up: Vector that contains the resulting parameters one level up.

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

◆ isESMcompatible()

virtual bool vpTemplateTrackerWarp::isESMcompatible ( ) const
pure virtual

Tells if the warping function is ESM compatible.

Returns
true if it is ESM compatible, false otherwise.

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

◆ pRondp()

virtual void vpTemplateTrackerWarp::pRondp ( const vpColVector & p1,
const vpColVector & p2,
vpColVector & p12 ) const
pure virtual

Compute the RT transformation resulting from the composition of two other RT transformations.

Parameters
p1: Vector that contains the parameters corresponding to first transformation.
p2: Vector that contains the parameters corresponding to second transformation.
p12: Vector that contains the resulting transformation $ p_{12} = p_1 \circ p_2$.

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

◆ setNbParam()

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 229 of file vpTemplateTrackerWarp.h.

References nbParam.

◆ warp()

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 91 of file vpTemplateTrackerWarp.cpp.

References warpX().

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

◆ warpTriangle()

BEGIN_VISP_NAMESPACE 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 38 of file vpTemplateTrackerWarp.cpp.

References vpException::dimensionError, vpTemplateTrackerTriangle::getCorners(), vpTemplateTrackerTriangle::init(), vpCTRACE, and warpX().

Referenced by warpZone().

◆ warpX() [1/2]

virtual void vpTemplateTrackerWarp::warpX ( const int & v1,
const int & u1,
double & v2,
double & u2,
const vpColVector & p )
pure virtual

Warp point $X_1=(u_1,v_1)$ using the transformation model with parameters $p$.

\‍[X_2 = {^2}M_1(p) * X_1\‍]

Parameters
v1: Coordinate (along the image rows axis) of the point $X_1=(u_1,v_1)$ to warp.
u1: Coordinate (along the image columns axis) of the point $X_1=(u_1,v_1)$ to warp.
v2: Coordinate of the warped point $X_2=(u_2,v_2)$ along the image rows axis.
u2: Coordinate of the warped point $X_2=(u_2,v_2)$ along the image column axis.
p: Vector that contains the parameters of the transformation.

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

Referenced by getDistanceBetweenZoneAndWarpedZone(), warp(), and warpTriangle().

◆ warpX() [2/2]

virtual void vpTemplateTrackerWarp::warpX ( const vpColVector & X1,
vpColVector & X2,
const vpColVector & p )
pure virtual

Warp point $X_1=(u_1,v_1)$ using the RT transformation model.

\‍[X_1 = M(p) * X_2\‍]

Parameters
X1: Vector corresponding to the coordinates $(u_1, v_1)$ of the point to warp.
X2: Vector corresponding to the coordinates $(u_2, v_2)$ of the warped point.
p: Vector that contains the parameters of the RT transformation.

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

◆ warpXInv()

virtual void vpTemplateTrackerWarp::warpXInv ( const vpColVector & X1,
vpColVector & X2,
const vpColVector & p )
pure virtual

Warp a point X1 with the inverse transformation $M$.

\‍[ X_2 = {\left( {^1}M_2 \right) }^{-1} \; X_1\‍]

Parameters
X1: Vector corresponding to the coordinates (u,v) of the point to warp.
X2: Vector corresponding to the coordinates (u,v) of the warped point.
p: Parameters corresponding to the warping RT model ${^1}M_2$.

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

References getDistanceBetweenZoneAndWarpedZone().

◆ warpZone()

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().

Member Data Documentation

◆ denom

◆ nbParam