ViSP
2.9.0
|
#include <vpMbtDistanceCylinder.h>
Public Member Functions | |
vpMbtDistanceCylinder () | |
~vpMbtDistanceCylinder () | |
void | buildFrom (const vpPoint &_p1, const vpPoint &_p2, const double r) |
void | computeInteractionMatrixError (const vpHomogeneousMatrix &cMo, const vpImage< unsigned char > &I) |
void | display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness=1) |
void | display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness=1) |
void | displayMovingEdges (const vpImage< unsigned char > &I) |
void | getCameraParameters (vpCameraParameters &camera) |
unsigned int | getIndex () |
double | getMeanWeight1 () const |
double | getMeanWeight2 () const |
std::string | getName () const |
void | initInteractionMatrixError () |
void | initMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | reinitMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | setCameraParameters (const vpCameraParameters &camera) |
void | setIndex (const unsigned int i) |
void | setMeanWeight1 (const double wmean) |
void | setMeanWeight2 (const double wmean) |
void | setMovingEdge (vpMe *Me) |
void | setName (const std::string &cyl_name) |
void | setName (const char *cyl_name) |
void | trackMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | updateMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
Public Attributes | |
vpMbtMeLine * | meline1 |
vpMbtMeLine * | meline2 |
vpCircle * | cercle1 |
vpCircle * | cercle2 |
double | radius |
vpPoint * | p1 |
vpPoint * | p2 |
vpMatrix | L |
vpColVector | error |
unsigned int | nbFeature |
unsigned int | nbFeaturel1 |
unsigned int | nbFeaturel2 |
bool | Reinit |
vpCylinder * | c |
Manage a cylinder used in the model-based tracker.
Definition at line 67 of file vpMbtDistanceCylinder.h.
vpMbtDistanceCylinder::vpMbtDistanceCylinder | ( | ) |
Basic constructor
Definition at line 66 of file vpMbtDistanceCylinder.cpp.
vpMbtDistanceCylinder::~vpMbtDistanceCylinder | ( | ) |
Build a vpMbtDistanceCylinder thanks to two points corresponding to the extremities of its axis and its radius.
_p1 | : The first extremity on the axis. |
_p2 | : The second extremity on the axis. |
r | : Radius of the cylinder. |
Definition at line 115 of file vpMbtDistanceCylinder.cpp.
References c, cercle1, cercle2, vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), p1, p2, radius, vpCircle::setWorldCoordinates(), and vpCylinder::setWorldCoordinates().
Referenced by vpMbEdgeTracker::addCylinder().
void vpMbtDistanceCylinder::computeInteractionMatrixError | ( | const vpHomogeneousMatrix & | cMo, |
const vpImage< unsigned char > & | I | ||
) |
Compute the interaction matrix and the error vector corresponding to the cylinder.
Definition at line 646 of file vpMbtDistanceCylinder.cpp.
References c, cercle1, cercle2, vpCircle::changeFrame(), vpCylinder::changeFrame(), vpFeatureBuilder::create(), vpDisplay::displayCross(), error, vpDisplay::flush(), vpCameraParameters::get_px(), vpCameraParameters::get_py(), vpCameraParameters::get_u0(), vpCameraParameters::get_v0(), vpMeTracker::getMeList(), vpFeatureLine::getRho(), vpFeatureLine::getTheta(), vpFeatureLine::interaction(), vpMeSite::j, L, vpCylinder::line1, vpCylinder::line2, meline1, meline2, vpColor::orange, vpCircle::projection(), vpCylinder::projection(), and vpColor::red.
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbEdgeKltTracker::trackSecondLoop().
void vpMbtDistanceCylinder::display | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | camera, | ||
const vpColor | col, | ||
const unsigned int | thickness = 1 |
||
) |
Display the cylinder. The 3D cylinder is projected into the image.
I | : The image. |
cMo | : Pose used to project the 3D model into the image. |
camera | : The camera parameters. |
col | : The desired color. |
thickness | : The thickness of the lines. |
Definition at line 495 of file vpMbtDistanceCylinder.cpp.
References c, cercle1, cercle2, vpPoint::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpMeterPixelConversion::convertLine(), vpDisplay::displayLine(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), p1, p2, vpCircle::projection(), vpPoint::projection(), vpCylinder::projection(), and vpImagePoint::set_ij().
void vpMbtDistanceCylinder::display | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | camera, | ||
const vpColor | col, | ||
const unsigned int | thickness = 1 |
||
) |
Display the cylinder. The 3D cylinder is projected into the image.
I | : The image. |
cMo | : Pose used to project the 3D model into the image. |
camera | : The camera parameters. |
col | : The desired color. |
thickness | : The thickness of the lines. |
Definition at line 555 of file vpMbtDistanceCylinder.cpp.
References c, cercle1, cercle2, vpPoint::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpMeterPixelConversion::convertLine(), vpDisplay::displayLine(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), p1, p2, vpCircle::projection(), vpPoint::projection(), vpCylinder::projection(), and vpImagePoint::set_ij().
void vpMbtDistanceCylinder::displayMovingEdges | ( | const vpImage< unsigned char > & | I | ) |
Enable to display the points along the lines with a color corresponding to their state.
I | : The image. |
Definition at line 617 of file vpMbtDistanceCylinder.cpp.
References vpMbtMeLine::display(), meline1, and meline2.
Referenced by vpMbEdgeKltTracker::postTracking(), and vpMbEdgeTracker::track().
|
inline |
Get the camera paramters.
camera | : The vpCameraParameters used to store the camera parameters. |
Definition at line 131 of file vpMbtDistanceCylinder.h.
|
inline |
Get the index of the cylinder.
Definition at line 138 of file vpMbtDistanceCylinder.h.
|
inline |
Get the mean weight of the first line. The mean weight is computed thanks to the weight of each moving edge. Those weights are computed by the robust estimation method used during the virtual visual servoing.
Definition at line 146 of file vpMbtDistanceCylinder.h.
|
inline |
Get the mean weight of the second line. The mean weight is computed thanks to the weight of each moving edge. Those weights are computed by the robust estimation method used during the virtual visual servoing.
Definition at line 154 of file vpMbtDistanceCylinder.h.
|
inline |
Get the name of the cylinder.
Definition at line 161 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::removeCylinder().
void vpMbtDistanceCylinder::initInteractionMatrixError | ( | ) |
Initialize the size of the interaction matrix and the error vector.
Definition at line 633 of file vpMbtDistanceCylinder.cpp.
References error, vpMeTracker::getMeList(), L, meline1, meline2, nbFeature, nbFeaturel1, nbFeaturel2, vpColVector::resize(), and vpMatrix::resize().
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::initMbtTracking(), and vpMbEdgeTracker::track().
void vpMbtDistanceCylinder::initMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo | ||
) |
Initialize the moving edge thanks to a given pose of the camera. The 3D model is projected into the image to create moving edges along the lines.
I | : The image. |
cMo | : The pose of the camera used to initialize the moving edges. |
Definition at line 233 of file vpMbtDistanceCylinder.cpp.
References c, cercle1, cercle2, vpPoint::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpMeterPixelConversion::convertLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpMbtMeLine::imax, vpMbtMeLine::imin, vpMbtMeLine::initTracking(), vpMbtMeLine::jmax, vpMbtMeLine::jmin, meline1, meline2, p1, p2, vpCircle::projection(), vpPoint::projection(), vpCylinder::projection(), vpImagePoint::set_ij(), vpMeTracker::setInitRange(), vpMeTracker::setMe(), and vpTRACE.
Referenced by vpMbEdgeTracker::initMovingEdge(), reinitMovingEdge(), and vpMbEdgeTracker::trackMovingEdge().
void vpMbtDistanceCylinder::reinitMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo | ||
) |
Reinitialize the cylinder if it is required.
A line is reinitialized if the 2D lines do not match enough with the projected 3D lines.
I | : the image. |
cMo | : The pose of the camera. |
Definition at line 469 of file vpMbtDistanceCylinder.cpp.
References initMovingEdge(), meline1, meline2, and Reinit.
Referenced by vpMbEdgeTracker::reInitLevel(), and vpMbEdgeTracker::reinitMovingEdge().
|
inline |
Set the camera paramters.
camera | : The camera parameters. |
Definition at line 173 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::addCylinder().
|
inline |
Set the index of the cylinder.
i | : The index number |
Definition at line 180 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::addCylinder().
|
inline |
Set the mean weight of the first line.
wmean | : The mean weight of the first line. |
Definition at line 187 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::computeVVS(), and vpMbEdgeKltTracker::postTrackingMbt().
|
inline |
Set the mean weight of the second line.
wmean | : The mean weight of the second line. |
Definition at line 194 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::computeVVS(), and vpMbEdgeKltTracker::postTrackingMbt().
void vpMbtDistanceCylinder::setMovingEdge | ( | vpMe * | _me | ) |
Set the moving edge parameters.
_me | : an instance of vpMe containing all the desired parameters |
Definition at line 159 of file vpMbtDistanceCylinder.cpp.
References meline1, meline2, and vpMeTracker::setMe().
Referenced by vpMbEdgeTracker::addCylinder(), and vpMbEdgeTracker::setMovingEdge().
|
inline |
Set the name of the cylinder.
cyl_name | : The name of the cylinder. |
Definition at line 203 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::addCylinder().
|
inline |
Set the name of the cylinder.
cyl_name | : The name of the cylinder |
Definition at line 210 of file vpMbtDistanceCylinder.h.
void vpMbtDistanceCylinder::trackMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo | ||
) |
Track the moving edges in the image.
I | : the image. |
cMo | : The pose of the camera. |
Definition at line 333 of file vpMbtDistanceCylinder.cpp.
References vpMeTracker::getMeList(), meline1, meline2, nbFeature, nbFeaturel1, nbFeaturel2, Reinit, and vpMbtMeLine::track().
Referenced by vpMbEdgeTracker::trackMovingEdge().
void vpMbtDistanceCylinder::updateMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo | ||
) |
Update the moving edges internal parameters.
I | : the image. |
cMo | : The pose of the camera. |
Definition at line 368 of file vpMbtDistanceCylinder.cpp.
References c, cercle1, cercle2, vpPoint::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpMeterPixelConversion::convertLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMeTracker::getMeList(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpMbtMeLine::imax, vpMbtMeLine::imin, vpMbtMeLine::jmax, vpMbtMeLine::jmin, meline1, meline2, nbFeature, nbFeaturel1, nbFeaturel2, p1, p2, vpCircle::projection(), vpPoint::projection(), vpCylinder::projection(), Reinit, vpImagePoint::set_ij(), and vpMbtMeLine::updateParameters().
Referenced by vpMbEdgeTracker::updateMovingEdge().
vpCylinder* vpMbtDistanceCylinder::c |
The cylinder.
Definition at line 112 of file vpMbtDistanceCylinder.h.
Referenced by buildFrom(), computeInteractionMatrixError(), display(), initMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
vpCircle* vpMbtDistanceCylinder::cercle1 |
The upper circle limiting the cylinder.
Definition at line 87 of file vpMbtDistanceCylinder.h.
Referenced by buildFrom(), computeInteractionMatrixError(), display(), initMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
vpCircle* vpMbtDistanceCylinder::cercle2 |
The lower circle limiting the cylinder.
Definition at line 89 of file vpMbtDistanceCylinder.h.
Referenced by buildFrom(), computeInteractionMatrixError(), display(), initMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
vpColVector vpMbtDistanceCylinder::error |
The error vector.
Definition at line 102 of file vpMbtDistanceCylinder.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), and vpMbEdgeKltTracker::trackSecondLoop().
vpMatrix vpMbtDistanceCylinder::L |
The interaction matrix.
Definition at line 100 of file vpMbtDistanceCylinder.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), and vpMbEdgeKltTracker::trackSecondLoop().
vpMbtMeLine* vpMbtDistanceCylinder::meline1 |
The moving edge containers (first line of the cylinder)
Definition at line 82 of file vpMbtDistanceCylinder.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), displayMovingEdges(), vpMbEdgeTracker::getNbPoints(), initInteractionMatrixError(), initMovingEdge(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), setMovingEdge(), vpMbEdgeTracker::testTracking(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeTracker::trackMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
vpMbtMeLine* vpMbtDistanceCylinder::meline2 |
The moving edge containers (second line of the cylinder)
Definition at line 84 of file vpMbtDistanceCylinder.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), displayMovingEdges(), vpMbEdgeTracker::getNbPoints(), initInteractionMatrixError(), initMovingEdge(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), setMovingEdge(), vpMbEdgeTracker::testTracking(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeTracker::trackMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
unsigned int vpMbtDistanceCylinder::nbFeature |
The number of moving edges.
Definition at line 104 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeKltTracker::postTrackingMbt(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeKltTracker::trackSecondLoop(), and updateMovingEdge().
unsigned int vpMbtDistanceCylinder::nbFeaturel1 |
The number of moving edges on line 1.
Definition at line 106 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), vpMbEdgeKltTracker::postTrackingMbt(), trackMovingEdge(), updateMovingEdge(), and vpMbEdgeTracker::updateMovingEdge().
unsigned int vpMbtDistanceCylinder::nbFeaturel2 |
The number of moving edges on line 2.
Definition at line 108 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), vpMbEdgeKltTracker::postTrackingMbt(), trackMovingEdge(), updateMovingEdge(), and vpMbEdgeTracker::updateMovingEdge().
vpPoint* vpMbtDistanceCylinder::p1 |
The first extremity on the axe.
Definition at line 95 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::addCylinder(), buildFrom(), display(), initMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
vpPoint* vpMbtDistanceCylinder::p2 |
The second extremity on the axe.
Definition at line 97 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::addCylinder(), buildFrom(), display(), initMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCylinder().
double vpMbtDistanceCylinder::radius |
The radius of the cylinder.
Definition at line 92 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::addCylinder(), and buildFrom().
bool vpMbtDistanceCylinder::Reinit |
Indicates if the line has to be reinitialized.
Definition at line 110 of file vpMbtDistanceCylinder.h.
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), vpMbEdgeTracker::reinitMovingEdge(), trackMovingEdge(), updateMovingEdge(), and vpMbEdgeTracker::updateMovingEdge().