Visual Servoing Platform  version 3.2.1 under development (2019-10-17) under development (2019-10-17)
vpMbtFaceDepthDense Class Reference

#include <visp3/mbt/vpMbtFaceDepthDense.h>

Public Types

enum  vpDepthDenseFilteringType { NO_FILTERING = 0, DEPTH_OCCUPANCY_RATIO_FILTERING = 1 << 1, MIN_DISTANCE_FILTERING = 1 << 2, MAX_DISTANCE_FILTERING = 1 << 3 }
 

Public Member Functions

 vpMbtFaceDepthDense ()
 
virtual ~vpMbtFaceDepthDense ()
 
void addLine (vpPoint &p1, vpPoint &p2, vpMbHiddenFaces< vpMbtPolygon > *const faces, int polygon=-1, std::string name="")
 
bool computeDesiredFeatures (const vpHomogeneousMatrix &cMo, const pcl::PointCloud< pcl::PointXYZ >::ConstPtr &point_cloud, const unsigned int stepX, const unsigned int stepY, const vpImage< bool > *mask=NULL)
 
bool computeDesiredFeatures (const vpHomogeneousMatrix &cMo, const unsigned int width, const unsigned int height, const std::vector< vpColVector > &point_cloud, const unsigned int stepX, const unsigned int stepY, const vpImage< bool > *mask=NULL)
 
void computeInteractionMatrixAndResidu (const vpHomogeneousMatrix &cMo, vpMatrix &L, vpColVector &error)
 
void computeVisibility ()
 
void computeVisibilityDisplay ()
 
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 displayFeature (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const double scale=0.05, const unsigned int thickness=1)
 
void displayFeature (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const double scale=0.05, const unsigned int thickness=1)
 
std::vector< std::vector< double > > getModelForDisplay (unsigned int width, unsigned int height, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const bool displayFullModel=false)
 
unsigned int getNbFeatures () const
 
bool isTracked () const
 
bool isVisible () const
 
void setCameraParameters (const vpCameraParameters &camera)
 
void setScanLineVisibilityTest (const bool v)
 
void setDepthDenseFilteringMaxDistance (const double maxDistance)
 
void setDepthDenseFilteringMethod (const int method)
 
void setDepthDenseFilteringMinDistance (const double minDistance)
 
void setDepthDenseFilteringOccupancyRatio (const double occupancyRatio)
 
void setTracked (const bool tracked)
 

Public Attributes

vpCameraParameters m_cam
 
unsigned int m_clippingFlag
 
double m_distFarClip
 
double m_distNearClip
 
vpMbHiddenFaces< vpMbtPolygon > * m_hiddenFace
 
vpPlane m_planeObject
 
vpMbtPolygonm_polygon
 
bool m_useScanLine
 

Protected Member Functions

void computeROI (const vpHomogeneousMatrix &cMo, const unsigned int width, const unsigned int height, std::vector< vpImagePoint > &roiPts, double &distanceToFace)
 
bool samePoint (const vpPoint &P1, const vpPoint &P2) const
 

Protected Attributes

int m_depthDenseFilteringMethod
 
double m_depthDenseFilteringMaxDist
 
double m_depthDenseFilteringMinDist
 
double m_depthDenseFilteringOccupancyRatio
 
bool m_isTrackedDepthDenseFace
 
bool m_isVisible
 
std::vector< vpMbtDistanceLine * > m_listOfFaceLines
 
vpPlane m_planeCamera
 
std::vector< double > m_pointCloudFace
 
std::vector< PolygonLine > m_polygonLines
 

Detailed Description

Definition at line 53 of file vpMbtFaceDepthDense.h.

Member Enumeration Documentation

◆ vpDepthDenseFilteringType

Enumerator
NO_FILTERING 

Face is used if visible.

DEPTH_OCCUPANCY_RATIO_FILTERING 

Face is used if there is enough depth information in the face polygon

MIN_DISTANCE_FILTERING 

Face is used if the camera position is farther than the threshold

MAX_DISTANCE_FILTERING 

Face is used if the camera position is closer than the threshold

Definition at line 56 of file vpMbtFaceDepthDense.h.

Constructor & Destructor Documentation

◆ vpMbtFaceDepthDense()

vpMbtFaceDepthDense::vpMbtFaceDepthDense ( )

Definition at line 51 of file vpMbtFaceDepthDense.cpp.

◆ ~vpMbtFaceDepthDense()

vpMbtFaceDepthDense::~vpMbtFaceDepthDense ( )
virtual

Definition at line 60 of file vpMbtFaceDepthDense.cpp.

References m_listOfFaceLines.

Member Function Documentation

◆ addLine()

void vpMbtFaceDepthDense::addLine ( vpPoint P1,
vpPoint P2,
vpMbHiddenFaces< vpMbtPolygon > *const  faces,
int  polygon = -1,
std::string  name = "" 
)

Add a line belonging to the $ index $ the polygon to the list of lines. It is defined by its two extremities.

