ViSP  2.7.0
vpMbtDistanceLine Class Reference

#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

vpMbtMeLinemeline
 
vpLineline
 
vpPointp1
 
vpPointp2
 
vpMatrix L
 
vpColVector error
 
unsigned int nbFeature
 
bool Reinit
 
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
 
std::list< int > Lindex_polygon
 
bool isvisible
 

Detailed Description

Manage the line of a polygon used in the model-based tracker.

Definition at line 69 of file vpMbtDistanceLine.h.

Constructor & Destructor Documentation

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.

References line, meline, p1, and p2.

Member Function Documentation

void vpMbtDistanceLine::buildFrom ( vpPoint _p1,
vpPoint _p2 
)

Build a vpMbtDistanceLine thanks to two points corresponding to the extremities.

Parameters
_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)

Parameters
I: the input image (to know its size)
threshold: the threshold in pixel
Returns
true if the line is near the border of the image

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::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.

Parameters
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.

Parameters
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.

  • If green : The vpMeSite is a good point.
  • If blue : The point is removed because of the vpMeSite tracking phase (constrast problem).
  • If purple : The point is removed because of the vpMeSite tracking phase (threshold problem).
  • If blue : The point is removed because of the robust method in the virtual visual servoing.
Parameters
I: The image.

Definition at line 484 of file vpMbtDistanceLine.cpp.

References vpMbtMeLine::display(), and meline.

Referenced by vpMbEdgeKltTracker::postTracking(), and vpMbEdgeTracker::track().

void vpMbtDistanceLine::getCameraParameters ( vpCameraParameters cam)
inline

Get the camera paramters.

Parameters
cam: The vpCameraParameters used to store the camera parameters.

Definition at line 122 of file vpMbtDistanceLine.h.

unsigned int vpMbtDistanceLine::getIndex ( )
inline

Get the index of the line.

Returns
Return the index of the line.

Definition at line 129 of file vpMbtDistanceLine.h.

double vpMbtDistanceLine::getMeanWeight ( ) const
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.

Returns
The mean weight of the line.

Definition at line 137 of file vpMbtDistanceLine.h.

std::string vpMbtDistanceLine::getName ( ) const
inline

Get the name of the line.

Returns
Return 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 
)
bool vpMbtDistanceLine::isVisible ( ) const
inline
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.

Parameters
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().

void vpMbtDistanceLine::setCameraParameters ( const vpCameraParameters cam)
inline

Set the camera paramters.

Parameters
cam: The camera parameters.

Definition at line 163 of file vpMbtDistanceLine.h.

Referenced by vpMbEdgeTracker::addLine().

void vpMbtDistanceLine::setIndex ( const unsigned int  i)
inline

Set the index of the line.

Parameters
i: The index number

Definition at line 170 of file vpMbtDistanceLine.h.

Referenced by vpMbEdgeTracker::addLine().

void vpMbtDistanceLine::setMeanWeight ( const double  wmean)
inline

Set the mean weight of the line.

Parameters
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.

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().

void vpMbtDistanceLine::setName ( const std::string  name)
inline

Set the name of the line.

Parameters
name: The name of the line.

Definition at line 186 of file vpMbtDistanceLine.h.

Referenced by vpMbEdgeTracker::addLine().

void vpMbtDistanceLine::setName ( const char *  name)
inline

Set the name of the line.

Parameters
name: The name of the line.

Definition at line 193 of file vpMbtDistanceLine.h.

void vpMbtDistanceLine::setVisible ( bool  _isvisible)
inline

Set a boolean parameter to indicates if the line is visible in the image or not.

Parameters
_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.

Parameters
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().

Member Data Documentation

bool vpMbtDistanceLine::isvisible
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
vpPoint* vpMbtDistanceLine::p1
vpPoint* vpMbtDistanceLine::p2