Visual Servoing Platform
version 3.5.0 under development (2022-02-15)
|
#include <visp3/tt/vpTemplateTrackerWarp.h>
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 |
Definition at line 58 of file vpTemplateTrackerWarp.h.
|
inline |
Default constructor.
Definition at line 68 of file vpTemplateTrackerWarp.h.
|
inlinevirtual |
Destructor.
Definition at line 72 of file vpTemplateTrackerWarp.h.
|
pure virtual |
Compute the derivative matrix of the warping function at point according to the model parameters:
X1 | : Vector corresponding to the coordinates of the point to consider in the derivative computation. |
X2 | : Vector corresponding to the coordinates 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 vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpTranslation, and vpTemplateTrackerWarpHomographySL3.
Referenced by vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), and warp().
|
pure virtual |
Compute the compositionnal derivative matrix of the warping function according to the model 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 vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpTranslation, and vpTemplateTrackerWarpHomographySL3.
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.
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 warpX().
|
pure virtual |
Compute the derivative of the image with relation to the warping function 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 vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpTranslation, and vpTemplateTrackerWarpHomographySL3.
Referenced by vpTemplateTrackerZNCCInverseCompositional::initCompInverse(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerSSDESM::initCompInverse(), vpTemplateTrackerMIESM::initCompInverse(), and vpTemplateTrackerMIInverseCompositional::initCompInverse().
|
pure virtual |
Compute the derivative of the warping model according to the initial parameters at point :
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 vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, vpTemplateTrackerWarpTranslation, and vpTemplateTrackerWarpHomographySL3.
Referenced by vpTemplateTrackerSSDESM::initCompInverse(), vpTemplateTrackerMIESM::initCompInverse(), vpTemplateTrackerSSDForwardCompositional::initCompo(), and vpTemplateTrackerMIForwardCompositional::initCompo().
|
inline |
Get the number of parameters of the warping function.
Definition at line 217 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTracker::computeOptimalBrentGain(), vpTemplateTrackerWarpHomography::getParam(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), and vpTemplateTracker::vpTemplateTracker().
|
pure virtual |
Compute inverse of the RT warping transformation.
p | : Vector that contains the parameters corresponding to the transformation to inverse. |
p_inv | : Vector that contains the parameters of the inverse transformation . |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTracker::computeOptimalBrentGain(), vpTemplateTrackerSSDInverseCompositional::trackNoPyr(), vpTemplateTrackerZNCCInverseCompositional::trackNoPyr(), and vpTemplateTrackerMIInverseCompositional::trackNoPyr().
|
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.
p | : Vector that contains the current parameters of the warping function. |
p_down | : Vector that contains the resulting parameters one level down. |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTracker::trackPyr().
|
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.
p | : Vector that contains the current parameters of the warping function. |
p_up | : Vector that contains the resulting parameters one level up. |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTracker::trackPyr().
|
pure virtual |
Tells if the warping function is ESM compatible.
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTrackerMIESM::vpTemplateTrackerMIESM(), and vpTemplateTrackerSSDESM::vpTemplateTrackerSSDESM().
|
pure virtual |
Compute the RT transformation resulting from the composition of two other RT transformations.
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 . |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTracker::computeOptimalBrentGain(), vpTemplateTrackerWarpRT::isESMcompatible(), vpTemplateTrackerWarpTranslation::isESMcompatible(), vpTemplateTrackerWarpAffine::isESMcompatible(), vpTemplateTrackerWarpSRT::isESMcompatible(), vpTemplateTrackerWarpHomographySL3::isESMcompatible(), vpTemplateTrackerWarpHomography::isESMcompatible(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDInverseCompositional::trackNoPyr(), vpTemplateTrackerZNCCInverseCompositional::trackNoPyr(), and vpTemplateTrackerMIInverseCompositional::trackNoPyr().
|
inline |
Set the number of parameters of the warping function.
nb | : New number of parameters. |
Definition at line 224 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.
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(), dWarp(), vpMatrix::inverseByLU(), nbParam, vpMatrix::t(), and 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.
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 warpX().
Referenced by warpZone().
|
pure virtual |
Warp point using the transformation model with parameters .
v1 | : Coordinate (along the image rows axis) of the point to warp. |
u1 | : Coordinate (along the image columns axis) of the point to warp. |
v2 | : Coordinate of the warped point along the image rows axis. |
u2 | : Coordinate of the warped point along the image column axis. |
p | : Vector that contains the parameters of the transformation. |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTracker::computeEvalRMS(), vpTemplateTrackerSSD::getCost(), vpTemplateTrackerZNCC::getCost(), vpTemplateTrackerMI::getCost(), getDistanceBetweenZoneAndWarpedZone(), vpTemplateTrackerMI::getMI(), vpTemplateTrackerMI::getMI256(), vpTemplateTrackerMI::getNormalizedCost(), vpTemplateTrackerSSD::getSSD(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIInverseCompositional::initHessienDesired(), vpTemplateTracker::initPosEvalRMS(), vpTemplateTrackerWarpRT::isESMcompatible(), vpTemplateTrackerWarpTranslation::isESMcompatible(), vpTemplateTrackerWarpAffine::isESMcompatible(), vpTemplateTrackerWarpSRT::isESMcompatible(), vpTemplateTrackerWarpHomographySL3::isESMcompatible(), vpTemplateTrackerWarpHomography::isESMcompatible(), vpTemplateTrackerZNCCForwardAdditional::trackNoPyr(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDInverseCompositional::trackNoPyr(), vpTemplateTrackerZNCCInverseCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), warp(), and warpTriangle().
|
pure virtual |
Warp point using the RT transformation model.
X1 | : Vector corresponding to the coordinates of the point to warp. |
X2 | : Vector corresponding to the coordinates of the warped point. |
p | : Vector that contains the parameters of the RT transformation. |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpHomographySL3, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
|
pure virtual |
Warp a point X1 with the inverse transformation .
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 . |
Implemented in vpTemplateTrackerWarpHomography, vpTemplateTrackerWarpAffine, vpTemplateTrackerWarpSRT, vpTemplateTrackerWarpRT, and vpTemplateTrackerWarpTranslation.
Referenced by vpTemplateTrackerWarpRT::isESMcompatible(), vpTemplateTrackerWarpTranslation::isESMcompatible(), vpTemplateTrackerWarpSRT::isESMcompatible(), vpTemplateTrackerWarpAffine::isESMcompatible(), vpTemplateTrackerWarpHomographySL3::isESMcompatible(), and vpTemplateTrackerWarpHomography::isESMcompatible().
void vpTemplateTrackerWarp::warpZone | ( | const vpTemplateTrackerZone & | in, |
const vpColVector & | p, | ||
vpTemplateTrackerZone & | out | ||
) |
Warp a zone and store the result in a new zone.
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. |
Definition at line 62 of file vpTemplateTrackerWarp.cpp.
References vpTemplateTrackerZone::add(), vpTemplateTrackerZone::clear(), vpTemplateTrackerZone::getNbTriangle(), vpTemplateTrackerZone::getTriangle(), and warpTriangle().
Referenced by vpTemplateTracker::display().
|
protected |
Internal value used by homography warp model.
Definition at line 61 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpHomographySL3::computeDenom(), vpTemplateTrackerWarpHomography::computeDenom(), vpTemplateTrackerWarpHomographySL3::dWarp(), vpTemplateTrackerWarpHomography::dWarp(), vpTemplateTrackerWarpHomographySL3::dWarpCompo(), vpTemplateTrackerWarpHomography::dWarpCompo(), vpTemplateTrackerWarpHomographySL3::warpX(), and vpTemplateTrackerWarpHomography::warpX().
|
protected |
Number of parameters used to model warp transformation.
Definition at line 62 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpHomographySL3::dWarpCompo(), vpTemplateTrackerWarpTranslation::dWarpCompo(), vpTemplateTrackerWarpRT::dWarpCompo(), vpTemplateTrackerWarpAffine::dWarpCompo(), vpTemplateTrackerWarpSRT::dWarpCompo(), vpTemplateTrackerWarpHomography::dWarpCompo(), vpTemplateTrackerWarpHomographySL3::findWarp(), vpTemplateTrackerWarpHomographySL3::getdW0(), vpTemplateTrackerWarpHomographySL3::getdWdp0(), vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine(), vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography(), vpTemplateTrackerWarpHomographySL3::vpTemplateTrackerWarpHomographySL3(), vpTemplateTrackerWarpRT::vpTemplateTrackerWarpRT(), vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT(), vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation(), and warp().