![]() |
Visual Servoing Platform
version 3.2.0
|
#include <vpMbtDistanceKltPoints.h>
Public Member Functions | |
vpMbtDistanceKltPoints () | |
virtual | ~vpMbtDistanceKltPoints () |
unsigned int | computeNbDetectedCurrent (const vpKltOpencv &_tracker, const vpImage< bool > *mask=NULL) |
void | computeHomography (const vpHomogeneousMatrix &_cTc0, vpHomography &cHc0) |
void | computeInteractionMatrixAndResidu (vpColVector &_R, vpMatrix &_J) |
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 | displayPrimitive (const vpImage< unsigned char > &_I) |
void | displayPrimitive (const vpImage< vpRGBa > &_I) |
vpCameraParameters & | getCameraParameters () |
vpColVector | getCurrentNormal () const |
std::map< int, vpImagePoint > & | getCurrentPoints () |
std::map< int, int > & | getCurrentPointsInd () |
unsigned int | getInitialNumberPoint () const |
unsigned int | getCurrentNumberPoints () const |
bool | hasEnoughPoints () const |
void | init (const vpKltOpencv &_tracker, const vpImage< bool > *mask=NULL) |
bool | isTracked () const |
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 | |
vpMbtPolygon * | polygon |
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.
Definition at line 66 of file vpMbtDistanceKltPoints.h.
vpMbtDistanceKltPoints::vpMbtDistanceKltPoints | ( | ) |
Basic constructor.
Definition at line 57 of file vpMbtDistanceKltPoints.cpp.
|
virtual |
Basic destructor.
Definition at line 69 of file vpMbtDistanceKltPoints.cpp.
void vpMbtDistanceKltPoints::computeHomography | ( | const vpHomogeneousMatrix & | _cTc0, |
vpHomography & | _cHc0 | ||
) |
compute the homography using a displacement matrix.
the homography is given by:
Several internal variables are computed (dt, cRc0_0n)
_cTc0 | : the displacement matrix of the camera between the initial position of the camera and the current camera position |
_cHc0 | : the homography of the plane |
Definition at line 282 of file vpMbtDistanceKltPoints.cpp.
Referenced by vpMbKltTracker::computeVVSInteractionMatrixAndResidu().
void vpMbtDistanceKltPoints::computeInteractionMatrixAndResidu | ( | 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.
_R | : the residu vector |
_J | : the interaction matrix |
Definition at line 193 of file vpMbtDistanceKltPoints.cpp.
Referenced by vpMbKltTracker::computeVVSInteractionMatrixAndResidu().
unsigned int vpMbtDistanceKltPoints::computeNbDetectedCurrent | ( | const vpKltOpencv & | _tracker, |
const vpImage< bool > * | mask = NULL |
||
) |
compute the number of point in this instanciation of the tracker that corresponds to the points of the face
_tracker | : the KLT tracker |
mask | Mask image or NULL if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false. |
Definition at line 152 of file vpMbtDistanceKltPoints.cpp.
void vpMbtDistanceKltPoints::display | ( | const vpImage< unsigned char > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | cam, | ||
const vpColor & | col, | ||
const unsigned int | thickness = 1 , |
||
const bool | displayFullModel = false |
||
) |
Definition at line 587 of file vpMbtDistanceKltPoints.cpp.
References vpMbHiddenFaces< PolygonType >::computeScanLineQuery(), vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), vpPolygon3D::DOWN_CLIPPING, vpPolygon3D::FAR_CLIPPING, vpPolygon3D::getPolygonClipped(), hiddenface, vpMbtPolygon::isVisible(), vpPolygon3D::LEFT_CLIPPING, vpPolygon3D::NEAR_CLIPPING, polygon, vpPolygon3D::RIGHT_CLIPPING, vpPolygon3D::UP_CLIPPING, and useScanLine.
void vpMbtDistanceKltPoints::display | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | cam, | ||
const vpColor & | col, | ||
const unsigned int | thickness = 1 , |
||
const bool | displayFullModel = false |
||
) |
Definition at line 624 of file vpMbtDistanceKltPoints.cpp.
References vpMbHiddenFaces< PolygonType >::computeScanLineQuery(), vpMeterPixelConversion::convertPoint(), vpDisplay::displayLine(), vpPolygon3D::DOWN_CLIPPING, vpPolygon3D::FAR_CLIPPING, vpPolygon3D::getPolygonClipped(), hiddenface, vpMbtPolygon::isVisible(), vpPolygon3D::LEFT_CLIPPING, vpPolygon3D::NEAR_CLIPPING, polygon, vpPolygon3D::RIGHT_CLIPPING, vpPolygon3D::UP_CLIPPING, and useScanLine.
void vpMbtDistanceKltPoints::displayPrimitive | ( | const vpImage< unsigned char > & | _I | ) |
Display the primitives tracked for the face.
_I | : The image where to display. |
Definition at line 544 of file vpMbtDistanceKltPoints.cpp.
Display the primitives tracked for the face.
_I | : The image where to display. |
Definition at line 568 of file vpMbtDistanceKltPoints.cpp.
|
inline |
Get the camera parameters of the face.
Definition at line 156 of file vpMbtDistanceKltPoints.h.
|
inline |
Definition at line 158 of file vpMbtDistanceKltPoints.h.
|
inline |
Get the number of points detected in the last image.
Definition at line 183 of file vpMbtDistanceKltPoints.h.
Referenced by vpMbKltTracker::computeVVSInteractionMatrixAndResidu().
|
inline |
Definition at line 160 of file vpMbtDistanceKltPoints.h.
|
inline |
Definition at line 162 of file vpMbtDistanceKltPoints.h.
|
inline |
Get the number of point that was belonging to the face at the initialisation
Definition at line 172 of file vpMbtDistanceKltPoints.h.
|
inline |
Definition at line 185 of file vpMbtDistanceKltPoints.h.
Referenced by vpMbKltTracker::computeVVSInteractionMatrixAndResidu().
void vpMbtDistanceKltPoints::init | ( | const vpKltOpencv & | _tracker, |
const vpImage< bool > * | mask = NULL |
||
) |
Initialise the face 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. |
mask | Mask image or NULL if not wanted. Mask values that are set to true are considered in the tracking. To disable a pixel, set false. |
Definition at line 79 of file vpMbtDistanceKltPoints.cpp.
Referenced by vpMbKltTracker::reinit().
|
inline |
Return if the klt points are used for tracking.
Definition at line 194 of file vpMbtDistanceKltPoints.h.
Referenced by vpMbKltTracker::computeVVSInteractionMatrixAndResidu(), and vpMbKltTracker::reinit().
void vpMbtDistanceKltPoints::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 506 of file vpMbtDistanceKltPoints.cpp.
|
inlinevirtual |
Set the camera parameters
_cam | : the new camera parameters |
Definition at line 203 of file vpMbtDistanceKltPoints.h.
|
inline |
Set if the klt points have to considered during tracking phase.
track | : True if they have to be tracked, False otherwise. |
Definition at line 210 of file vpMbtDistanceKltPoints.h.
void vpMbtDistanceKltPoints::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 | : Optionnal value to set to the pixels included in the face. |
shiftBorder | : Optionnal 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 353 of file vpMbtDistanceKltPoints.cpp.
Referenced by vpMbKltTracker::reinit().
vpMbHiddenFaces<vpMbtPolygon>* vpMbtDistanceKltPoints::hiddenface |
Pointer to the list of faces.
Definition at line 107 of file vpMbtDistanceKltPoints.h.
Referenced by display().
vpMbtPolygon* vpMbtDistanceKltPoints::polygon |
Pointer to the polygon that define a face.
Definition at line 105 of file vpMbtDistanceKltPoints.h.
Referenced by vpMbKltTracker::computeVVSInteractionMatrixAndResidu(), display(), and vpMbKltTracker::reinit().
bool vpMbtDistanceKltPoints::useScanLine |
Use scanline rendering.
Definition at line 109 of file vpMbtDistanceKltPoints.h.
Referenced by display().