Visual Servoing Platform  version 3.3.0 under development (2020-02-17)
vpTemplateTrackerWarpHomography Class Reference

#include <visp3/tt/vpTemplateTrackerWarpHomography.h>

+ Inheritance diagram for vpTemplateTrackerWarpHomography:

Public Member Functions

 vpTemplateTrackerWarpHomography ()
 
void computeDenom (vpColVector &vX, const vpColVector &ParamM)
 
void dWarp (const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, vpMatrix &dW)
 
void dWarpCompo (const vpColVector &X1, const vpColVector &X2, const vpColVector &ParamM, const double *dwdp0, vpMatrix &dW)
 
void getdW0 (const int &i, const int &j, const double &dy, const double &dx, double *dIdW)
 
void getdWdp0 (const int &i, const int &j, double *dIdW)
 
vpHomography getHomography (const vpColVector &ParamM) const
 
void getParam (const vpHomography &H, vpColVector &par) const
 
void getParamInverse (const vpColVector &ParamM, vpColVector &ParamMinv) const
 
void getParamPyramidDown (const vpColVector &p, vpColVector &pdown)
 
void getParamPyramidUp (const vpColVector &p, vpColVector &pup)
 
bool isESMcompatible () const
 
void pRondp (const vpColVector &p1, const vpColVector &p2, vpColVector &pres) const
 
void warpX (const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)
 
void warpX (const int &i, const int &j, double &i2, double &j2, const vpColVector &ParamM)
 
void warpXInv (const vpColVector &vX, vpColVector &vXres, const vpColVector &ParamM)
 
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
 
vpMatrix dW
 
unsigned int nbParam
 

Detailed Description

Constructor & Destructor Documentation

◆ vpTemplateTrackerWarpHomography()

vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography ( )

Member Function Documentation

◆ computeDenom()

void vpTemplateTrackerWarpHomography::computeDenom ( vpColVector vX,
const vpColVector ParamM 
)

Compute the projection denominator (Z) used in x = X/Z and y = Y/Z.

Parameters
vX: Point to consider
ParamM: parameters of the warping function.

Definition at line 105 of file vpTemplateTrackerWarpHomography.cpp.

References vpTemplateTrackerWarp::denom, and vpTrackingException::fatalError.

◆ dWarp()

void vpTemplateTrackerWarpHomography::dWarp ( const vpColVector X1,
const vpColVector X2,
const vpColVector ParamM,
vpMatrix dW 
)
virtual

Compute the 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.
dW: Resulting derivative matrix.

Implements vpTemplateTrackerWarp.

Definition at line 130 of file vpTemplateTrackerWarpHomography.cpp.

References vpTemplateTrackerWarp::denom.

◆ dWarpCompo()

void vpTemplateTrackerWarpHomography::dWarpCompo ( const vpColVector X1,
const vpColVector X2,
const vpColVector ParamM,
const double *  dwdp0,
vpMatrix dW 
)
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.

Implements vpTemplateTrackerWarp.

Definition at line 150 of file vpTemplateTrackerWarpHomography.cpp.

References vpTemplateTrackerWarp::denom, and vpTemplateTrackerWarp::nbParam.

◆ getDistanceBetweenZoneAndWarpedZone()

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

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

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

◆ getdW0()

void vpTemplateTrackerWarpHomography::getdW0 ( const int &  i,
const int &  j,
const double &  dy,
const double &  dx,
double *  dIdW 
)
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).

Implements vpTemplateTrackerWarp.

Definition at line 69 of file vpTemplateTrackerWarpHomography.cpp.

◆ getdWdp0()

void vpTemplateTrackerWarpHomography::getdWdp0 ( const int &  i,
const int &  j,
double *  dIdW 
)
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).

Implements vpTemplateTrackerWarp.

Definition at line 84 of file vpTemplateTrackerWarpHomography.cpp.

◆ getHomography()

vpHomography vpTemplateTrackerWarpHomography::getHomography ( const vpColVector ParamM) const

Return the homography defined by the given parameters

Parameters
ParamM: Parameters of the homography.
Returns
An Homography via vpHomography.
Examples:
tutorial-template-tracker.cpp.

Definition at line 186 of file vpTemplateTrackerWarpHomography.cpp.

Referenced by getParamInverse(), and pRondp().

◆ getNbParam()

unsigned int vpTemplateTrackerWarp::getNbParam ( ) const
inlineinherited

Get the number of parameters of the warping function.

