ViSP  2.9.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
 
vpMbtPolygongetPolygon ()
 
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 &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

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 62 of file vpMbtDistanceLine.cpp.

vpMbtDistanceLine::~vpMbtDistanceLine ( )

Basic destructor useful to deallocate the memory.

Definition at line 73 of file vpMbtDistanceLine.cpp.

References line, and meline.

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

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

Parameters
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 436 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 camera,
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.
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 477 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.

  • 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 519 of file vpMbtDistanceLine.cpp.

References vpMbtMeLine::display(), and meline.

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

void vpMbtDistanceLine::getCameraParameters ( vpCameraParameters camera) const
inline

Get the camera paramters.

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

Definition at line 124 of file vpMbtDistanceLine.h.

unsigned int vpMbtDistanceLine::getIndex ( ) const
inline

Get the index of the line.

Returns
Return the index of the line.

Definition at line 131 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 139 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 146 of file vpMbtDistanceLine.h.

Referenced by vpMbEdgeTracker::removeLine().

vpMbtPolygon& vpMbtDistanceLine::getPolygon ( )
inline

Get the polygon associated to the line.

Returns
poly.

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

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 414 of file vpMbtDistanceLine.cpp.

References initMovingEdge(), meline, and Reinit.

Referenced by vpMbEdgeTracker::reInitLevel(), and vpMbEdgeTracker::reinitMovingEdge().

void vpMbtDistanceLine::setCameraParameters ( const vpCameraParameters camera)
inline

Set the camera paramters.

Parameters
camera: The camera parameters.

Definition at line 172 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 179 of file vpMbtDistanceLine.h.

Referenced by vpMbEdgeTracker::addLine().

void vpMbtDistanceLine::setMeanWeight ( const double  w_mean)
inline

Set the mean weight of the line.

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

Parameters
_me: an instance of vpMe containing all the desired parameters

Definition at line 226 of file vpMbtDistanceLine.cpp.

References meline, and vpMeTracker::setMe().

Referenced by vpMbEdgeTracker::addLine().

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

Set the name of the line.

Parameters
line_name: The name of the line.

Definition at line 195 of file vpMbtDistanceLine.h.

Referenced by vpMbEdgeTracker::addLine().

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

Set the name of the line.

Parameters
line_name: The name of the line.

Definition at line 202 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 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.

Parameters
I: the image.
cMo: The pose of the camera.

Definition at line 310 of file vpMbtDistanceLine.cpp.

References vpMeTracker::getMeList(), isvisible, meline, nbFeature, Reinit, and vpMbtMeLine::track().

Referenced by vpMbEdgeTracker::trackMovingEdge().

Member Data Documentation

vpMbHiddenFaces<vpMbtPolygon>* vpMbtDistanceLine::hiddenface
bool vpMbtDistanceLine::isvisible
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
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