Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpMbtDistanceCylinder Class Reference

#include <vpMbtDistanceCylinder.h>

Public Member Functions

 vpMbtDistanceCylinder (const vpMbtDistanceCylinder &)=delete
vpMbtDistanceCylinderoperator= (const vpMbtDistanceCylinder &)=delete
 vpMbtDistanceCylinder ()
virtual ~vpMbtDistanceCylinder ()
void buildFrom (const vpPoint &_p1, const vpPoint &_p2, double r)
void computeInteractionMatrixError (const vpHomogeneousMatrix &cMo, const vpImage< unsigned char > &I)
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)
unsigned int getIndex ()
double getMeanWeight1 () const
double getMeanWeight2 () 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
void initInteractionMatrixError ()
bool initMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, bool doNotTrack, const vpImage< bool > *mask=nullptr, const int &initRange=0)
bool isTracked () const
bool isVisible () const
void reinitMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpImage< bool > *mask=nullptr)
void setCameraParameters (const vpCameraParameters &camera)
void setTracked (const bool &track)
void setIndex (unsigned int i)
void setMeanWeight1 (double wmean)
void setMeanWeight2 (double wmean)
void setMovingEdge (vpMe *Me)
void setName (const std::string &cyl_name)
void setName (const char *cyl_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 * meline1
vpMbtMeLine * meline2
vpCirclecercle1
vpCirclecercle2
double radius
vpPointp1
vpPointp2
vpMatrix L
vpColVector error
unsigned int nbFeature
unsigned int nbFeaturel1
unsigned int nbFeaturel2
bool Reinit
vpCylinderc
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
int index_polygon
bool isvisible

Detailed Description

Constructor & Destructor Documentation

◆ vpMbtDistanceCylinder() [1/2]

vpMbtDistanceCylinder::vpMbtDistanceCylinder ( const vpMbtDistanceCylinder & )
delete

◆ vpMbtDistanceCylinder() [2/2]

vpMbtDistanceCylinder::vpMbtDistanceCylinder ( )

Basic constructor

Definition at line 65 of file vpMbtDistanceCylinder.cpp.

References c, cercle1, cercle2, error, hiddenface, index_polygon, isvisible, L, meline1, meline2, nbFeature, nbFeaturel1, nbFeaturel2, p1, p2, radius, and Reinit.

◆ ~vpMbtDistanceCylinder()

vpMbtDistanceCylinder::~vpMbtDistanceCylinder ( )
virtual

Basic destructor useful to deallocate the memory.

Definition at line 75 of file vpMbtDistanceCylinder.cpp.

References c, cercle1, cercle2, meline1, meline2, p1, and p2.

Member Function Documentation

◆ buildFrom()

void vpMbtDistanceCylinder::buildFrom ( const vpPoint & _p1,
const vpPoint & _p2,
double r )

Build a vpMbtDistanceCylinder thanks to two points corresponding to the extremities of its axis and its radius.

Parameters
_p1: The first extremity on the axis.
_p2: The second extremity on the axis.
r: Radius of the cylinder.

Definition at line 117 of file vpMbtDistanceCylinder.cpp.

References c, cercle1, cercle2, vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), p1, p2, and radius.

Referenced by vpMbEdgeTracker::addCylinder(), vpMbTracker::addProjectionErrorCylinder(), and operator=().

◆ computeInteractionMatrixError()

◆ display() [1/2]

void vpMbtDistanceCylinder::display ( const vpImage< unsigned char > & I,
const vpHomogeneousMatrix & cMo,
const vpCameraParameters & camera,
const vpColor & col,
unsigned int thickness = 1,
bool displayFullModel = false )

Display the cylinder. The 3D cylinder 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 lines.
displayFullModel: When true, display the circle even if non visible.

Definition at line 552 of file vpMbtDistanceCylinder.cpp.

References vpDisplay::displayLine(), and getModelForDisplay().

Referenced by operator=().

◆ display() [2/2]

void vpMbtDistanceCylinder::display ( const vpImage< vpRGBa > & I,
const vpHomogeneousMatrix & cMo,
const vpCameraParameters & camera,
const vpColor & col,
unsigned int thickness = 1,
bool displayFullModel = false )

Display the cylinder. The 3D cylinder 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 lines.
displayFullModel: When true, display the circle even if non visible.

Definition at line 577 of file vpMbtDistanceCylinder.cpp.

References vpDisplay::displayLine(), and getModelForDisplay().

◆ displayMovingEdges() [1/2]

void vpMbtDistanceCylinder::displayMovingEdges ( const vpImage< unsigned char > & I)