Returns
Number of parameters.

Definition at line 141 of file vpTemplateTrackerWarp.h.

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

◆ getParam()

void vpTemplateTrackerWarpHomography::getParam ( const vpHomography H,
vpColVector par 
) const

Compute the parameters of the homography warping function according to the given vpHomography

Parameters
H: Homography used to compute the parameters.
par: Resulting warping function parameters.

Definition at line 201 of file vpTemplateTrackerWarpHomography.cpp.

Referenced by getParamInverse(), and pRondp().

◆ getParamInverse()

void vpTemplateTrackerWarpHomography::getParamInverse ( const vpColVector ParamM,
vpColVector ParamMinv 
) const
virtual

Get the inverse of the warping function parameters.

Parameters
ParamM: Parameters of the warping function.
ParamMinv: Inverse parameters.

Implements vpTemplateTrackerWarp.

Definition at line 179 of file vpTemplateTrackerWarpHomography.cpp.

References getHomography(), getParam(), and vpHomography::inverse().

◆ getParamPyramidDown()

void vpTemplateTrackerWarpHomography::getParamPyramidDown ( const vpColVector p,
vpColVector pdown 
)
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.

Implements vpTemplateTrackerWarp.

Definition at line 50 of file vpTemplateTrackerWarpHomography.cpp.

◆ getParamPyramidUp()

void vpTemplateTrackerWarpHomography::getParamPyramidUp ( const vpColVector p,
vpColVector pup 
)
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.

Implements vpTemplateTrackerWarp.

Definition at line 59 of file vpTemplateTrackerWarpHomography.cpp.

◆ isESMcompatible()

bool vpTemplateTrackerWarpHomography::isESMcompatible ( ) const
inlinevirtual

Tells if the warping function is ESM compatible.

Returns
True if it is ESM compatible, False otherwise.

Implements vpTemplateTrackerWarp.

Definition at line 170 of file vpTemplateTrackerWarpHomography.h.

References vpTemplateTrackerWarp::pRondp(), vpTemplateTrackerWarp::warpX(), and vpTemplateTrackerWarp::warpXInv().

◆ pRondp()

void vpTemplateTrackerWarpHomography::pRondp ( const vpColVector p1,
const vpColVector p2,
vpColVector pres 
) const
virtual

Get the displacement resulting from the composition of two other displacements.

Parameters
p1: First displacement.
p2: Second displacement.
pres: Displacement resulting from the composition of p1 and p2.

Implements vpTemplateTrackerWarp.

Definition at line 214 of file vpTemplateTrackerWarpHomography.cpp.

References getHomography(), and getParam().

◆ setNbParam()

void vpTemplateTrackerWarp::setNbParam ( unsigned int  nb)
inlineinherited

Set the number of parameters of the warping function.

Parameters
nb: New number of parameters.

Definition at line 189 of file vpTemplateTrackerWarp.h.

References vpArray2D< Type >::resize().

◆ warp()

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

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

References vpMatrix::AtA(), vpMatrix::computeHLM(), vpTemplateTrackerWarp::dWarp(), vpMatrix::inverseByLU(), vpTemplateTrackerWarp::nbParam, vpMatrix::t(), and vpTemplateTrackerWarp::warpX().

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

◆ warpTriangle()

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

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

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

Referenced by vpTemplateTrackerWarp::warpZone().

◆ warpX() [1/2]

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

Warp a point.

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

Implements vpTemplateTrackerWarp.

Definition at line 124 of file vpTemplateTrackerWarpHomography.cpp.

References vpTemplateTrackerWarp::denom.

◆ warpX() [2/2]

void vpTemplateTrackerWarpHomography::warpX ( const int &  i,
const int &  j,
double &  i2,
double &  j2,
const vpColVector ParamM 
)
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 warping function.

Implements vpTemplateTrackerWarp.

Definition at line 117 of file vpTemplateTrackerWarpHomography.cpp.

References vpTemplateTrackerWarp::denom.

◆ warpXInv()

void vpTemplateTrackerWarpHomography::warpXInv ( const vpColVector vX,
vpColVector vXres,
const vpColVector ParamM 
)
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.

Implements vpTemplateTrackerWarp.

Definition at line 166 of file vpTemplateTrackerWarpHomography.cpp.

References vpTrackingException::fatalError.

◆ warpZone()

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

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

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

Referenced by vpTemplateTracker::display().

Member Data Documentation

◆ denom

◆ dW

◆ nbParam