![]() |
Visual Servoing Platform
version 3.3.0
|
#include <vpMbtDistanceLine.h>
Public Member Functions | |
vpMbtDistanceLine () | |
virtual | ~vpMbtDistanceLine () |
void | addPolygon (const int &index) |
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, unsigned int thickness=1, bool displayFullModel=false) |
void | display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false) |
void | displayMovingEdges (const vpImage< unsigned char > &I) |
void | displayMovingEdges (const vpImage< vpRGBa > &I) |
void | getCameraParameters (vpCameraParameters &camera) const |
unsigned int | getIndex () const |
double | getMeanWeight () const |
std::vector< std::vector< double > > | getFeaturesForDisplay () |
std::vector< std::vector< double > > | getModelForDisplay (unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, bool displayFullModel=false) |
std::string | getName () const |
vpMbtPolygon & | getPolygon () |
void | initInteractionMatrixError () |
bool | initMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, bool doNotTrack, const vpImage< bool > *mask=NULL) |
bool | isTracked () const |
bool | isVisible () const |
void | reinitMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpImage< bool > *mask=NULL) |
void | setCameraParameters (const vpCameraParameters &camera) |
void | setIndex (unsigned int i) |
void | setMeanWeight (double w_mean) |
void | setMovingEdge (vpMe *Me) |
void | setName (const std::string &line_name) |
void | setName (const char *line_name) |
void | setTracked (const std::string &name, const bool &track) |
void | setVisible (bool _isvisible) |
void | trackMovingEdge (const vpImage< unsigned char > &I) |
void | updateMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | updateTracked () |
Public Attributes | |
bool | useScanLine |
std::vector< vpMbtMeLine * > | meline |
vpLine * | line |
vpPoint * | p1 |
vpPoint * | p2 |
vpMatrix | L |
vpColVector | error |
std::vector< unsigned int > | nbFeature |
unsigned int | nbFeatureTotal |
bool | Reinit |
vpMbHiddenFaces< vpMbtPolygon > * | hiddenface |
std::list< int > | Lindex_polygon |
std::vector< bool > | Lindex_polygon_tracked |
bool | isvisible |
Manage the line of a polygon used in the model-based tracker.
Definition at line 65 of file vpMbtDistanceLine.h.
vpMbtDistanceLine::vpMbtDistanceLine | ( | ) |
Basic constructor
Definition at line 58 of file vpMbtDistanceLine.cpp.
|
virtual |
Basic destructor useful to deallocate the memory.
Definition at line 68 of file vpMbtDistanceLine.cpp.
void vpMbtDistanceLine::addPolygon | ( | const int & | idx | ) |
Add a polygon to the list of polygons the line belongs to.
idx | : Index of the polygon |
Definition at line 215 of file vpMbtDistanceLine.cpp.
Referenced by vpMbTracker::addProjectionErrorLine().
Build a vpMbtDistanceLine thanks to two points corresponding to the extremities.
_p1 | : The first extremity. |
_p2 | : The second extremity. |
Definition at line 165 of file vpMbtDistanceLine.cpp.
Referenced by vpMbTracker::addProjectionErrorLine().
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 887 of file vpMbtDistanceLine.cpp.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), and vpMbEdgeKltTracker::trackFirstLoop().
void vpMbtDistanceLine::computeInteractionMatrixError | ( | const vpHomogeneousMatrix & | cMo | ) |
Compute the interaction matrix and the error vector corresponding to the line.
Definition at line 812 of file vpMbtDistanceLine.cpp.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMbEdgeTracker::computeVVSInteractionMatrixAndResidu(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbEdgeKltTracker::trackSecondLoop().
void vpMbtDistanceLine::display | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | camera, | ||
const vpColor & | col, | ||
unsigned int | thickness = 1 , |
||
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 612 of file vpMbtDistanceLine.cpp.
void vpMbtDistanceLine::display | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | camera, | ||
const vpColor & | col, | ||
unsigned int | thickness = 1 , |
||
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 637 of file vpMbtDistanceLine.cpp.
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 665 of file vpMbtDistanceLine.cpp.
Definition at line 674 of file vpMbtDistanceLine.cpp.
References meline.
|
inline |
Get the camera paramters.
camera | : The vpCameraParameters used to store the camera parameters. |
Definition at line 154 of file vpMbtDistanceLine.h.
std::vector< std::vector< double > > vpMbtDistanceLine::getFeaturesForDisplay | ( | ) |
Return a list of features parameters for display.
<feature id (here 0 for ME)>
, <pt.i()>
, <pt.j()>
, <state>
Definition at line 687 of file vpMbtDistanceLine.cpp.
Referenced by vpMbEdgeTracker::getFeaturesForDisplayEdge().
|
inline |
Get the index of the line.
Definition at line 161 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 170 of file vpMbtDistanceLine.h.
std::vector< std::vector< double > > vpMbtDistanceLine::getModelForDisplay | ( | unsigned int | width, |
unsigned int | height, | ||
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | camera, | ||
bool | displayFullModel = false |
||
) |
Return a list of line parameters to display the primitive at a given pose and camera parameters.
<primitive id (here 0 for line)>
, <pt_start.i()>
, <pt_start.j()>
, <pt_end.i()>
, <pt_end.j()>
width | : Image width. |
height | : Image height. |
cMo | : Pose used to project the 3D model into the image. |
camera | : The camera parameters. |
displayFullModel | : If true, the line is displayed even if it is not |
Definition at line 727 of file vpMbtDistanceLine.cpp.
|
inline |
Get the name of the line.
Definition at line 184 of file vpMbtDistanceLine.h.
|
inline |
Get the polygon associated to the line.
Definition at line 191 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine().
void vpMbtDistanceLine::initInteractionMatrixError | ( | ) |
Initialize the size of the interaction matrix and the error vector.
Definition at line 792 of file vpMbtDistanceLine.cpp.
Referenced by vpMbEdgeKltTracker::initMbtTracking(), and vpMbEdgeTracker::initMbtTracking().
bool vpMbtDistanceLine::initMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
bool | doNotTrack, | ||
const vpImage< bool > * | mask = NULL |
||
) |
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. |
doNotTrack | : If true, ME are not tracked. |
mask | Mask image or NULL if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false. |
Definition at line 306 of file vpMbtDistanceLine.cpp.
Referenced by vpMbTracker::projectionErrorInitMovingEdge().
|
inline |
Return if the line is used for tracking.
Definition at line 203 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbEdgeTracker::getFeaturesForDisplayEdge(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeTracker::initMbtTracking(), and vpMbTracker::projectionErrorInitMovingEdge().
|
inline |
Check if the line is visible in the image or not.
Definition at line 210 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), and vpMbEdgeTracker::getFeaturesForDisplayEdge().
void vpMbtDistanceLine::reinitMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpImage< bool > * | mask = NULL |
||
) |
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. |
mask | Mask image or NULL if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false. |
Definition at line 584 of file vpMbtDistanceLine.cpp.
|
inline |
Set the camera paramters.
camera | : The camera parameters. |
Definition at line 219 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine(), and vpMbTracker::computeProjectionErrorImpl().
|
inline |
Set the index of the line.
i | : The index number |
Definition at line 226 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine().
|
inline |
Set the mean weight of the line.
w_mean | : The mean weight of the line. |
Definition at line 233 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::updateMovingEdgeWeights().
void vpMbtDistanceLine::setMovingEdge | ( | vpMe * | _me | ) |
Set the moving edge parameters.
_me | : an instance of vpMe containing all the desired parameters |
Definition at line 281 of file vpMbtDistanceLine.cpp.
Referenced by vpMbTracker::addProjectionErrorLine().
|
inline |
Set the name of the line.
line_name | : The name of the line. |
Definition at line 249 of file vpMbtDistanceLine.h.
|
inline |
Set the name of the line.
line_name | : The name of the line. |
Definition at line 242 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine().
void vpMbtDistanceLine::setTracked | ( | const std::string & | polyname, |
const bool & | track | ||
) |
Set if the line has to considered during tracking phase. Line won't be considered if all of its polygons are desactivated.
polyname | : name of the polygons that have to be modified. |
track | : True if the polygon has to be tracked, False otherwise. |
Definition at line 228 of file vpMbtDistanceLine.cpp.
|
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 259 of file vpMbtDistanceLine.h.
Referenced by vpMbtFaceDepthDense::computeVisibilityDisplay(), vpMbtFaceDepthNormal::computeVisibilityDisplay(), and vpMbTracker::projectionErrorInitMovingEdge().
void vpMbtDistanceLine::trackMovingEdge | ( | const vpImage< unsigned char > & | I | ) |
Track the moving edges in the image.
I | : the image. |
Definition at line 420 of file vpMbtDistanceLine.cpp.
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 452 of file vpMbtDistanceLine.cpp.
void vpMbtDistanceLine::updateTracked | ( | ) |
Update the boolean specifying if the line has to be tracked. It takes into account the desactivated polygons and the visibility of the others.
Definition at line 258 of file vpMbtDistanceLine.cpp.
Referenced by vpMbTracker::projectionErrorInitMovingEdge().
vpColVector vpMbtDistanceLine::error |
The error vector.
Definition at line 94 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSInteractionMatrixAndResidu(), and vpMbEdgeKltTracker::trackSecondLoop().
vpMbHiddenFaces<vpMbtPolygon>* vpMbtDistanceLine::hiddenface |
Pointer to the list of faces.
Definition at line 103 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine(), vpMbtFaceDepthDense::computeVisibilityDisplay(), vpMbtFaceDepthNormal::computeVisibilityDisplay(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMbTracker::projectionErrorInitMovingEdge(), and vpMbEdgeKltTracker::trackFirstLoop().
bool vpMbtDistanceLine::isvisible |
Indicates if the line is visible or not.
Definition at line 110 of file vpMbtDistanceLine.h.
vpMatrix vpMbtDistanceLine::L |
The interaction matrix.
Definition at line 92 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSInteractionMatrixAndResidu(), and vpMbEdgeKltTracker::trackSecondLoop().
std::list<int> vpMbtDistanceLine::Lindex_polygon |
Index of the faces which contain the line.
Definition at line 105 of file vpMbtDistanceLine.h.
Referenced by vpMbtFaceDepthDense::computeVisibilityDisplay(), vpMbtFaceDepthNormal::computeVisibilityDisplay(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMbTracker::projectionErrorInitMovingEdge(), and vpMbEdgeKltTracker::trackFirstLoop().
std::vector<bool> vpMbtDistanceLine::Lindex_polygon_tracked |
Vector of bool associated with Lindex_polygon to know if Lindex_polygon[i] is tracked
Definition at line 108 of file vpMbtDistanceLine.h.
vpLine* vpMbtDistanceLine::line |
The 3D line.
Definition at line 86 of file vpMbtDistanceLine.h.
std::vector<vpMbtMeLine *> vpMbtDistanceLine::meline |
The moving edge container.
Definition at line 84 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), displayMovingEdges(), vpMbTracker::projectionErrorInitMovingEdge(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbEdgeTracker::updateMovingEdgeWeights().
std::vector<unsigned int> vpMbtDistanceLine::nbFeature |
The number of moving edges.
Definition at line 97 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMbTracker::projectionErrorInitMovingEdge(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbEdgeTracker::updateMovingEdgeWeights().
unsigned int vpMbtDistanceLine::nbFeatureTotal |
The number of moving edges.
Definition at line 99 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSInteractionMatrixAndResidu(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeTracker::initMbtTracking(), vpMbTracker::projectionErrorInitMovingEdge(), vpMbEdgeKltTracker::trackSecondLoop(), and vpMbEdgeTracker::updateMovingEdgeWeights().
vpPoint* vpMbtDistanceLine::p1 |
The first extremity.
Definition at line 88 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine().
vpPoint* vpMbtDistanceLine::p2 |
The second extremity.
Definition at line 90 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine().
bool vpMbtDistanceLine::Reinit |
Indicates if the line has to be reinitialized.
Definition at line 101 of file vpMbtDistanceLine.h.
Referenced by vpMbEdgeTracker::updateMovingEdgeWeights().
bool vpMbtDistanceLine::useScanLine |
Use scanline rendering.
Definition at line 81 of file vpMbtDistanceLine.h.
Referenced by vpMbTracker::addProjectionErrorLine().