Visual Servoing Platform
version 3.0.1
|
#include <visp3/mbt/vpMbtDistanceCircle.h>
Public Member Functions | |
vpMbtDistanceCircle () | |
~vpMbtDistanceCircle () | |
void | buildFrom (const vpPoint &_p1, const vpPoint &_p2, const vpPoint &_p3, const double r) |
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) |
unsigned int | getIndex () |
double | getMeanWeight () const |
std::string | getName () const |
void | initInteractionMatrixError () |
bool | initMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
bool | isTracked () const |
bool | isVisible () const |
void | reinitMovingEdge (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo) |
void | setCameraParameters (const vpCameraParameters &camera) |
void | setTracked (const bool &track) |
void | setIndex (const unsigned int i) |
void | setMeanWeight (const double _wmean) |
void | setMovingEdge (vpMe *Me) |
void | setName (const std::string &circle_name) |
void | setName (const char *circle_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 | |
vpMbtMeEllipse * | meEllipse |
vpCircle * | circle |
double | radius |
vpPoint * | p1 |
vpPoint * | p2 |
vpPoint * | p3 |
vpMatrix | L |
vpColVector | error |
unsigned int | nbFeature |
bool | Reinit |
vpMbHiddenFaces< vpMbtPolygon > * | hiddenface |
int | index_polygon |
bool | isvisible |
Manage a circle used in the model-based tracker.
Definition at line 60 of file vpMbtDistanceCircle.h.
vpMbtDistanceCircle::vpMbtDistanceCircle | ( | ) |
Basic constructor
Definition at line 60 of file vpMbtDistanceCircle.cpp.
vpMbtDistanceCircle::~vpMbtDistanceCircle | ( | ) |
void vpMbtDistanceCircle::buildFrom | ( | const vpPoint & | _p1, |
const vpPoint & | _p2, | ||
const vpPoint & | _p3, | ||
const double | r | ||
) |
Build a vpMbtDistanceCircle thanks to its center, 3 points (including the center) with coordinates expressed in the object frame and defining the plane that contain the circle and its radius.
_p1 | : Center of the circle. |
_p2,_p3 | : Two points on the plane containing the circle. With the center of the circle we have 3 points defining the plane that contains the circle. |
r | : Radius of the circle. |
Definition at line 104 of file vpMbtDistanceCircle.cpp.
References circle, vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPlane::getA(), vpPlane::getB(), vpPlane::getC(), vpPlane::object_frame, p1, p2, p3, radius, and vpCircle::setWorldCoordinates().
Referenced by vpMbKltTracker::addCircle(), and vpMbEdgeTracker::addCircle().
void vpMbtDistanceCircle::computeInteractionMatrixError | ( | const vpHomogeneousMatrix & | cMo | ) |
Compute the interaction matrix and the error vector corresponding to the point to ellipse algebraic distance.
Definition at line 380 of file vpMbtDistanceCircle.cpp.
References vpCircle::changeFrame(), circle, vpPixelMeterConversion::convertPoint(), vpFeatureBuilder::create(), error, vpFeatureEllipse::interaction(), isvisible, L, meEllipse, vpTracker::p, vpCircle::projection(), and vpMath::sqr().
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMbEdgeTracker::computeVVSSecondPhase(), vpMbEdgeKltTracker::trackFirstLoop(), and vpMbEdgeKltTracker::trackSecondLoop().
void vpMbtDistanceCircle::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 circle. The 3D circle is projected into the image as an ellipse.
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. If false, display the circle only if visible. |
Definition at line 286 of file vpMbtDistanceCircle.cpp.
References vpCircle::changeFrame(), circle, vpMeterPixelConversion::convertEllipse(), vpDisplay::displayEllipse(), isvisible, and vpCircle::projection().
void vpMbtDistanceCircle::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 cylinder. The 3D cylinder 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 lines. |
displayFullModel | : When true, display the circle even if non visible. If false, display the circle only if visible. |
Definition at line 318 of file vpMbtDistanceCircle.cpp.
References vpCircle::changeFrame(), circle, vpMeterPixelConversion::convertEllipse(), vpDisplay::displayEllipse(), isvisible, and vpCircle::projection().
void vpMbtDistanceCircle::displayMovingEdges | ( | const vpImage< unsigned char > & | I | ) |
Enable to display the points along the ellipse with a color corresponding to their state.
I | : The image. |
Definition at line 350 of file vpMbtDistanceCircle.cpp.
References vpDisplay::flush(), meEllipse, and vpDEBUG_ENABLE.
Referenced by vpMbEdgeTracker::displayFeaturesOnImage(), and vpMbEdgeKltTracker::postTracking().
|
inline |
Get the camera paramters.
camera | : The vpCameraParameters used to store the camera parameters. |
Definition at line 140 of file vpMbtDistanceCircle.h.
|
inline |
Get the index of the circle.
Definition at line 147 of file vpMbtDistanceCircle.h.
|
inline |
Get the mean weight of the circle. 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 155 of file vpMbtDistanceCircle.h.
|
inline |
Get the name of the circle.
Definition at line 162 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::removeCircle().
void vpMbtDistanceCircle::initInteractionMatrixError | ( | ) |
Get the polygon associated to the circle.
Initialize the size of the interaction matrix and the error vector.
Definition at line 364 of file vpMbtDistanceCircle.cpp.
References error, isvisible, L, meEllipse, nbFeature, vpArray2D< Type >::resize(), and vpColVector::resize().
Referenced by vpMbEdgeKltTracker::initMbtTracking(), and vpMbEdgeTracker::initMbtTracking().
bool vpMbtDistanceCircle::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 circle.
I | : The image. |
cMo | : The pose of the camera used to initialize the moving edges. |
Definition at line 150 of file vpMbtDistanceCircle.cpp.
References vpCircle::changeFrame(), circle, vpMeterPixelConversion::convertEllipse(), vpMe::getRange(), isvisible, meEllipse, and vpCircle::projection().
Referenced by vpMbEdgeTracker::initMovingEdge(), reinitMovingEdge(), and vpMbEdgeTracker::trackMovingEdge().
|
inline |
Return if the circle is used for tracking.
Definition at line 179 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::computeProjectionError(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMbEdgeTracker::getNbPoints(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeTracker::initMbtTracking(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::postTracking(), vpMbEdgeTracker::testTracking(), and vpMbEdgeTracker::trackMovingEdge().
|
inline |
Check if the circle is visible in the image or not.
Definition at line 186 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::computeProjectionError(), vpMbEdgeTracker::displayFeaturesOnImage(), vpMbEdgeTracker::getNbPoints(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeTracker::initMbtTracking(), vpMbEdgeKltTracker::postTracking(), vpMbEdgeTracker::reinitMovingEdge(), vpMbEdgeTracker::testTracking(), vpMbEdgeTracker::trackMovingEdge(), and vpMbEdgeTracker::updateMovingEdge().
void vpMbtDistanceCircle::reinitMovingEdge | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo | ||
) |
Reinitialize the circle if it is required.
A circle is reinitialized if the ellipse do not match enough with the projected 3D circle.
I | : the image. |
cMo | : The pose of the camera. |
Definition at line 260 of file vpMbtDistanceCircle.cpp.
References initMovingEdge(), meEllipse, and Reinit.
Referenced by vpMbEdgeTracker::reInitLevel(), and vpMbEdgeTracker::reinitMovingEdge().
|
inline |
Set the camera paramters.
camera | : The camera parameters. |
Definition at line 194 of file vpMbtDistanceCircle.h.
Referenced by vpMbKltTracker::addCircle(), and vpMbEdgeTracker::addCircle().
|
inline |
Set the index of the circle.
i | : The index number |
Definition at line 208 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle().
|
inline |
Set the mean weight of the circle.
_wmean | : The mean weight of the circle. |
Definition at line 215 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeKltTracker::postTrackingMbt(), and vpMbEdgeTracker::updateMovingEdgeWeights().
void vpMbtDistanceCircle::setMovingEdge | ( | vpMe * | _me | ) |
Set the moving edge parameters.
_me | : an instance of vpMe containing all the desired parameters |
Definition at line 132 of file vpMbtDistanceCircle.cpp.
References meEllipse.
Referenced by vpMbEdgeTracker::addCircle(), and vpMbEdgeTracker::setMovingEdge().
|
inline |
Set the name of the circle.
circle_name | : The name of the circle. |
Definition at line 224 of file vpMbtDistanceCircle.h.
Referenced by vpMbKltTracker::addCircle(), and vpMbEdgeTracker::addCircle().
|
inline |
Set the name of the circle.
circle_name | : The name of the circle. |
Definition at line 231 of file vpMbtDistanceCircle.h.
|
inline |
Set if the circle has to considered during tracking phase.
track | : True if the circle has to be tracked, False otherwise. |
Definition at line 201 of file vpMbtDistanceCircle.h.
|
inline |
Set a boolean parameter to indicates if the circle is visible in the image or not.
_isvisible | : Set to true if the circle is visible |
Definition at line 238 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::initMovingEdge().
void vpMbtDistanceCircle::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 194 of file vpMbtDistanceCircle.cpp.
References isvisible, meEllipse, nbFeature, and Reinit.
Referenced by vpMbEdgeTracker::trackMovingEdge().
void vpMbtDistanceCircle::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 223 of file vpMbtDistanceCircle.cpp.
References vpCircle::changeFrame(), circle, vpMeterPixelConversion::convertEllipse(), isvisible, meEllipse, nbFeature, vpCircle::projection(), and Reinit.
Referenced by vpMbEdgeTracker::updateMovingEdge().
vpCircle* vpMbtDistanceCircle::circle |
The circle to track.
Definition at line 79 of file vpMbtDistanceCircle.h.
Referenced by buildFrom(), computeInteractionMatrixError(), display(), initMovingEdge(), updateMovingEdge(), and ~vpMbtDistanceCircle().
vpColVector vpMbtDistanceCircle::error |
The error vector.
Definition at line 94 of file vpMbtDistanceCircle.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSSecondPhase(), initInteractionMatrixError(), and vpMbEdgeKltTracker::trackSecondLoop().
vpMbHiddenFaces<vpMbtPolygon>* vpMbtDistanceCircle::hiddenface |
Pointer to the list of faces.
Definition at line 100 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle(), and vpMbEdgeTracker::initMovingEdge().
int vpMbtDistanceCircle::index_polygon |
Index of the faces which contain the line.
Definition at line 102 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle(), and vpMbEdgeTracker::initMovingEdge().
bool vpMbtDistanceCircle::isvisible |
Indicates if the circle is visible or not.
Definition at line 104 of file vpMbtDistanceCircle.h.
Referenced by computeInteractionMatrixError(), display(), initInteractionMatrixError(), initMovingEdge(), trackMovingEdge(), and updateMovingEdge().
vpMatrix vpMbtDistanceCircle::L |
The interaction matrix.
Definition at line 92 of file vpMbtDistanceCircle.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSSecondPhase(), initInteractionMatrixError(), and vpMbEdgeKltTracker::trackSecondLoop().
vpMbtMeEllipse* vpMbtDistanceCircle::meEllipse |
The moving edge containers.
Definition at line 76 of file vpMbtDistanceCircle.h.
Referenced by computeInteractionMatrixError(), vpMbEdgeTracker::computeProjectionError(), vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), displayMovingEdges(), vpMbEdgeTracker::getNbPoints(), initInteractionMatrixError(), initMovingEdge(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), setMovingEdge(), vpMbEdgeTracker::testTracking(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeTracker::trackMovingEdge(), updateMovingEdge(), vpMbEdgeTracker::updateMovingEdgeWeights(), and ~vpMbtDistanceCircle().
unsigned int vpMbtDistanceCircle::nbFeature |
The number of moving edges.
Definition at line 96 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), vpMbEdgeTracker::computeVVSFirstPhaseFactor(), vpMbEdgeTracker::computeVVSSecondPhase(), initInteractionMatrixError(), vpMbEdgeKltTracker::initMbtTracking(), vpMbEdgeTracker::initMbtTracking(), vpMbEdgeTracker::initMovingEdge(), vpMbEdgeKltTracker::postTrackingMbt(), vpMbEdgeKltTracker::trackFirstLoop(), trackMovingEdge(), vpMbEdgeKltTracker::trackSecondLoop(), updateMovingEdge(), vpMbEdgeTracker::updateMovingEdge(), and vpMbEdgeTracker::updateMovingEdgeWeights().
vpPoint* vpMbtDistanceCircle::p1 |
The center of the circle.
Definition at line 85 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle(), buildFrom(), and ~vpMbtDistanceCircle().
vpPoint* vpMbtDistanceCircle::p2 |
A point on the plane containing the circle.
Definition at line 87 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle(), buildFrom(), and ~vpMbtDistanceCircle().
vpPoint* vpMbtDistanceCircle::p3 |
An other point on the plane containing the circle.
Definition at line 89 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle(), buildFrom(), and ~vpMbtDistanceCircle().
double vpMbtDistanceCircle::radius |
The radius of the circle.
Definition at line 82 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeTracker::addCircle(), and buildFrom().
bool vpMbtDistanceCircle::Reinit |
Indicates if the circle has to be reinitialized.
Definition at line 98 of file vpMbtDistanceCircle.h.
Referenced by vpMbEdgeKltTracker::postTrackingMbt(), reinitMovingEdge(), vpMbEdgeTracker::reinitMovingEdge(), trackMovingEdge(), updateMovingEdge(), vpMbEdgeTracker::updateMovingEdge(), and vpMbEdgeTracker::updateMovingEdgeWeights().