Enable to display the points along the lines 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 (contrast 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 760 of file vpMbtDistanceCylinder.cpp.

References meline1, and meline2.

Referenced by operator=(), vpMbEdgeKltTracker::postTracking(), and vpMbEdgeKltTracker::postTracking().

◆ displayMovingEdges() [2/2]

void vpMbtDistanceCylinder::displayMovingEdges ( const vpImage< vpRGBa > & I)

Definition at line 770 of file vpMbtDistanceCylinder.cpp.

References meline1, and meline2.

◆ getCameraParameters()

void vpMbtDistanceCylinder::getCameraParameters ( vpCameraParameters & camera)
inline

Get the camera parameters.

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

Definition at line 174 of file vpMbtDistanceCylinder.h.

◆ getFeaturesForDisplay()

std::vector< std::vector< double > > vpMbtDistanceCylinder::getFeaturesForDisplay ( )

Return a list of features parameters for display.

  • Parameters are: <feature id (here 0 for ME)>, <pt.i()>, <pt.j()>, <state>

Definition at line 596 of file vpMbtDistanceCylinder.cpp.

References vpMeSite::get_ifloat(), vpMeSite::get_jfloat(), vpMeSite::getState(), meline1, and meline2.

Referenced by vpMbEdgeTracker::getFeaturesForDisplayEdge().

◆ getIndex()

unsigned int vpMbtDistanceCylinder::getIndex ( )
inline

Get the index of the cylinder.

Returns
Return the index of the line.

Definition at line 181 of file vpMbtDistanceCylinder.h.

◆ getMeanWeight1()

double vpMbtDistanceCylinder::getMeanWeight1 ( ) const
inline

Get the mean weight of the first 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 first line.

Definition at line 190 of file vpMbtDistanceCylinder.h.

◆ getMeanWeight2()

double vpMbtDistanceCylinder::getMeanWeight2 ( ) const
inline

Get the mean weight of the second 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 second line.

Definition at line 199 of file vpMbtDistanceCylinder.h.

◆ getModelForDisplay()

std::vector< std::vector< double > > vpMbtDistanceCylinder::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.

  • Parameters are: <primitive id (here 0 for line)>, <pt_start.i()>, <pt_start.j()>, <pt_end.i()>, <pt_end.j()>
Parameters
width: Image width (unused parameter).
height: Image height (unused parameter).
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 656 of file vpMbtDistanceCylinder.cpp.

References c, cercle1, cercle2, vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), isvisible, p1, p2, and vpImagePoint::set_ij().

Referenced by display(), and display().

◆ getName()

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

Get the name of the cylinder.

Returns
Return the name of the cylinder
Examples
catchGenericTrackerCAOParsing.cpp.

Definition at line 212 of file vpMbtDistanceCylinder.h.

Referenced by vpMbEdgeTracker::removeCylinder().

◆ initInteractionMatrixError()

void vpMbtDistanceCylinder::initInteractionMatrixError ( )

Initialize the size of the interaction matrix and the error vector.

Definition at line 783 of file vpMbtDistanceCylinder.cpp.

References error, isvisible, L, meline1, meline2, nbFeature, nbFeaturel1, and nbFeaturel2.

Referenced by vpMbEdgeKltTracker::initMbtTracking(), and vpMbEdgeTracker::initMbtTracking().

◆ initMovingEdge()

bool vpMbtDistanceCylinder::initMovingEdge ( const vpImage< unsigned char > & I,
const vpHomogeneousMatrix & cMo,
bool doNotTrack,
const vpImage< bool > * mask = nullptr,
const int & initRange = 0 )

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

Parameters
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 nullptr if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false.
initRangeThe range of the ME used during the initialization.
Returns
false if an error occur, true otherwise.

Definition at line 184 of file vpMbtDistanceCylinder.cpp.

References c, cercle1, cercle2, vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), isvisible, meline1, meline2, p1, p2, and vpImagePoint::set_ij().

Referenced by vpMbEdgeTracker::initMovingEdge(), vpMbTracker::projectionErrorInitMovingEdge(), reinitMovingEdge(), and vpMbEdgeTracker::trackMovingEdge().

◆ isTracked()

◆ isVisible()

bool vpMbtDistanceCylinder::isVisible ( ) const
inline

◆ operator=()

◆ reinitMovingEdge()

void vpMbtDistanceCylinder::reinitMovingEdge ( const vpImage< unsigned char > & I,
const vpHomogeneousMatrix & cMo,
const vpImage< bool > * mask = nullptr )

Reinitialize the cylinder if it is required.

A line is reinitialized if the 2D lines do not match enough with the projected 3D lines.

Parameters
I: the image.
cMo: The pose of the camera.
mask: Mask image or nullptr if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false.

Definition at line 525 of file vpMbtDistanceCylinder.cpp.

References initMovingEdge(), meline1, meline2, and Reinit.

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

◆ setCameraParameters()

void vpMbtDistanceCylinder::setCameraParameters ( const vpCameraParameters & camera)
inline