If the line already exists, the ploygone's index is added to the list of polygon to which it belongs.

Parameters
P1: The first extremity of the line.
P2: The second extremity of the line.
faces: Pointer to vpMbHiddenFaces.
polygon: The index of the polygon to which the line belongs.
name: the optional name of the line

Definition at line 80 of file vpMbtFaceDepthDense.cpp.

References vpMbtDistanceLine::addPolygon(), vpMbtDistanceLine::buildFrom(), vpPolygon3D::FAR_CLIPPING, vpMbtDistanceLine::getPolygon(), vpMbtDistanceLine::hiddenface, m_cam, m_clippingFlag, m_distFarClip, m_distNearClip, m_listOfFaceLines, m_polygonLines, m_useScanLine, vpPolygon3D::NEAR_CLIPPING, vpPolygon3D::NO_CLIPPING, vpMbtDistanceLine::p1, vpMbtDistanceLine::p2, samePoint(), vpMbtDistanceLine::setCameraParameters(), vpPolygon3D::setClipping(), vpPolygon3D::setFarClippingDistance(), vpMbtDistanceLine::setIndex(), vpMbtDistanceLine::setName(), vpPolygon3D::setNearClippingDistance(), and vpMbtDistanceLine::useScanLine.

Referenced by vpMbDepthDenseTracker::addFace().

◆ computeDesiredFeatures() [1/2]

◆ computeDesiredFeatures() [2/2]

◆ computeInteractionMatrixAndResidu()

◆ computeROI()

◆ computeVisibility()

void vpMbtFaceDepthDense::computeVisibility ( )

◆ computeVisibilityDisplay()

◆ display() [1/2]

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

◆ display() [2/2]

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

◆ displayFeature() [1/2]

void vpMbtFaceDepthDense::displayFeature ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const double  scale = 0.05,
const unsigned int  thickness = 1 
)

Definition at line 711 of file vpMbtFaceDepthDense.cpp.

◆ displayFeature() [2/2]

void vpMbtFaceDepthDense::displayFeature ( const vpImage< vpRGBa > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const double  scale = 0.05,
const unsigned int  thickness = 1 
)

Definition at line 717 of file vpMbtFaceDepthDense.cpp.

◆ getModelForDisplay()

