ViSP
2.8.0
|
#include <vpMbtDistanceLine.h>
Public Member Functions | |
vpMbtDistanceLine () | |
~vpMbtDistanceLine () | |
void | buildFrom (vpPoint &_p1, vpPoint &_p2) |
bool | closeToImageBorder (const vpImage< unsigned char > &I, const unsigned int threshold) |
void | computeInteractionMatrixError (const vpHomogeneousMatrix &cMo) |
void | display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness=1, const bool displayFullModel=false) |
void | display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness=1, const bool displayFullModel=false) |
void | displayMovingEdges (const vpImage< unsigned char > &I) |
void | getCameraParameters (vpCameraParameters &cam) const |
unsigned int | getIndex () const |
double | getMeanWeight () const |
std::string | getName () const |
vpMbtPolygon & | getPolygon () |
void | initInteractionMatrixError () |
void | initMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
bool | isVisible () const |
void | reinitMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | setCameraParameters (const vpCameraParameters &cam) |
void | setIndex (const unsigned int i) |
void | setMeanWeight (const double wmean) |
void | setMovingEdge (vpMe *Me) |
void | setName (const std::string name) |
void | setName (const char *name) |
void | setVisible (bool _isvisible) |
void | trackMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | updateMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
Public Attributes | |
vpMbtMeLine * | meline |
vpLine * | line |
vpPoint * | p1 |
vpPoint * | p2 |
vpMatrix | L |
vpColVector | error |
unsigned int | nbFeature |
bool | Reinit |
vpMbHiddenFaces< vpMbtPolygon > * | hiddenface |
std::list< int > | Lindex_polygon |
bool | isvisible |
Manage the line of a polygon used in the model-based tracker.
Definition at line 69 of file vpMbtDistanceLine.h.
vpMbtDistanceLine::vpMbtDistanceLine | ( | ) |
Basic constructor
Definition at line 59 of file vpMbtDistanceLine.cpp.
References hiddenface, isvisible, line, meline, nbFeature, p1, p2, and Reinit.
vpMbtDistanceLine::~vpMbtDistanceLine | ( | ) |
Basic destructor useful to deallocate the memory.
Definition at line 76 of file vpMbtDistanceLine.cpp.
Build a vpMbtDistanceLine thanks to two points corresponding to the extremities.
_p1 | : The first extremity. |
_p2 | : The second extremity. |
Definition at line 169 of file vpMbtDistanceLine.cpp.
References vpMbtPolygon::addPoint(), vpColVector::cross(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), line, vpMbtPolygon::p, p1, p2, vpMbtPolygon::setNbPoint(), and vpPoint::setWorldCoordinates().
Referenced by vpMbEdgeTracker::addLine().
bool vpMbtDistanceLine::closeToImageBorder | ( | const vpImage< unsigned char > & | I, |
const unsigned int | threshold | ||
) |
Test wether the line is close to the border of the image (at a given threshold)
I | : the input image (to know its size) |
threshold | : the threshold in pixel |
Definition at line 606 of file vpMbtDistanceLine.cpp.
References vpImage< Type >::getHeight(), vpMeTracker::getMeList(), vpImage< Type >::getWidth(), isvisible, and meline.
Referenced by vpMbEdgeTracker::computeVVS(), and vpMbEdgeKltTracker::trackFirstLoop().
void vpMbtDistanceLine::computeInteractionMatrixError | ( | const vpHomogeneousMatrix & | cMo | ) |
Compute the interaction matrix and the error vector corresponding to the line.
Definition at line 547 of file vpMbtDistanceLine.cpp.
References vpLine::changeFrame(), vpFeatureBuilder::create(), error, vpCameraParameters::get_px(), vpCameraParameters::get_py(), vpCameraParameters::get_u0(), vpCameraParameters::get_v0(), vpMeTracker::getMeList(), vpFeatureLine::getRho(), vpFeatureLine::getTheta(), vpFeatureLine::interaction(), isvisible, vpMeSite::j, line, meline, and vpLine::projection().
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbEdgeKltTracker::trackSecondLoop().
void vpMbtDistanceLine::display | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | cam, | ||
const vpColor | col, | ||
const unsigned int | thickness = 1 , |
||
const bool | displayFullModel = false |
||
) |
Display the line. The 3D line is projected into the image.
I | : The image. |
cMo | : Pose used to project the 3D model into the image. |
cam | : The camera parameters. |
col | : The desired color. |
thickness | : The thickness of the line. |
displayFullModel | : If true, the line is displayed even if it is not visible. |
Definition at line 439 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpCameraParameters::computeFov(), vpMbtPolygon::computeRoiClipped(), vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), vpMbtPolygon::DOWN_CLIPPING, vpMbtPolygon::FAR_CLIPPING, vpMbtPolygon::getClipping(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), isvisible, vpMbtPolygon::LEFT_CLIPPING, vpMbtPolygon::NEAR_CLIPPING, p1, p2, vpMbtPolygon::RIGHT_CLIPPING, vpMbtPolygon::roiPointsClip, and vpMbtPolygon::UP_CLIPPING.
Referenced by vpMbEdgeKltTracker::display(), and vpMbEdgeTracker::display().
void vpMbtDistanceLine::display | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | cam, | ||
const vpColor | col, | ||
const unsigned int | thickness = 1 , |
||
const bool | displayFullModel = false |
||
) |
Display the line. The 3D line is projected into the image.
I | : The image. |
cMo | : Pose used to project the 3D model into the image. |
cam | : The camera parameters. |
col | : The desired color. |
thickness | : The thickness of the line. |
displayFullModel | : If true, the line is displayed even if it is not visible. |
Definition at line 479 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpCameraParameters::computeFov(), vpMbtPolygon::computeRoiClipped(), vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), vpMbtPolygon::DOWN_CLIPPING, vpMbtPolygon::FAR_CLIPPING, vpMbtPolygon::getClipping(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), isvisible, vpMbtPolygon::LEFT_CLIPPING, vpMbtPolygon::NEAR_CLIPPING, p1, p2, vpMbtPolygon::RIGHT_CLIPPING, vpMbtPolygon::roiPointsClip, and vpMbtPolygon::UP_CLIPPING.
void vpMbtDistanceLine::displayMovingEdges | ( | const vpImage< unsigned char > & | I | ) |
Enable to display the points along the line with a color corresponding to their state.
I | : The image. |
Definition at line 519 of file vpMbtDistanceLine.cpp.
References vpMbtMeLine::display(), and meline.
Referenced by vpMbEdgeKltTracker::postTracking(), and vpMbEdgeTracker::track().
|
inline |
Get the camera paramters.
cam | : The vpCameraParameters used to store the camera parameters. |
Definition at line 124 of file vpMbtDistanceLine.h.
|
inline |
Get the index of the line.
Definition at line 131 of file vpMbtDistanceLine.h.
|
inline |
Get the mean weight of the 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 139 of file vpMbtDistanceLine.h.
|
inline |
Get the name of the line.
Definition at line 146 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::removeLine().
|
inline |
Get the polygon associated to the line.
Definition at line 153 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), vpMbEdgeTracker::setClipping(), vpMbEdgeTracker::setFarClippingDistance(), and vpMbEdgeTracker::setNearClippingDistance().
void vpMbtDistanceLine::initInteractionMatrixError | ( | ) |
Initialize the size of the interaction matrix and the error vector.
Definition at line 531 of file vpMbtDistanceLine.cpp.
References error, vpMeTracker::getMeList(), isvisible, meline, nbFeature, and vpColVector::resize().
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::initMbtTracking(), and vpMbEdgeTracker::track().
void vpMbtDistanceLine::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 line.
I | : The image. |
cMo | : The pose of the camera used to initialize the moving edges. |
Definition at line 247 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpLine::changeFrame(), vpCameraParameters::computeFov(), vpMbtPolygon::computeRoiClipped(), vpMeterPixelConversion::convertLine(), vpMeterPixelConversion::convertPoint(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMbtPolygon::getClipping(), vpImage< Type >::getHeight(), vpLine::getRho(), vpLine::getTheta(), vpImage< Type >::getWidth(), vpMbtMeLine::imax, vpMbtMeLine::imin, vpMbtMeLine::initTracking(), isvisible, vpMbtMeLine::jmax, vpMbtMeLine::jmin, line, meline, p1, p2, vpLine::projection(), vpMbtPolygon::roiPointsClip, vpMeTracker::setInitRange(), and vpMeTracker::setMe().
Referenced by vpMbEdgeTracker::initMovingEdge(), reinitMovingEdge(), and vpMbEdgeTracker::trackMovingEdge().
|
inline |
Check if the line is visible in the image or not.
Definition at line 164 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::getNbPoints(), vpMbEdgeKltTracker::postTracking(), vpMbEdgeTracker::reinitMovingEdge(), vpMbEdgeTracker::testTracking(), vpMbEdgeTracker::track(), vpMbEdgeTracker::trackMovingEdge(), and vpMbEdgeTracker::updateMovingEdge().
void vpMbtDistanceLine::reinitMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo | ||
) |
Reinitialize the line if it is required.
A line is reinitialized if the 2D line do not match enough with the projected 3D line.
I | : the image. |
cMo | : The pose of the camera. |
Definition at line 417 of file vpMbtDistanceLine.cpp.
References initMovingEdge(), meline, and Reinit.
Referenced by vpMbEdgeTracker::reInitLevel(), and vpMbEdgeTracker::reinitMovingEdge().
|
inline |
Set the camera paramters.
cam | : The camera parameters. |
Definition at line 172 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the index of the line.
i | : The index number |
Definition at line 179 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the mean weight of the line.
wmean | : The mean weight of the line. |
Definition at line 186 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVS(), and vpMbEdgeKltTracker::postTrackingMbt().
void vpMbtDistanceLine::setMovingEdge | ( | vpMe * | _me | ) |
Set the moving edge parameters.
_me | : an instance of vpMe containing all the desired parameters |
Definition at line 229 of file vpMbtDistanceLine.cpp.
References meline, and vpMeTracker::setMe().
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the name of the line.
name | : The name of the line. |
Definition at line 195 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the name of the line.
name | : The name of the line. |
Definition at line 202 of file vpMbtDistanceLine.h.
|
inline |
Set a boolean parameter to indicates if the line is visible in the image or not.
_isvisible | : Set to true if the line is visible |
Definition at line 209 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::initMovingEdge().
void vpMbtDistanceLine::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 313 of file vpMbtDistanceLine.cpp.
References vpMeTracker::getMeList(), isvisible, meline, nbFeature, Reinit, and vpMbtMeLine::track().
Referenced by vpMbEdgeTracker::trackMovingEdge().
void vpMbtDistanceLine::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 355 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpLine::changeFrame(), vpCameraParameters::computeFov(), vpMbtPolygon::computeRoiClipped(), vpMeterPixelConversion::convertLine(), vpMeterPixelConversion::convertPoint(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpMbtPolygon::getClipping(), vpImage< Type >::getHeight(), vpMeTracker::getMeList(), vpLine::getRho(), vpLine::getTheta(), vpImage< Type >::getWidth(), vpMbtMeLine::imax, vpMbtMeLine::imin, isvisible, vpMbtMeLine::jmax, vpMbtMeLine::jmin, line, meline, nbFeature, p1, p2, vpLine::projection(), Reinit, vpMbtPolygon::roiPointsClip, and vpMbtMeLine::updateParameters().
Referenced by vpMbEdgeTracker::updateMovingEdge().
vpColVector vpMbtDistanceLine::error |
The error vector.
Definition at line 94 of file vpMbtDistanceLine.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), and vpMbEdgeKltTracker::trackSecondLoop().
vpMbHiddenFaces<vpMbtPolygon>* vpMbtDistanceLine::hiddenface |
Pointer to the list of faces.
Definition at line 100 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), vpMbEdgeTracker::computeVVS(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbtDistanceLine().
bool vpMbtDistanceLine::isvisible |
Indicates if the line is visible or not.
Definition at line 104 of file vpMbtDistanceLine.h.
Referenced by closeToImageBorder(), computeInteractionMatrixError(), display(), initInteractionMatrixError(), initMovingEdge(), trackMovingEdge(), updateMovingEdge(), and vpMbtDistanceLine().
vpMatrix vpMbtDistanceLine::L |
The interaction matrix.
Definition at line 92 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVS(), and vpMbEdgeKltTracker::trackSecondLoop().
std::list<int> vpMbtDistanceLine::Lindex_polygon |
Index of the faces which contain the line.
Definition at line 102 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), vpMbEdgeTracker::computeVVS(), vpMbEdgeTracker::initMovingEdge(), and vpMbEdgeKltTracker::trackFirstLoop().
vpLine* vpMbtDistanceLine::line |
The 3D line.
Definition at line 86 of file vpMbtDistanceLine.h.
Referenced by buildFrom(), computeInteractionMatrixError(), initMovingEdge(), updateMovingEdge(), vpMbtDistanceLine(), and ~vpMbtDistanceLine().
vpMbtMeLine* vpMbtDistanceLine::meline |
The moving edge container.
Definition at line 84 of file vpMbtDistanceLine.h.
Referenced by closeToImageBorder(), computeInteractionMatrixError(), vpMbEdgeTracker::computeVVS(), displayMovingEdges(), vpMbEdgeTracker::getNbPoints(), initInteractionMatrixError(), initMovingEdge(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), setMovingEdge(), vpMbEdgeKltTracker::setPose(), vpMbEdgeTracker::setPose(), vpMbEdgeTracker::testTracking(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeTracker::trackMovingEdge(), updateMovingEdge(), vpMbtDistanceLine(), and ~vpMbtDistanceLine().
unsigned int vpMbtDistanceLine::nbFeature |
The number of moving edges.
Definition at line 96 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVS(), initInteractionMatrixError(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeKltTracker::postTrackingMbt(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeKltTracker::trackSecondLoop(), updateMovingEdge(), vpMbEdgeTracker::updateMovingEdge(), and vpMbtDistanceLine().
vpPoint* vpMbtDistanceLine::p1 |
The first extremity.
Definition at line 88 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), buildFrom(), display(), initMovingEdge(), updateMovingEdge(), and vpMbtDistanceLine().
vpPoint* vpMbtDistanceLine::p2 |
The second extremity.
Definition at line 90 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), buildFrom(), display(), initMovingEdge(), updateMovingEdge(), and vpMbtDistanceLine().
bool vpMbtDistanceLine::Reinit |
Indicates if the line has to be reinitialized.
Definition at line 98 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), vpMbEdgeTracker::reinitMovingEdge(), trackMovingEdge(), updateMovingEdge(), vpMbEdgeTracker::updateMovingEdge(), and vpMbtDistanceLine().