ViSP
2.7.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) |
unsigned int | getIndex () |
double | getMeanWeight () const |
std::string | getName () const |
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 | ( | ) |
Build a vpMbtDistanceLine thanks to two points corresponding to the extremities.
_p1 | : The first extremity. |
_p2 | : The second extremity. |
Definition at line 172 of file vpMbtDistanceLine.cpp.
References vpColVector::cross(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), line, p1, p2, 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 571 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 512 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 422 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), vpPoint::get_x(), vpPoint::get_y(), isvisible, p1, p2, and vpPoint::projection().
Referenced by 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 453 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), vpPoint::get_x(), vpPoint::get_y(), isvisible, p1, p2, and vpPoint::projection().
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 484 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 122 of file vpMbtDistanceLine.h.
|
inline |
Get the index of the line.
Definition at line 129 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 137 of file vpMbtDistanceLine.h.
|
inline |
Get the name of the line.
Definition at line 144 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::removeLine().
void vpMbtDistanceLine::initInteractionMatrixError | ( | ) |
Initialize the size of the interaction matrix and the error vector.
Definition at line 496 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 249 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpLine::changeFrame(), vpMeterPixelConversion::convertLine(), vpMeterPixelConversion::convertPoint(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpPoint::get_x(), vpPoint::get_y(), vpLine::getRho(), vpLine::getTheta(), vpMbtMeLine::imax, vpMbtMeLine::imin, vpMbtMeLine::initTracking(), isvisible, vpMbtMeLine::jmax, vpMbtMeLine::jmin, line, meline, p1, p2, vpPoint::projection(), vpLine::projection(), 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 155 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 400 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 163 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the index of the line.
i | : The index number |
Definition at line 170 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 177 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 231 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 186 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine().
|
inline |
Set the name of the line.
name | : The name of the line. |
Definition at line 193 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 200 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 306 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 348 of file vpMbtDistanceLine.cpp.
References vpPoint::changeFrame(), vpLine::changeFrame(), vpMeterPixelConversion::convertLine(), vpMeterPixelConversion::convertPoint(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpPoint::get_x(), vpPoint::get_y(), vpMeTracker::getMeList(), vpLine::getRho(), vpLine::getTheta(), vpMbtMeLine::imax, vpMbtMeLine::imin, isvisible, vpMbtMeLine::jmax, vpMbtMeLine::jmin, line, meline, nbFeature, p1, p2, vpPoint::projection(), vpLine::projection(), Reinit, and vpMbtMeLine::updateParameters().
Referenced by vpMbEdgeTracker::updateMovingEdge().
vpColVector vpMbtDistanceLine::error |
The error vector.
Definition at line 92 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 98 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 102 of file vpMbtDistanceLine.h.
Referenced by closeToImageBorder(), computeInteractionMatrixError(), display(), initInteractionMatrixError(), initMovingEdge(), trackMovingEdge(), updateMovingEdge(), and vpMbtDistanceLine().
vpMatrix vpMbtDistanceLine::L |
The interaction matrix.
Definition at line 90 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 100 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), vpMbEdgeTracker::computeVVS(), vpMbEdgeTracker::initMovingEdge(), and vpMbEdgeKltTracker::trackFirstLoop().
vpLine* vpMbtDistanceLine::line |
The 3D line.
Definition at line 84 of file vpMbtDistanceLine.h.
Referenced by buildFrom(), computeInteractionMatrixError(), initMovingEdge(), updateMovingEdge(), vpMbtDistanceLine(), and ~vpMbtDistanceLine().
vpMbtMeLine* vpMbtDistanceLine::meline |
The moving edge container.
Definition at line 82 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 94 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 86 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), buildFrom(), display(), initMovingEdge(), updateMovingEdge(), vpMbtDistanceLine(), and ~vpMbtDistanceLine().
vpPoint* vpMbtDistanceLine::p2 |
The second extremity.
Definition at line 88 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::addLine(), buildFrom(), display(), initMovingEdge(), updateMovingEdge(), vpMbtDistanceLine(), and ~vpMbtDistanceLine().
bool vpMbtDistanceLine::Reinit |
Indicates if the line has to be reinitialized.
Definition at line 96 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVS(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), vpMbEdgeTracker::reinitMovingEdge(), trackMovingEdge(), updateMovingEdge(), vpMbEdgeTracker::updateMovingEdge(), and vpMbtDistanceLine().