Visual Servoing Platform
version 3.5.1 under development (2023-09-22)
|
#include <visp3/tt/vpTemplateTrackerWarpHomography.h>
Public Member Functions | |
vpTemplateTrackerWarpHomography () | |
void | computeDenom (vpColVector &X, const vpColVector &p) |
void | dWarp (const vpColVector &, const vpColVector &X, const vpColVector &, vpMatrix &dW) |
void | dWarpCompo (const vpColVector &X, const vpColVector &, const vpColVector &p, const double *dwdp0, vpMatrix &dW) |
void | getdW0 (const int &v, const int &u, const double &dv, const double &du, double *dIdW) |
void | getdWdp0 (const int &v, const int &u, double *dIdW) |
vpHomography | getHomography (const vpColVector &ParamM) const |
void | getParam (const vpHomography &H, vpColVector &p) const |
void | getParam (const vpMatrix &H, vpColVector &p) const |
void | getParamInverse (const vpColVector &p, vpColVector &p_inv) const |
void | getParamPyramidDown (const vpColVector &p, vpColVector &p_down) |
void | getParamPyramidUp (const vpColVector &p, vpColVector &p_up) |
bool | isESMcompatible () const |
void | pRondp (const vpColVector &p1, const vpColVector &p2, vpColVector &p12) const |
void | warpX (const vpColVector &X1, vpColVector &X2, const vpColVector &p) |
void | warpX (const int &v1, const int &u1, double &v2, double &u2, const vpColVector &p) |
void | warpXInv (const vpColVector &X1, vpColVector &X2, const vpColVector &p) |
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 |
This class consider the homography warping model with parameters such as
We recall that u axis is the image horizontal axis, and v axis is the image vertical axis. A point (u,v) with coordinates (0,0) is located in the top left image corner.
Definition at line 68 of file vpTemplateTrackerWarpHomography.h.
vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography | ( | ) |
Construct an homography model with 8 parameters initialized to zero.
Definition at line 45 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::nbParam.
void vpTemplateTrackerWarpHomography::computeDenom | ( | vpColVector & | X, |
const vpColVector & | p | ||
) |
Compute the projection denominator (Z) used in x = X/Z and y = Y/Z.
X | : Point with coordinates (u, v) to consider. |
p | : 8-dim vector that contains the current parameters of the warping function. |
Definition at line 148 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::denom, and vpTrackingException::fatalError.
|
virtual |
Compute the derivative matrix of the warping function at point according to the model parameters:
X | : 2-dim vector corresponding to the coordinates of the point to consider in the derivative computation. |
dM | : Resulting warping model derivative returned as a 2-by-8 matrix. |
Implements vpTemplateTrackerWarp.
Definition at line 201 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::denom.
|
virtual |
Compute the compositionnal derivative matrix of the warping function according to the model parameters.
X | : 2-dim vector corresponding to the coordinates of the point to consider in the derivative computation. |
p | : 8-dim vector that contains the parameters of the warping function. |
dwdp0 | : 2-by-8 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-8 matrix. |
Implements vpTemplateTrackerWarp.
Definition at line 232 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::denom, and vpTemplateTrackerWarp::nbParam.
|
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 72 of file vpTemplateTrackerWarp.cpp.
References vpTemplateTrackerTriangle::getCorner(), and vpTemplateTrackerWarp::warpX().
|
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). |
Implements vpTemplateTrackerWarp.
Definition at line 91 of file vpTemplateTrackerWarpHomography.cpp.
|
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-8 derivative matrix. |
Implements vpTemplateTrackerWarp.
Definition at line 117 of file vpTemplateTrackerWarpHomography.cpp.
vpHomography vpTemplateTrackerWarpHomography::getHomography | ( | const vpColVector & | p | ) | const |
Return the homography corresponding to the parameters.
p | : 8-dim vector that contains the parameters corresponding to the transformation to inverse. |
Definition at line 310 of file vpTemplateTrackerWarpHomography.cpp.
|
inlineinherited |
Get the number of parameters of the warping function.
Definition at line 215 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTracker::computeOptimalBrentGain(), getParam(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), and vpTemplateTracker::vpTemplateTracker().
void vpTemplateTrackerWarpHomography::getParam | ( | const vpHomography & | H, |
vpColVector & | p | ||
) | const |
Compute the parameters corresponding to an homography.
[in] | H | : Homography |
[out] | p | : 8-dim vector corresponding to the homography. |
Definition at line 331 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::getNbParam(), and vpColVector::resize().
void vpTemplateTrackerWarpHomography::getParam | ( | const vpMatrix & | H, |
vpColVector & | p | ||
) | const |
Compute the parameters corresponding to an homography as a 3-by-3 matrix.
[in] | H | : 3-by-3 matrix corresponding to an homography |
[out] | p | : 8-dim vector corresponding to the homography. |
Definition at line 349 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::getNbParam(), and vpColVector::resize().
|
virtual |
Compute inverse of the warping transformation.
p | : 8-dim vector that contains the parameters corresponding to the transformation to inverse. |
p_inv | : 8-dim vector that contains the parameters of the inverse transformation . |
Implements vpTemplateTrackerWarp.
Definition at line 275 of file vpTemplateTrackerWarpHomography.cpp.
References vpException::fatalError.
|
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 | : 8-dim vector that contains the current parameters of the warping function. |
p_down | : 8-dim vector that contains the resulting parameters one level down. |
Implements vpTemplateTrackerWarp.
Definition at line 53 of file vpTemplateTrackerWarpHomography.cpp.
|
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 | : 8-dim vector that contains the current parameters of the warping function. |
p_up | : 8-dim vector that contains the resulting parameters one level up. |
Implements vpTemplateTrackerWarp.
Definition at line 71 of file vpTemplateTrackerWarpHomography.cpp.
|
inlinevirtual |
Tells if the warping function is ESM compatible.
Implements vpTemplateTrackerWarp.
Definition at line 98 of file vpTemplateTrackerWarpHomography.h.
|
virtual |
Compute the transformation resulting from the composition of two other transformations.
p1 | : 8-dim vector that contains the parameters corresponding to first transformation. |
p2 | : 8-dim vector that contains the parameters corresponding to second transformation. |
p12 | : 8-dim vector that contains the resulting transformation . |
Implements vpTemplateTrackerWarp.
Definition at line 370 of file vpTemplateTrackerWarpHomography.cpp.
|
inlineinherited |
Set the number of parameters of the warping function.
nb | : New number of parameters. |
Definition at line 222 of file vpTemplateTrackerWarp.h.
|
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 94 of file vpTemplateTrackerWarp.cpp.
References vpTemplateTrackerWarp::warpX().
Referenced by vpTemplateTrackerWarpHomographySL3::getParamPyramidDown(), and vpTemplateTrackerWarpHomographySL3::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 41 of file vpTemplateTrackerWarp.cpp.
References vpException::dimensionError, vpTemplateTrackerTriangle::getCorners(), vpTemplateTrackerTriangle::init(), vpArray2D< Type >::size(), vpCTRACE, and vpTemplateTrackerWarp::warpX().
Referenced by vpTemplateTrackerWarp::warpZone().
|
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 | : 8-dim vector that contains the parameters of the transformation. |
Implements vpTemplateTrackerWarp.
Definition at line 169 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::denom.
|
virtual |
Warp point using the transformation model.
X1 | : 2-dim vector corresponding to the coordinates of the point to warp. |
X2 | : 2-dim vector corresponding to the coordinates of the warped point. |
p | : 8-dim vector that contains the parameters of the transformation. |
Implements vpTemplateTrackerWarp.
Definition at line 184 of file vpTemplateTrackerWarpHomography.cpp.
References vpTemplateTrackerWarp::denom.
|
virtual |
Warp a point X1 with the inverse transformation .
X1 | : 2-dim vector corresponding to the coordinates (u,v) of the point to warp. |
X2 | : 2-dim vector corresponding to the coordinates (u,v) of the warped point. |
p | : Parameters corresponding to the warping model . |
Implements vpTemplateTrackerWarp.
Definition at line 255 of file vpTemplateTrackerWarpHomography.cpp.
References vpTrackingException::fatalError.
|
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 61 of file vpTemplateTrackerWarp.cpp.
References vpTemplateTrackerZone::add(), vpTemplateTrackerZone::clear(), vpTemplateTrackerZone::getNbTriangle(), vpTemplateTrackerZone::getTriangle(), and vpTemplateTrackerWarp::warpTriangle().
Referenced by vpTemplateTracker::display().
|
protectedinherited |
Internal value used by homography warp model.
Definition at line 60 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpHomographySL3::computeDenom(), computeDenom(), dWarp(), vpTemplateTrackerWarpHomographySL3::dWarp(), vpTemplateTrackerWarpHomographySL3::dWarpCompo(), dWarpCompo(), warpX(), and vpTemplateTrackerWarpHomographySL3::warpX().
|
protectedinherited |
Number of parameters used to model warp transformation.
Definition at line 61 of file vpTemplateTrackerWarp.h.
Referenced by vpTemplateTrackerWarpTranslation::dWarpCompo(), vpTemplateTrackerWarpAffine::dWarpCompo(), vpTemplateTrackerWarpRT::dWarpCompo(), vpTemplateTrackerWarpSRT::dWarpCompo(), vpTemplateTrackerWarpHomographySL3::dWarpCompo(), dWarpCompo(), vpTemplateTrackerWarpHomographySL3::findWarp(), vpTemplateTrackerWarpHomographySL3::getdW0(), vpTemplateTrackerWarpHomographySL3::getdWdp0(), vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine(), vpTemplateTrackerWarpHomography(), vpTemplateTrackerWarpHomographySL3::vpTemplateTrackerWarpHomographySL3(), vpTemplateTrackerWarpRT::vpTemplateTrackerWarpRT(), vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT(), and vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation().