Visual Servoing Platform
version 3.2.0 under development (2019-01-22)
|
#include <visp3/tt/vpTemplateTrackerWarpHomographySL3.h>
Public Member Functions | |
vpTemplateTrackerWarpHomographySL3 () | |
virtual | ~vpTemplateTrackerWarpHomographySL3 () |
void | computeCoeff (const vpColVector &p) |
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 | findWarp (const double *ut0, const double *vt0, const double *u, const double *v, int nb_pt, vpColVector &p) |
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) |
void | getdWdp0 (const double &i, const double &j, double *dIdW) |
vpHomography | getHomography () 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) |
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) |
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 | |
vpMatrix | G |
vpMatrix | dGx |
std::vector< vpMatrix > | A |
double | denom |
vpMatrix | dW |
unsigned int | nbParam |
Definition at line 58 of file vpTemplateTrackerWarpHomographySL3.h.
vpTemplateTrackerWarpHomographySL3::vpTemplateTrackerWarpHomographySL3 | ( | ) |
Definition at line 122 of file vpTemplateTrackerWarpHomographySL3.cpp.
References A, dGx, G, vpTemplateTrackerWarp::nbParam, and vpArray2D< Type >::resize().
|
virtual |
Definition at line 145 of file vpTemplateTrackerWarpHomographySL3.cpp.
void vpTemplateTrackerWarpHomographySL3::computeCoeff | ( | const vpColVector & | p | ) |
Compute the exponential of the homography matrix defined by the given parameters
p | : Parameters of the SL3 homography warping function. |
Definition at line 235 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpMatrix::expm(), and G.
Referenced by findWarp().
void vpTemplateTrackerWarpHomographySL3::computeDenom | ( | vpColVector & | vX, |
const vpColVector & | ParamM | ||
) |
Compute the projection denominator (Z) used in x = X/Z and y = Y/Z.
vX | : Point to consider |
ParamM | : parameters of the warping function. |
Definition at line 230 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpTemplateTrackerWarp::denom, and G.
Referenced by findWarp().
|
virtual |
Compute the derivative of the warping function according to its 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 276 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpTemplateTrackerWarp::denom, dGx, and G.
|
virtual |
Compute the compositionnal derivative of the warping function according to its 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 394 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpTemplateTrackerWarp::denom, G, and vpTemplateTrackerWarp::nbParam.
void vpTemplateTrackerWarpHomographySL3::findWarp | ( | const double * | ut0, |
const double * | vt0, | ||
const double * | u, | ||
const double * | v, | ||
int | nb_pt, | ||
vpColVector & | p | ||
) |
Find the displacement/warping function parameters from a list of points.
ut0 | : Original u coordinates. |
vt0 | : Original v coordinates. |
u | : Warped u coordinates. |
v | : Warped v coordinates. |
nb_pt | : Number of points. |
p | : Resulting warping function parameters. |
Definition at line 45 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpMatrix::AtA(), computeCoeff(), computeDenom(), vpMatrix::computeHLM(), getdWdp0(), vpMatrix::inverseByLU(), vpTemplateTrackerWarp::nbParam, pRondp(), vpMatrix::t(), and warpX().
Referenced by getParamPyramidDown(), and getParamPyramidUp().
|
inherited |
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 vpTemplateTrackerWarp::warpX().
|
virtual |
Compute the derivative of the image with relation to the warping function 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 301 of file vpTemplateTrackerWarpHomographySL3.cpp.
References dGx, vpMatrix::eye(), G, and vpTemplateTrackerWarp::nbParam.
|
virtual |
Compute the derivative of the warping function according to the initial 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 333 of file vpTemplateTrackerWarpHomographySL3.cpp.
References dGx, vpMatrix::eye(), G, and vpTemplateTrackerWarp::nbParam.
Referenced by findWarp().
void vpTemplateTrackerWarpHomographySL3::getdWdp0 | ( | const double & | i, |
const double & | j, | ||
double * | dIdW | ||
) |
Compute the derivative of the warping function according to the initial 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). |
Definition at line 362 of file vpTemplateTrackerWarpHomographySL3.cpp.
References dGx, vpMatrix::eye(), G, and vpTemplateTrackerWarp::nbParam.
vpHomography vpTemplateTrackerWarpHomographySL3::getHomography | ( | ) | const |
Return the homography defined by the warping function
Definition at line 267 of file vpTemplateTrackerWarpHomographySL3.cpp.
References G.
|
inlineinherited |
Get the number of parameters of the warping function.
Definition at line 141 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTracker::computeOptimalBrentGain(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), and vpTemplateTracker::vpTemplateTracker().
|
virtual |
Get the inverse of the warping function parameters.
ParamM | : Parameters of the warping function. |
ParamMinv | : Inverse parameters. |
Implements vpTemplateTrackerWarp.
Definition at line 403 of file vpTemplateTrackerWarpHomographySL3.cpp.
|
virtual |
Get the parameters of the warping function one level down.
p | : Current parameters of the warping function. |
pdown | : Resulting parameters on level down. |
Implements vpTemplateTrackerWarp.
Definition at line 149 of file vpTemplateTrackerWarpHomographySL3.cpp.
References findWarp(), and vpTemplateTrackerWarp::warp().
|
virtual |
Get the parameters of the warping function one level up.
p | : Current parameters of the warping function. |
pup | : Resulting parameters one level up. |
Implements vpTemplateTrackerWarp.
Definition at line 183 of file vpTemplateTrackerWarpHomographySL3.cpp.
References findWarp(), and vpTemplateTrackerWarp::warp().
|
inlinevirtual |
Tells if the warping function is ESM compatible.
Implements vpTemplateTrackerWarp.
Definition at line 194 of file vpTemplateTrackerWarpHomographySL3.h.
References vpTemplateTrackerWarp::pRondp(), vpTemplateTrackerWarp::warpX(), and vpTemplateTrackerWarp::warpXInv().
|
virtual |
Get the displacement resulting from the composition of two other displacements.
p1 | : First displacement. |
p2 | : Second displacement. |
pres | : Displacement resulting from the composition of p1 and p2. |
Implements vpTemplateTrackerWarp.
Definition at line 407 of file vpTemplateTrackerWarpHomographySL3.cpp.
Referenced by findWarp().
|
inlineinherited |
Set the number of parameters of the warping function.
nb | : New number of parameters. |
Definition at line 189 of file vpTemplateTrackerWarp.h.
References vpArray2D< Type >::resize().
|
inherited |
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(), vpTemplateTrackerWarp::dWarp(), vpMatrix::inverseByLU(), vpTemplateTrackerWarp::nbParam, vpMatrix::t(), and vpTemplateTrackerWarp::warpX().
Referenced by getParamPyramidDown(), and getParamPyramidUp().
|
inherited |
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 vpTemplateTrackerWarp::warpX().
Referenced by vpTemplateTrackerWarp::warpZone().
|
virtual |
Warp a point.
vX | : Coordinates of the point to warp. |
vXres | : Coordinates of the warped point. |
ParamM | : Parameters of the warping function. |
Implements vpTemplateTrackerWarp.
Definition at line 253 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpTemplateTrackerWarp::denom, and G.
Referenced by findWarp().
|
virtual |
Warp a point.
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 260 of file vpTemplateTrackerWarpHomographySL3.cpp.
References vpTemplateTrackerWarp::denom, and G.
|
pure virtualinherited |
Inverse Warp a point.
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.
Referenced by vpTemplateTrackerWarpRT::isESMcompatible(), vpTemplateTrackerWarpSRT::isESMcompatible(), vpTemplateTrackerWarpTranslation::isESMcompatible(), vpTemplateTrackerWarpAffine::isESMcompatible(), vpTemplateTrackerWarpHomography::isESMcompatible(), and isESMcompatible().
|
inherited |
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 vpTemplateTrackerWarp::warpTriangle().
Referenced by vpTemplateTracker::display().
|
protected |
Definition at line 63 of file vpTemplateTrackerWarpHomographySL3.h.
Referenced by vpTemplateTrackerWarpHomographySL3().
|
protectedinherited |
Definition at line 61 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpHomography::computeDenom(), computeDenom(), vpTemplateTrackerWarpHomography::dWarp(), dWarp(), vpTemplateTrackerWarpHomography::dWarpCompo(), dWarpCompo(), vpTemplateTrackerWarpHomography::warpX(), and warpX().
|
protected |
Definition at line 62 of file vpTemplateTrackerWarpHomographySL3.h.
Referenced by dWarp(), getdW0(), getdWdp0(), and vpTemplateTrackerWarpHomographySL3().
|
protectedinherited |
Definition at line 62 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine(), vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography(), vpTemplateTrackerWarpRT::vpTemplateTrackerWarpRT(), vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT(), and vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation().
|
protected |
Definition at line 61 of file vpTemplateTrackerWarpHomographySL3.h.
Referenced by computeCoeff(), computeDenom(), dWarp(), dWarpCompo(), getdW0(), getdWdp0(), getHomography(), vpTemplateTrackerWarpHomographySL3(), and warpX().
|
protectedinherited |
Definition at line 63 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpRT::dWarpCompo(), vpTemplateTrackerWarpTranslation::dWarpCompo(), vpTemplateTrackerWarpSRT::dWarpCompo(), vpTemplateTrackerWarpAffine::dWarpCompo(), vpTemplateTrackerWarpHomography::dWarpCompo(), dWarpCompo(), findWarp(), getdW0(), getdWdp0(), vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine(), vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography(), vpTemplateTrackerWarpHomographySL3(), vpTemplateTrackerWarpRT::vpTemplateTrackerWarpRT(), vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT(), vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation(), and vpTemplateTrackerWarp::warp().