ViSP
2.10.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 &camera) const |
unsigned int | getIndex () const |
double | getMeanWeight () const |
std::string | getName () const |
vpMbtPolygon & | getPolygon () |
void | initInteractionMatrixError () |
bool | 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 &camera) |
void | setIndex (const unsigned int i) |
void | setMeanWeight (const double w_mean) |
void | setMovingEdge (vpMe *Me) |
void | setName (const std::string line_name) |
void | setName (const char *line_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 62 of file vpMbtDistanceLine.cpp.
vpMbtDistanceLine::~vpMbtDistanceLine | ( | ) |
Basic destructor useful to deallocate the memory.
Definition at line 73 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 166 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 612 of file vpMbtDistanceLine.cpp.
References vpImage< Type >::getHeight(), 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 553 of file vpMbtDistanceLine.cpp.
References vpLine::changeFrame(), vpFeatureBuilder::create(), error, vpCameraParameters::get_px(), vpCameraParameters::get_py(), vpCameraParameters::get_u0(), vpCameraParameters::get_v0(), 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 & | camera, | ||
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. |
camera | : 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 442 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::display | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | camera, | ||
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. |
camera | : 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 483 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 525 of file vpMbtDistanceLine.cpp.
References meline.
Referenced by vpMbEdgeKltTracker::postTracking(), and vpMbEdgeTracker::track().
|
inline |
Get the camera paramters.
camera | : 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 537 of file vpMbtDistanceLine.cpp.
References error, isvisible, meline, nbFeature, and vpColVector::resize().
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::initMbtTracking(), and vpMbEdgeTracker::track().
bool 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 246 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(), isvisible, line, meline, p1, p2, vpLine::projection(), and vpMbtPolygon::roiPointsClip.
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 419 of file vpMbtDistanceLine.cpp.
References initMovingEdge(), meline, and Reinit.
Referenced by vpMbEdgeTracker::reInitLevel(), and vpMbEdgeTracker::reinitMovingEdge().
|
inline |
Set the camera paramters.
camera | : 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.
w_mean | : 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 226 of file vpMbtDistanceLine.cpp.
References meline.
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the name of the line.
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.
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 314 of file vpMbtDistanceLine.cpp.
References isvisible, meline, nbFeature, and Reinit.
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 357 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(), isvisible, line, meline, nbFeature, p1, p2, vpLine::projection(), Reinit, and vpMbtPolygon::roiPointsClip.
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(), and vpMbEdgeKltTracker::trackFirstLoop().
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(), and updateMovingEdge().
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(), 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(), vpMbEdgeTracker::testTracking(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeTracker::trackMovingEdge(), updateMovingEdge(), 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(), and vpMbEdgeTracker::updateMovingEdge().
vpPoint* vpMbtDistanceLine::p1 |
The first extremity.
Definition at line 88 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), buildFrom(), display(), initMovingEdge(), and updateMovingEdge().
vpPoint* vpMbtDistanceLine::p2 |
The second extremity.
Definition at line 90 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), buildFrom(), display(), initMovingEdge(), and updateMovingEdge().
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(), and vpMbEdgeTracker::updateMovingEdge().