std::vector< std::vector< double > > vpMbtFaceDepthDense::getModelForDisplay ( unsigned int  width,
unsigned int  height,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const 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.
height: Image height.
cMo: Pose used to project the 3D model into the image.
cam: The camera parameters.
displayFullModel: If true, the line is displayed even if it is not

Definition at line 734 of file vpMbtFaceDepthDense.cpp.

References computeVisibilityDisplay(), vpMbtDistanceLine::getModelForDisplay(), vpMbtPolygon::isVisible(), m_isTrackedDepthDenseFace, m_listOfFaceLines, and m_polygon.

Referenced by display(), and vpMbDepthDenseTracker::getModelForDisplay().

◆ getNbFeatures()

unsigned int vpMbtFaceDepthDense::getNbFeatures ( ) const
inline

◆ isTracked()

bool vpMbtFaceDepthDense::isTracked ( ) const
inline

Definition at line 133 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::segmentPointCloud().

◆ isVisible()

bool vpMbtFaceDepthDense::isVisible ( ) const
inline

Definition at line 135 of file vpMbtFaceDepthDense.h.

References vpMbtPolygon::isvisible.

Referenced by vpMbDepthDenseTracker::segmentPointCloud().

◆ samePoint()

bool vpMbtFaceDepthDense::samePoint ( const vpPoint P1,
const vpPoint P2 
) const
protected

Check if two vpPoints are similar.

To be similar : $ (X_1 - X_2)^2 + (Y_1 - Y_2)^2 + (Z_1 - Z_2)^2 < epsilon $.

Parameters
P1: The first point to compare
P2: The second point to compare

Definition at line 764 of file vpMbtFaceDepthDense.cpp.

References vpPoint::get_oX(), vpPoint::get_oY(), and vpPoint::get_oZ().

Referenced by addLine().

◆ setCameraParameters()

void vpMbtFaceDepthDense::setCameraParameters ( const vpCameraParameters camera)

Definition at line 777 of file vpMbtFaceDepthDense.cpp.

References m_cam, and m_listOfFaceLines.

◆ setDepthDenseFilteringMaxDistance()

void vpMbtFaceDepthDense::setDepthDenseFilteringMaxDistance ( const double  maxDistance)
inline

Definition at line 141 of file vpMbtFaceDepthDense.h.

◆ setDepthDenseFilteringMethod()

void vpMbtFaceDepthDense::setDepthDenseFilteringMethod ( const int  method)
inline

Definition at line 146 of file vpMbtFaceDepthDense.h.

◆ setDepthDenseFilteringMinDistance()

void vpMbtFaceDepthDense::setDepthDenseFilteringMinDistance ( const double  minDistance)
inline

Definition at line 148 of file vpMbtFaceDepthDense.h.

◆ setDepthDenseFilteringOccupancyRatio()

void vpMbtFaceDepthDense::setDepthDenseFilteringOccupancyRatio ( const double  occupancyRatio)
inline

Definition at line 153 of file vpMbtFaceDepthDense.h.

◆ setScanLineVisibilityTest()

void vpMbtFaceDepthDense::setScanLineVisibilityTest ( const bool  v)

Definition at line 787 of file vpMbtFaceDepthDense.cpp.

References m_listOfFaceLines, and m_useScanLine.

◆ setTracked()

void vpMbtFaceDepthDense::setTracked ( const bool  tracked)
inline

Definition at line 162 of file vpMbtFaceDepthDense.h.

References vpPolygon3D::p.

Referenced by vpMbDepthDenseTracker::setUseDepthDenseTracking().

Member Data Documentation

◆ m_cam

vpCameraParameters vpMbtFaceDepthDense::m_cam

Camera intrinsic parameters.

Definition at line 68 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::addFace(), addLine(), computeROI(), and setCameraParameters().

◆ m_clippingFlag

unsigned int vpMbtFaceDepthDense::m_clippingFlag

Flags specifying which clipping to used.

Definition at line 70 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::addFace(), addLine(), and computeROI().

◆ m_depthDenseFilteringMaxDist

double vpMbtFaceDepthDense::m_depthDenseFilteringMaxDist
protected

Maximum distance threshold.

Definition at line 210 of file vpMbtFaceDepthDense.h.

Referenced by computeDesiredFeatures().

◆ m_depthDenseFilteringMethod

int vpMbtFaceDepthDense::m_depthDenseFilteringMethod
protected

Method to use to consider or not the face.

Definition at line 208 of file vpMbtFaceDepthDense.h.

Referenced by computeDesiredFeatures().

◆ m_depthDenseFilteringMinDist

double vpMbtFaceDepthDense::m_depthDenseFilteringMinDist
protected

Minimum distance threshold.

Definition at line 212 of file vpMbtFaceDepthDense.h.

Referenced by computeDesiredFeatures().

◆ m_depthDenseFilteringOccupancyRatio

double vpMbtFaceDepthDense::m_depthDenseFilteringOccupancyRatio
protected

Ratio between available depth points and theoretical number of points.

Definition at line 214 of file vpMbtFaceDepthDense.h.

Referenced by computeDesiredFeatures().

◆ m_distFarClip

double vpMbtFaceDepthDense::m_distFarClip

Distance for near clipping.

Definition at line 72 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::addFace(), and addLine().

◆ m_distNearClip

double vpMbtFaceDepthDense::m_distNearClip

Distance for near clipping.

Definition at line 74 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::addFace(), and addLine().

◆ m_hiddenFace

vpMbHiddenFaces<vpMbtPolygon>* vpMbtFaceDepthDense::m_hiddenFace

Pointer to the list of faces.

Definition at line 76 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::addFace(), computeDesiredFeatures(), and computeROI().

◆ m_isTrackedDepthDenseFace

bool vpMbtFaceDepthDense::m_isTrackedDepthDenseFace
protected

Flag to define if the face should be tracked or not.

Definition at line 216 of file vpMbtFaceDepthDense.h.

Referenced by getModelForDisplay().

◆ m_isVisible

bool vpMbtFaceDepthDense::m_isVisible
protected

Visibility flag.

Definition at line 218 of file vpMbtFaceDepthDense.h.

Referenced by computeVisibility().

◆ m_listOfFaceLines

std::vector<vpMbtDistanceLine *> vpMbtFaceDepthDense::m_listOfFaceLines
protected

◆ m_planeCamera

vpPlane vpMbtFaceDepthDense::m_planeCamera
protected

Plane equation described in the camera frame and updated with the current pose

Definition at line 222 of file vpMbtFaceDepthDense.h.

Referenced by computeInteractionMatrixAndResidu().

◆ m_planeObject

vpPlane vpMbtFaceDepthDense::m_planeObject

Plane equation described in the object frame.

Definition at line 78 of file vpMbtFaceDepthDense.h.

Referenced by vpMbDepthDenseTracker::addFace(), and computeInteractionMatrixAndResidu().

◆ m_pointCloudFace

std::vector<double> vpMbtFaceDepthDense::m_pointCloudFace
protected

List of depth points inside the face.

Definition at line 224 of file vpMbtFaceDepthDense.h.

Referenced by computeDesiredFeatures(), and computeInteractionMatrixAndResidu().

◆ m_polygon

◆ m_polygonLines

std::vector<PolygonLine> vpMbtFaceDepthDense::m_polygonLines
protected

Polygon lines used for scan-line visibility.

Definition at line 226 of file vpMbtFaceDepthDense.h.

Referenced by addLine(), and computeROI().

◆ m_useScanLine

bool vpMbtFaceDepthDense::m_useScanLine