Set the camera parameters.

Parameters
camera: The camera parameters.

Definition at line 240 of file vpMbtDistanceCylinder.h.

Referenced by vpMbEdgeTracker::addCylinder(), vpMbTracker::addProjectionErrorCylinder(), and vpMbTracker::computeProjectionErrorImpl().

◆ setIndex()

void vpMbtDistanceCylinder::setIndex ( unsigned int i)
inline

Set the index of the cylinder.

Parameters
i: The index number

Definition at line 254 of file vpMbtDistanceCylinder.h.

Referenced by vpMbEdgeTracker::addCylinder(), and vpMbTracker::addProjectionErrorCylinder().

◆ setMeanWeight1()

void vpMbtDistanceCylinder::setMeanWeight1 ( double wmean)
inline

Set the mean weight of the first line.

Parameters
wmean: The mean weight of the first line.

Definition at line 261 of file vpMbtDistanceCylinder.h.

Referenced by vpMbEdgeKltTracker::postTrackingMbt(), and vpMbEdgeTracker::updateMovingEdgeWeights().

◆ setMeanWeight2()

void vpMbtDistanceCylinder::setMeanWeight2 ( double wmean)
inline

Set the mean weight of the second line.

Parameters
wmean: The mean weight of the second line.

Definition at line 268 of file vpMbtDistanceCylinder.h.

Referenced by vpMbEdgeKltTracker::postTrackingMbt(), and vpMbEdgeTracker::updateMovingEdgeWeights().

◆ setMovingEdge()

void vpMbtDistanceCylinder::setMovingEdge ( vpMe * _me)

Set the moving edge parameters.

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

Definition at line 160 of file vpMbtDistanceCylinder.cpp.

References meline1, and meline2.

Referenced by vpMbEdgeTracker::addCylinder(), vpMbTracker::addProjectionErrorCylinder(), vpMbEdgeTracker::setMovingEdge(), and vpMbTracker::setProjectionErrorMovingEdge().

◆ setName() [1/2]

void vpMbtDistanceCylinder::setName ( const char * cyl_name)
inline

Set the name of the cylinder.

Parameters
cyl_name: The name of the cylinder

Definition at line 284 of file vpMbtDistanceCylinder.h.

◆ setName() [2/2]

void vpMbtDistanceCylinder::setName ( const std::string & cyl_name)
inline

Set the name of the cylinder.

Parameters
cyl_name: The name of the cylinder.

Definition at line 277 of file vpMbtDistanceCylinder.h.

Referenced by vpMbEdgeTracker::addCylinder(), and vpMbTracker::addProjectionErrorCylinder().

◆ setTracked()

void vpMbtDistanceCylinder::setTracked ( const bool & track)
inline

Set if the cylinder has to considered during tracking phase.

Parameters
track: True if the cylinder has to be tracked, False otherwise.

Definition at line 247 of file vpMbtDistanceCylinder.h.

◆ setVisible()

void vpMbtDistanceCylinder::setVisible ( bool _isvisible)
inline

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

Parameters
_isvisible: Set to true if the cylinder is visible

Definition at line 292 of file vpMbtDistanceCylinder.h.

References isvisible.

Referenced by vpMbEdgeTracker::initMovingEdge(), and vpMbTracker::projectionErrorInitMovingEdge().

◆ trackMovingEdge()

void vpMbtDistanceCylinder::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 (unused).

Definition at line 341 of file vpMbtDistanceCylinder.cpp.

References isvisible, meline1, meline2, nbFeature, nbFeaturel1, nbFeaturel2, and Reinit.

Referenced by vpMbEdgeTracker::trackMovingEdge().

◆ updateMovingEdge()

void vpMbtDistanceCylinder::updateMovingEdge ( const vpImage< unsigned char > & I,
const vpHomogeneousMatrix & cMo )

Update the moving edges internal parameters.

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

Definition at line 378 of file vpMbtDistanceCylinder.cpp.

References c, cercle1, cercle2, vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), isvisible, meline1, meline2, nbFeature, nbFeaturel1, nbFeaturel2, p1, p2, Reinit, and vpImagePoint::set_ij().

Referenced by vpMbEdgeTracker::updateMovingEdge().

Member Data Documentation

◆ c

◆ cercle1

vpCircle* vpMbtDistanceCylinder::cercle1

◆ cercle2

vpCircle* vpMbtDistanceCylinder::cercle2

◆ error

◆ hiddenface

◆ index_polygon

int vpMbtDistanceCylinder::index_polygon

◆ isvisible

bool vpMbtDistanceCylinder::isvisible

◆ L

◆ meline1

◆ meline2

◆ nbFeature

◆ nbFeaturel1

◆ nbFeaturel2

◆ p1

◆ p2

◆ radius

double vpMbtDistanceCylinder::radius

◆ Reinit