![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpMbtDistanceKltCylinder.h>
Public Member Functions | |
| vpMbtDistanceKltCylinder () | |
| virtual | ~vpMbtDistanceKltCylinder () |
| void | buildFrom (const vpPoint &p1, const vpPoint &p2, const double &r) |
| unsigned int | computeNbDetectedCurrent (const vpKltOpencv &_tracker) |
| void | computeInteractionMatrixAndResidu (const vpHomogeneousMatrix &cMc0, vpColVector &_R, vpMatrix &_J) |
| 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 | displayPrimitive (const vpImage< unsigned char > &_I) |
| void | displayPrimitive (const vpImage< vpRGBa > &_I) |
| vpCameraParameters & | getCameraParameters () |
| std::map< int, vpImagePoint > & | getCurrentPoints () |
| std::map< int, int > & | getCurrentPointsInd () |
| vpCylinder | getCylinder () const |
| unsigned int | getInitialNumberPoint () const |
| unsigned int | getCurrentNumberPoints () const |
| std::vector< std::vector< double > > | getFeaturesForDisplay () |
| std::vector< std::vector< double > > | getModelForDisplay (const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam) |
| bool | hasEnoughPoints () const |
| bool | isTracked () const |
| void | init (const vpKltOpencv &_tracker, const vpHomogeneousMatrix &cMo) |
| void | removeOutliers (const vpColVector &weight, const double &threshold_outlier) |
| virtual void | setCameraParameters (const vpCameraParameters &_cam) |
| void | setTracked (const bool &track) |
| void | updateMask (cv::Mat &mask, unsigned char _nb=255, unsigned int _shiftBorder=0) |
Public Attributes | |
| std::vector< int > | listIndicesCylinderBBox |
| vpMbHiddenFaces< vpMbtPolygon > * | hiddenface |
| bool | useScanLine |
Implementation of a polygon of the model containing points of interest. It is used by the model-based tracker KLT, and hybrid.
Tutorials
If you are interested in using a MBT tracker in your applications, you may have a look at:
Definition at line 76 of file vpMbtDistanceKltCylinder.h.
| BEGIN_VISP_NAMESPACE vpMbtDistanceKltCylinder::vpMbtDistanceKltCylinder | ( | ) |
Basic constructor.
Definition at line 53 of file vpMbtDistanceKltCylinder.cpp.
References hiddenface, listIndicesCylinderBBox, and useScanLine.
|
virtual |
Basic destructor.
Definition at line 63 of file vpMbtDistanceKltCylinder.cpp.
| void vpMbtDistanceKltCylinder::buildFrom | ( | const vpPoint & | p1, |
| const vpPoint & | p2, | ||
| const double & | r ) |
Definition at line 65 of file vpMbtDistanceKltCylinder.cpp.
References vpPoint::get_oX(), vpPoint::get_oY(), and vpPoint::get_oZ().
Referenced by vpMbKltTracker::initCylinder().
| void vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu | ( | const vpHomogeneousMatrix & | _cMc0, |
| vpColVector & | _R, | ||
| vpMatrix & | _J ) |
Compute the interaction matrix and the residu vector for the face. The method assumes that these two objects are properly sized in order to be able to improve the speed with the use of SubCoVector and subMatrix.
| _cMc0 | : camera displacement since initialisation |
| _R | : the residu vector |
| _J | : the interaction matrix |
Definition at line 278 of file vpMbtDistanceKltCylinder.cpp.
References vpPoint::changeFrame(), vpPixelMeterConversion::convertPoint(), vpPoint::get_x(), vpPoint::get_y(), vpMath::isNaN(), and vpForwardProjection::project().
Referenced by vpMbEdgeKltTracker::computeVVS(), and vpMbKltTracker::computeVVSInteractionMatrixAndResidu().
| unsigned int vpMbtDistanceKltCylinder::computeNbDetectedCurrent | ( | const vpKltOpencv & | _tracker | ) |
compute the number of point in this instanciation of the tracker that corresponds to the points of the cylinder
| _tracker | : the KLT tracker |
Definition at line 192 of file vpMbtDistanceKltCylinder.cpp.
References vpKltOpencv::getFeature(), and vpKltOpencv::getNbFeatures().
Referenced by vpMbKltTracker::preTracking().
| void vpMbtDistanceKltCylinder::display | ( | const vpImage< unsigned char > & | I, |
| const vpHomogeneousMatrix & | cMo, | ||
| const vpCameraParameters & | cam, | ||
| const vpColor & | col, | ||
| unsigned int | thickness = 1, | ||
| bool | displayFullModel = false ) |
Definition at line 538 of file vpMbtDistanceKltCylinder.cpp.
References vpDisplay::displayLine(), and getModelForDisplay().
| void vpMbtDistanceKltCylinder::display | ( | const vpImage< vpRGBa > & | I, |
| const vpHomogeneousMatrix & | cMo, | ||
| const vpCameraParameters & | cam, | ||
| const vpColor & | col, | ||
| unsigned int | thickness = 1, | ||
| bool | displayFullModel = false ) |
Definition at line 551 of file vpMbtDistanceKltCylinder.cpp.
References vpDisplay::displayLine(), and getModelForDisplay().
| void vpMbtDistanceKltCylinder::displayPrimitive | ( | const vpImage< unsigned char > & | I_ | ) |
Display the primitives tracked for the cylinder.
| I_ | : The image where to display. |
Definition at line 495 of file vpMbtDistanceKltCylinder.cpp.
References vpDisplay::displayCross(), vpDisplay::displayText(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpColor::red, vpMath::round(), vpImagePoint::set_i(), and vpImagePoint::set_j().
Display the primitives tracked for the cylinder.
| I_ | : The image where to display. |
Definition at line 519 of file vpMbtDistanceKltCylinder.cpp.
References vpDisplay::displayCross(), vpDisplay::displayText(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpColor::red, vpMath::round(), vpImagePoint::set_i(), and vpImagePoint::set_j().
|
inline |
Get the camera parameters of the face.
Definition at line 169 of file vpMbtDistanceKltCylinder.h.
|
inline |
Get the number of points detected in the last image.
Definition at line 196 of file vpMbtDistanceKltCylinder.h.
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVSInteractionMatrixAndResidu(), vpMbKltTracker::postTracking(), vpMbKltTracker::preTracking(), and vpMbKltTracker::testTracking().
|
inline |
Definition at line 171 of file vpMbtDistanceKltCylinder.h.
|
inline |
Definition at line 173 of file vpMbtDistanceKltCylinder.h.
|
inline |
Definition at line 175 of file vpMbtDistanceKltCylinder.h.
| std::vector< std::vector< double > > vpMbtDistanceKltCylinder::getFeaturesForDisplay | ( | ) |
Return a list of features parameters for display.
Definition at line 570 of file vpMbtDistanceKltCylinder.cpp.
References vpImagePoint::get_i(), vpImagePoint::get_j(), vpMath::round(), vpImagePoint::set_i(), and vpImagePoint::set_j().
Referenced by vpMbKltTracker::getFeaturesForDisplayKlt().
|
inline |
Get the number of point that was belonging to the face at the initialisation
Definition at line 185 of file vpMbtDistanceKltCylinder.h.
Referenced by vpMbKltTracker::postTracking().
| std::vector< std::vector< double > > vpMbtDistanceKltCylinder::getModelForDisplay | ( | const vpHomogeneousMatrix & | cMo, |
| const vpCameraParameters & | camera ) |
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()>
| cMo | : Pose used to project the 3D model into the image. |
| camera | : The camera parameters. |
Definition at line 602 of file vpMbtDistanceKltCylinder.cpp.
References vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertLine(), vpImagePoint::get_i(), vpImagePoint::get_j(), and vpImagePoint::set_ij().
Referenced by display(), display(), and vpMbKltTracker::getModelForDisplay().
|
inline |
Definition at line 202 of file vpMbtDistanceKltCylinder.h.
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVSInteractionMatrixAndResidu(), vpMbKltTracker::getFeaturesForDisplayKlt(), vpMbKltTracker::postTracking(), vpMbKltTracker::preTracking(), and vpMbKltTracker::testTracking().
| void vpMbtDistanceKltCylinder::init | ( | const vpKltOpencv & | _tracker, |
| const vpHomogeneousMatrix & | cMo ) |
Initialise the cylinder to track. All the points in the map, representing all the map detected in the image, are parsed in order to extract the id of the points that are indeed in the face.
| _tracker | : ViSP OpenCV KLT Tracker. |
| cMo | : Pose of the object in the camera frame at initialization. |
Definition at line 101 of file vpMbtDistanceKltCylinder.cpp.
References vpPixelMeterConversion::convertPoint(), vpKltOpencv::getFeature(), vpKltOpencv::getNbFeatures(), hiddenface, vpPolygon::isInside(), vpMath::isNaN(), listIndicesCylinderBBox, and useScanLine.
Referenced by vpMbKltTracker::reinit().
|
inline |
Return if the klt cylinder is used for tracking.
Definition at line 209 of file vpMbtDistanceKltCylinder.h.
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVSInteractionMatrixAndResidu(), vpMbKltTracker::getFeaturesForDisplayKlt(), vpMbKltTracker::postTracking(), vpMbKltTracker::preTracking(), vpMbKltTracker::reinit(), and vpMbKltTracker::testTracking().
| void vpMbtDistanceKltCylinder::removeOutliers | ( | const vpColVector & | _w, |
| const double & | threshold_outlier ) |
This method removes the outliers. A point is considered as outlier when its associated weight is below a given threshold (threshold_outlier).
| _w | : Vector containing the weight of all the tracked points. |
| threshold_outlier | : Threshold to specify wether or not a point has to be deleted. |
Definition at line 230 of file vpMbtDistanceKltCylinder.cpp.
Referenced by vpMbKltTracker::postTracking().
|
inlinevirtual |
Set the camera parameters
| _cam | : the new camera parameters |
Definition at line 220 of file vpMbtDistanceKltCylinder.h.
Referenced by vpMbKltTracker::initCylinder(), and vpMbKltTracker::setCameraParameters().
|
inline |
Set if the klt cylinder has to be considered during tracking phase.
| track | : True if is has to be tracked, False otherwise. |
Definition at line 227 of file vpMbtDistanceKltCylinder.h.
| void vpMbtDistanceKltCylinder::updateMask | ( | cv::Mat & | mask, |
| unsigned char | nb = 255, | ||
| unsigned int | shiftBorder = 0 ) |
Modification of all the pixels that are in the roi to the value of _nb ( default is 255).
| mask | : the mask to update (0, not in the object, _nb otherwise). |
| nb | : Optional value to set to the pixels included in the face. |
| shiftBorder | : Optional shift for the border in pixel (sort of built-in erosion) to avoid to consider pixels near the limits of the face. |
Definition at line 374 of file vpMbtDistanceKltCylinder.cpp.
References vpPolygon::buildFrom(), vpPolygon::getArea(), vpPolygon3D::getMinMaxRoi(), hiddenface, vpPolygon::isInside(), listIndicesCylinderBBox, and vpImagePoint::set_ij().
Referenced by vpMbKltTracker::reinit().
| vpMbHiddenFaces<vpMbtPolygon>* vpMbtDistanceKltCylinder::hiddenface |
Pointer to the list of faces.
Definition at line 116 of file vpMbtDistanceKltCylinder.h.
Referenced by init(), vpMbKltTracker::initCylinder(), updateMask(), and vpMbtDistanceKltCylinder().
| std::vector<int> vpMbtDistanceKltCylinder::listIndicesCylinderBBox |
Pointer to the polygon that define a face.
Definition at line 114 of file vpMbtDistanceKltCylinder.h.
Referenced by init(), vpMbKltTracker::initCylinder(), vpMbKltTracker::reinit(), updateMask(), and vpMbtDistanceKltCylinder().
| bool vpMbtDistanceKltCylinder::useScanLine |
Use scanline rendering.
Definition at line 118 of file vpMbtDistanceKltCylinder.h.
Referenced by init(), vpMbKltTracker::initCylinder(), and vpMbtDistanceKltCylinder().