Visual Servoing Platform
version 3.6.1 under development (2024-11-15)
|
#include <visp3/mbt/vpMbHiddenFaces.h>
Public Member Functions | |
vpMbHiddenFaces () | |
virtual | ~vpMbHiddenFaces () |
vpMbHiddenFaces (const vpMbHiddenFaces ©) | |
vpMbHiddenFaces & | operator= (vpMbHiddenFaces other) |
void | addPolygon (PolygonType *p) |
bool | computeVisibility (const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed, bool useOgre, bool not_used, unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpTranslationVector &cameraPos, unsigned int index) |
void | computeClippedPolygons (const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam) |
void | computeScanLineRender (const vpCameraParameters &cam, const unsigned int &w, const unsigned int &h) |
void | computeScanLineQuery (const vpPoint &a, const vpPoint &b, std::vector< std::pair< vpPoint, vpPoint > > &lines, const bool &displayResults=false) |
vpMbScanLine & | getMbScanLineRenderer () |
void | displayOgre (const vpHomogeneousMatrix &cMo) |
std::vector< PolygonType * > & | getPolygon () |
void | initOgre (const vpCameraParameters &cam=vpCameraParameters()) |
unsigned int | getNbVisiblePolygon () const |
unsigned int | getNbRayCastingAttemptsForVisibility () |
vpAROgre * | getOgreContext () |
double | getGoodNbRayCastingAttemptsRatio () |
bool | isAppearing (unsigned int i) |
bool | isOgreInitialised () |
bool | isVisible (unsigned int i) |
bool | isVisibleOgre (const vpTranslationVector &cameraPos, const unsigned int &index) |
PolygonType * | operator[] (unsigned int i) |
const PolygonType * | operator[] (unsigned int i) const |
void | reset () |
void | setBackgroundSizeOgre (const unsigned int &h, const unsigned int &w) |
void | setNbRayCastingAttemptsForVisibility (const unsigned int &attempts) |
void | setGoodNbRayCastingAttemptsRatio (const double &ratio) |
void | setOgreShowConfigDialog (bool showConfigDialog) |
unsigned int | setVisible (unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, const double &angle, bool &changed) |
unsigned int | setVisible (unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed) |
unsigned int | setVisible (const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed) |
unsigned int | setVisibleOgre (unsigned int width, unsigned int height, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed) |
unsigned int | setVisibleOgre (const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, bool &changed) |
unsigned int | size () const |
Friends | |
void | swap (vpMbHiddenFaces &first, vpMbHiddenFaces &second) |
Implementation of the polygons management for the model-based trackers.
Definition at line 69 of file vpMbHiddenFaces.h.
vpMbHiddenFaces< PolygonType >::vpMbHiddenFaces |
Basic constructor.
Definition at line 283 of file vpMbHiddenFaces.h.
|
virtual |
Basic destructor.
Definition at line 298 of file vpMbHiddenFaces.h.
vpMbHiddenFaces | ( | const vpMbHiddenFaces< PolygonType > & | copy | ) |
Definition at line 330 of file vpMbHiddenFaces.h.
void vpMbHiddenFaces< PolygonType >::addPolygon | ( | PolygonType * | p | ) |
Add a polygon to the list of polygons.
p | : The polygon to add. |
Definition at line 377 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::addPolygon(), and vpMbTracker::addProjectionErrorPolygon().
void vpMbHiddenFaces< PolygonType >::computeClippedPolygons | ( | const vpHomogeneousMatrix & | cMo, |
const vpCameraParameters & | cam | ||
) |
Compute the clipped points of the polygons that have been added via addPolygon().
cMo | : Pose that will be used to clip the polygons. |
cam | : Camera parameters that will be used to clip the polygons. |
Definition at line 440 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbDepthDenseTracker::computeVisibility(), vpMbDepthNormalTracker::computeVisibility(), vpMbDepthDenseTracker::getModelForDisplay(), vpMbDepthNormalTracker::getModelForDisplay(), vpMbEdgeTracker::init(), and vpMbEdgeTracker::track().
void vpMbHiddenFaces< PolygonType >::computeScanLineQuery | ( | const vpPoint & | a, |
const vpPoint & | b, | ||
std::vector< std::pair< vpPoint, vpPoint > > & | lines, | ||
const bool & | displayResults = false |
||
) |
Compute scanline visibility results for a line.
a | : First point of the line. |
b | : Second point of the line. |
lines | : Result of the scanline visibility. List of the visible parts of the line. |
displayResults | : True if the results have to be displayed. False otherwise. |
Definition at line 499 of file vpMbHiddenFaces.h.
Referenced by vpMbtFaceDepthNormal::computeROI(), vpMbtFaceDepthDense::computeROI(), vpMbtDistanceLine::getModelForDisplay(), vpMbtDistanceLine::initMovingEdge(), and vpMbtDistanceLine::updateMovingEdge().
void vpMbHiddenFaces< PolygonType >::computeScanLineRender | ( | const vpCameraParameters & | cam, |
const unsigned int & | w, | ||
const unsigned int & | h | ||
) |
Render the scene in order to perform, later via computeScanLineQuery(), visibility tests.
cam | : Camera parameters that will be used to render the scene. |
w | : Width of the render window. |
h | : Height of the render window. |
Definition at line 463 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbDepthDenseTracker::computeVisibility(), vpMbDepthNormalTracker::computeVisibility(), vpMbDepthDenseTracker::getModelForDisplay(), vpMbDepthNormalTracker::getModelForDisplay(), vpMbEdgeTracker::init(), and vpMbEdgeTracker::track().
bool vpMbHiddenFaces< PolygonType >::computeVisibility | ( | const vpHomogeneousMatrix & | cMo, |
const double & | angleAppears, | ||
const double & | angleDisappears, | ||
bool & | changed, | ||
bool | useOgre, | ||
bool | not_used, | ||
unsigned int | width, | ||
unsigned int | height, | ||
const vpCameraParameters & | cam, | ||
const vpTranslationVector & | cameraPos, | ||
unsigned int | index | ||
) |
Compute the visibility of a given face index.
cMo | : The pose of the camera |
angleAppears | : Angle used to test the appearance of a face |
angleDisappears | : Angle used to test the disappearance of a face |
changed | : True if a face appeared, disappeared or too many points have been lost. False otherwise. |
useOgre | : True if a Ogre is used to test the visibility, False otherwise. |
not_used | : Unused parameter. |
width,height | Image size. |
cam | : Camera parameters. |
cameraPos | : Position of the camera. Used only when Ogre is used as 3rd party. |
index | : Index of the face to consider. |
Definition at line 566 of file vpMbHiddenFaces.h.
void vpMbHiddenFaces< PolygonType >::displayOgre | ( | const vpHomogeneousMatrix & | cMo | ) |
Update the display in Ogre Window.
cMo | : Pose used to display. |
Definition at line 746 of file vpMbHiddenFaces.h.
References vpAROgre::display(), and vpAROgre::isWindowHidden().
Referenced by vpMbEdgeTracker::display().
|
inline |
Get the ratio of visibility attempts that has to be successful to consider a polygon as visible.
Definition at line 165 of file vpMbHiddenFaces.h.
|
inline |
Definition at line 113 of file vpMbHiddenFaces.h.
Referenced by vpMbtFaceDepthDense::computeDesiredFeatures(), and vpMbtFaceDepthNormal::computeDesiredFeatures().
|
inline |
Get the number of rays that will be sent toward each polygon for visibility test. Each ray will go from the optic center of the camera to a random point inside the considered polygon.
Definition at line 147 of file vpMbHiddenFaces.h.
|
inline |
Get the number of visible polygons.
Definition at line 135 of file vpMbHiddenFaces.h.
|
inline |
Get the Ogre3D Context.
Definition at line 154 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::setFarClippingDistance(), vpMbTracker::setNearClippingDistance(), vpMbDepthDenseTracker::setOgreVisibilityTest(), vpMbDepthNormalTracker::setOgreVisibilityTest(), vpMbDepthDenseTracker::vpMbDepthDenseTracker(), vpMbDepthNormalTracker::vpMbDepthNormalTracker(), and vpMbEdgeTracker::vpMbEdgeTracker().
|
inline |
Get the list of polygons.
Definition at line 124 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpMbTracker::extractFaces(), vpMbTracker::extractLines(), vpMbTracker::getPolygonFaces(), and vpMbTracker::loadCAOModel().
void vpMbHiddenFaces< PolygonType >::initOgre | ( | const vpCameraParameters & | cam = vpCameraParameters() | ) |
Initialise the ogre context for face visibility tests.
cam | : Camera parameters. |
Definition at line 714 of file vpMbHiddenFaces.h.
References vpAROgre::getSceneManager(), vpAROgre::init(), vpAROgre::setCameraParameters(), and vpAROgre::setShowConfigDialog().
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbDepthDenseTracker::init(), vpMbDepthNormalTracker::init(), and vpMbEdgeTracker::init().
|
inline |
Definition at line 168 of file vpMbHiddenFaces.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), and vpMbEdgeTracker::computeVVSFirstPhaseFactor().
|
inline |
Tell whether if Ogre Context is initialised or not.
Definition at line 176 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbDepthDenseTracker::init(), vpMbDepthNormalTracker::init(), and vpMbEdgeTracker::init().
|
inline |
Check if the polygon at position i in the list is visible.
i | : TPosition in the list. |
Definition at line 186 of file vpMbHiddenFaces.h.
Referenced by vpMbtFaceDepthDense::computeVisibilityDisplay(), vpMbtFaceDepthNormal::computeVisibilityDisplay(), vpMbEdgeTracker::initMovingEdge(), and vpMbTracker::projectionErrorInitMovingEdge().
bool vpMbHiddenFaces< PolygonType >::isVisibleOgre | ( | const vpTranslationVector & | cameraPos, |
const unsigned int & | index | ||
) |
Test the visibility of a polygon through Ogre3D via RayCasting.
cameraPos | : Position of the camera in the 3D world. |
index | : Index of the polygon. |
Definition at line 807 of file vpMbHiddenFaces.h.
References vpAROgre::getCamera(), and vpAROgre::getSceneManager().
vpMbHiddenFaces< PolygonType > & vpMbHiddenFaces< PolygonType >::operator= | ( | vpMbHiddenFaces< PolygonType > | other | ) |
Copy assignment operator.
Definition at line 365 of file vpMbHiddenFaces.h.
|
inline |
Operator[] as modifier.
Definition at line 193 of file vpMbHiddenFaces.h.
|
inline |
Operator[] as reader.
Definition at line 195 of file vpMbHiddenFaces.h.
void vpMbHiddenFaces< PolygonType >::reset |
Reset the hidden faces (remove the list of PolygonType).
Definition at line 397 of file vpMbHiddenFaces.h.
Referenced by vpMbEdgeTracker::reInitModel(), vpMbDepthDenseTracker::resetTracker(), vpMbDepthNormalTracker::resetTracker(), and vpMbEdgeTracker::resetTracker().
|
inline |
Set the background size (by default it is 640x480). The background size has to match with the size of the image that you are using for the tracking.
h | : Height of the background |
w | : Width of the background |
Definition at line 210 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbDepthDenseTracker::init(), vpMbDepthNormalTracker::init(), and vpMbEdgeTracker::init().
|
inline |
Set the ratio of visibility attempts that has to be successful to consider a polygon as visible.
ratio | : Ratio of successful attempts that has to be considered. Value has to be between 0.0 (0%) and 1.0 (100%). |
Definition at line 235 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::setGoodNbRayCastingAttemptsRatio().
|
inline |
Set the number of rays that will be sent toward each polygon for visibility test. Each ray will go from the optic center of the camera to a random point inside the considered polygon.
attempts | Number of rays to be sent. |
Definition at line 224 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::setNbRayCastingAttemptsForVisibility().
|
inline |
Enable/Disable the appearance of Ogre config dialog on startup.
showConfigDialog | : if true, shows Ogre dialog window (used to set Ogre rendering options) when Ogre visibility is enabled. By default, this functionality is turned off. |
Definition at line 253 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::computeProjectionErrorImpl(), vpMbDepthDenseTracker::init(), vpMbDepthNormalTracker::init(), and vpMbEdgeTracker::init().
unsigned int vpMbHiddenFaces< PolygonType >::setVisible | ( | const vpHomogeneousMatrix & | cMo, |
const double & | angleAppears, | ||
const double & | angleDisappears, | ||
bool & | changed | ||
) |
Compute the number of visible polygons.
cMo | : The pose of the camera |
angleAppears | : Angle used to test the appearance of a face |
angleDisappears | : Angle used to test the disappearance of a face |
changed | : True if a face appeared, disappeared or too many points have been lost. False otherwise |
Definition at line 702 of file vpMbHiddenFaces.h.
unsigned int vpMbHiddenFaces< PolygonType >::setVisible | ( | unsigned int | width, |
unsigned int | height, | ||
const vpCameraParameters & | cam, | ||
const vpHomogeneousMatrix & | cMo, | ||
const double & | angle, | ||
bool & | changed | ||
) |
Compute the number of visible polygons.
width,height | : Image size used to check if the region of interest is inside the image. |
cam | : Camera parameters. |
cMo | : The pose of the camera. |
angle | : Angle used to test the appearance and disappearance of a face. |
changed | : True if a face appeared, disappeared or too many points have been lost. False otherwise. |
Definition at line 663 of file vpMbHiddenFaces.h.
Referenced by vpMbDepthDenseTracker::computeVisibility(), vpMbDepthNormalTracker::computeVisibility(), vpMbDepthDenseTracker::getModelForDisplay(), vpMbDepthNormalTracker::getModelForDisplay(), vpMbDepthDenseTracker::init(), vpMbDepthNormalTracker::init(), vpMbTracker::projectionErrorVisibleFace(), and vpMbEdgeTracker::visibleFace().
unsigned int vpMbHiddenFaces< PolygonType >::setVisible | ( | unsigned int | width, |
unsigned int | height, | ||
const vpCameraParameters & | cam, | ||
const vpHomogeneousMatrix & | cMo, | ||
const double & | angleAppears, | ||
const double & | angleDisappears, | ||
bool & | changed | ||
) |
Compute the number of visible polygons.
width,height | : Image size used to check if the region of interest is inside the image. |
cam | : Camera parameters. |
cMo | : The pose of the camera. |
changed | : True if a face appeared, disappeared or too many points have been lost. False otherwise. |
angleAppears | : Angle used to test the appearance of a face. |
angleDisappears | : Angle used to test the disappearance of a face. |
Definition at line 683 of file vpMbHiddenFaces.h.
unsigned int vpMbHiddenFaces< PolygonType >::setVisibleOgre | ( | const vpHomogeneousMatrix & | cMo, |
const double & | angleAppears, | ||
const double & | angleDisappears, | ||
bool & | changed | ||
) |
Compute the number of visible polygons through Ogre3D.
cMo | : The pose of the camera |
angleAppears | : Angle used to test the appearance of a face |
angleDisappears | : Angle used to test the disappearance of a face |
changed | : True if a face appeared, disappeared or too many points have been lost. False otherwise |
Definition at line 792 of file vpMbHiddenFaces.h.
unsigned int vpMbHiddenFaces< PolygonType >::setVisibleOgre | ( | unsigned int | width, |
unsigned int | height, | ||
const vpCameraParameters & | cam, | ||
const vpHomogeneousMatrix & | cMo, | ||
const double & | angleAppears, | ||
const double & | angleDisappears, | ||
bool & | changed | ||
) |
Compute the number of visible polygons through Ogre3D.
width,height | : Image size used to check if the region of interest is inside the image. |
cam | : Camera parameters. |
cMo | : The pose of the camera. |
changed | : True if a face appeared, disappeared or too many points have been lost. False otherwise. |
angleAppears | : Angle used to test the appearance of a face. |
angleDisappears | : Angle used to test the disappearance of a face. |
Definition at line 773 of file vpMbHiddenFaces.h.
Referenced by vpMbDepthDenseTracker::init(), vpMbDepthNormalTracker::init(), vpMbTracker::projectionErrorVisibleFace(), and vpMbEdgeTracker::visibleFace().
|
inline |
Get the number of polygons.
Definition at line 276 of file vpMbHiddenFaces.h.
Referenced by vpMbTracker::getNbPolygon(), vpMbTracker::getPolygon(), vpMbTracker::loadModel(), vpMbTracker::loadVRMLModel(), vpMbTracker::setClipping(), vpMbTracker::setFarClippingDistance(), vpMbTracker::setLod(), vpMbTracker::setMinLineLengthThresh(), vpMbTracker::setMinPolygonAreaThresh(), and vpMbTracker::setNearClippingDistance().
|
friend |
Definition at line 345 of file vpMbHiddenFaces.h.