ViSP  2.8.0
vpMbHiddenFaces< PolygonType > Class Template Reference

#include <vpMbHiddenFaces.h>

Public Member Functions

 vpMbHiddenFaces ()
 
 ~vpMbHiddenFaces ()
 
void addPolygon (PolygonType *p)
 
void displayOgre (const vpHomogeneousMatrix &_cMo)
 
std::vector< PolygonType * > & getPolygon ()
 
void initOgre (vpCameraParameters _cam=vpCameraParameters())
 
unsigned int getNbVisiblePolygon () const
 
vpAROgregetOgreContext ()
 
bool isAppearing (const unsigned int i)
 
bool isOgreInitialised ()
 
bool isVisible (const unsigned int i)
 
bool isVisibleOgre (const vpTranslationVector &cameraPos, const unsigned int &index)
 
PolygonType * operator[] (const unsigned int i)
 
const PolygonType * operator[] (const unsigned int i) const
 
void reset ()
 
void setBackgroundSizeOgre (const unsigned int &h, const unsigned int &w)
 
unsigned int setVisible (const vpImage< unsigned char > &_I, const vpCameraParameters &_cam, const vpHomogeneousMatrix &_cMo, const double &angle, bool &changed)
 
unsigned int setVisible (const vpImage< unsigned char > &_I, 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 (const vpImage< unsigned char > &_I, 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
 
Deprecated functions
vp_deprecated bool getDepthTest ()
 
vp_deprecated void setDepthTest (const bool &d)
 
unsigned int setVisible (const vpHomogeneousMatrix &_cMo)
 

Public Attributes

bool depthTest
 

Detailed Description

template<class PolygonType = vpMbtPolygon>
class vpMbHiddenFaces< PolygonType >

Implementation of the polygons management for the model-based trackers.

Definition at line 67 of file vpMbHiddenFaces.h.

Constructor & Destructor Documentation

template<class PolygonType >
vpMbHiddenFaces< PolygonType >::vpMbHiddenFaces ( )

Basic constructor.

Definition at line 218 of file vpMbHiddenFaces.h.

References vpMbHiddenFaces< PolygonType >::depthTest, and vpAROgre::setShowConfigDialog().

template<class PolygonType >
vpMbHiddenFaces< PolygonType >::~vpMbHiddenFaces ( )

Basic destructor.

Definition at line 236 of file vpMbHiddenFaces.h.

Member Function Documentation

template<class PolygonType>
void vpMbHiddenFaces< PolygonType >::addPolygon ( PolygonType *  p)

Add a polygon to the list of polygons.

Parameters
p: The polygon to add.

Definition at line 258 of file vpMbHiddenFaces.h.

Referenced by vpMbEdgeTracker::addPolygon(), and vpMbKltTracker::initFaceFromCorners().

template<class PolygonType >
void vpMbHiddenFaces< PolygonType >::displayOgre ( const vpHomogeneousMatrix _cMo)

Update the display in Ogre Window.

Parameters
_cMo: Pose used to display.

Definition at line 489 of file vpMbHiddenFaces.h.

References vpAROgre::display(), and vpAROgre::isWindowHidden().

Referenced by vpMbEdgeKltTracker::display(), vpMbKltTracker::display(), and vpMbEdgeTracker::display().

template<class PolygonType = vpMbtPolygon>
vp_deprecated bool vpMbHiddenFaces< PolygonType >::getDepthTest ( )
inline
Deprecated:
This method is deprecated since it is no more used since ViSP 2.7.2.

Get the depthTest value.

Returns
true if all the points of a polygon has to be in front of the camera, false otherwise.

Definition at line 201 of file vpMbHiddenFaces.h.

template<class PolygonType = vpMbtPolygon>
unsigned int vpMbHiddenFaces< PolygonType >::getNbVisiblePolygon ( ) const
inline

get the number of visible polygons.

Returns
number of visible polygons.

Definition at line 116 of file vpMbHiddenFaces.h.

template<class PolygonType = vpMbtPolygon>
vpAROgre* vpMbHiddenFaces< PolygonType >::getOgreContext ( )
inline

Get the Ogre3D Context.

Returns
A pointer on a vpAROgre instance.

Definition at line 124 of file vpMbHiddenFaces.h.

Referenced by vpMbEdgeKltTracker::vpMbEdgeKltTracker(), vpMbEdgeTracker::vpMbEdgeTracker(), and vpMbKltTracker::vpMbKltTracker().

template<class PolygonType = vpMbtPolygon>
std::vector<PolygonType*>& vpMbHiddenFaces< PolygonType >::getPolygon ( )
inline

Get the list of polygons.

Returns
Mbt Klt polygons list.

Definition at line 105 of file vpMbHiddenFaces.h.

Referenced by vpMbKltTracker::initFaceFromCorners().

template<class PolygonType >
void vpMbHiddenFaces< PolygonType >::initOgre ( vpCameraParameters  _cam = vpCameraParameters())

Initialise the ogre context for face visibility tests.

Parameters
_cam: Camera parameters.

Definition at line 457 of file vpMbHiddenFaces.h.

References vpAROgre::getSceneManager(), vpAROgre::init(), and vpAROgre::setCameraParameters().

Referenced by vpMbKltTracker::init(), and vpMbEdgeTracker::init().

template<class PolygonType = vpMbtPolygon>
bool vpMbHiddenFaces< PolygonType >::isAppearing ( const unsigned int  i)
inline
template<class PolygonType = vpMbtPolygon>
bool vpMbHiddenFaces< PolygonType >::isOgreInitialised ( )
inline

Tell whether if Ogre Context is initialised or not.

Returns
True if it does, false otherwise.

Definition at line 136 of file vpMbHiddenFaces.h.

Referenced by vpMbKltTracker::init(), and vpMbEdgeTracker::init().

template<class PolygonType = vpMbtPolygon>
bool vpMbHiddenFaces< PolygonType >::isVisible ( const unsigned int  i)
inline

Check if the polygon at position i in the list is visible.

Parameters
i: TPosition in the list.
Returns
Return true if the polygon is visible.

Definition at line 146 of file vpMbHiddenFaces.h.

Referenced by vpMbEdgeKltTracker::display(), and vpMbEdgeTracker::initMovingEdge().

template<class PolygonType >
bool vpMbHiddenFaces< PolygonType >::isVisibleOgre ( const vpTranslationVector cameraPos,
const unsigned int &  index 
)

Test the visibility of a polygon through Ogre3D via RayCasting.

Parameters
cameraPos: Position of the camera in the 3D world.
index: Index of the polygon.
Returns
Return true if the polygon is visible, False otherwise.

Definition at line 549 of file vpMbHiddenFaces.h.

References vpAROgre::getCamera(), and vpAROgre::getSceneManager().

template<class PolygonType = vpMbtPolygon>
PolygonType* vpMbHiddenFaces< PolygonType >::operator[] ( const unsigned int  i)
inline

operator[] as modifier.

Definition at line 153 of file vpMbHiddenFaces.h.

template<class PolygonType = vpMbtPolygon>
const PolygonType* vpMbHiddenFaces< PolygonType >::operator[] ( const unsigned int  i) const
inline

operator[] as reader.

Definition at line 155 of file vpMbHiddenFaces.h.

template<class PolygonType >
void vpMbHiddenFaces< PolygonType >::reset ( )

Reset the Hidden faces (remove the list of PolygonType)

Definition at line 274 of file vpMbHiddenFaces.h.

Referenced by vpMbKltTracker::resetTracker(), and vpMbEdgeTracker::resetTracker().

template<class PolygonType = vpMbtPolygon>
void vpMbHiddenFaces< PolygonType >::setBackgroundSizeOgre ( const unsigned int &  h,
const unsigned int &  w 
)
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 traking.

Warning
This function has to be called before initOgre().
Parameters
h: Height of the background
w: Width of the background

Definition at line 169 of file vpMbHiddenFaces.h.

Referenced by vpMbKltTracker::init(), and vpMbEdgeTracker::init().

template<class PolygonType = vpMbtPolygon>
vp_deprecated void vpMbHiddenFaces< PolygonType >::setDepthTest ( const bool &  d)
inline
Deprecated:
This method is deprecated since it is no more used since ViSP 2.7.2.

Set the depthTest value.

Parameters
d: New value.

Definition at line 209 of file vpMbHiddenFaces.h.

template<class PolygonType >
unsigned int vpMbHiddenFaces< PolygonType >::setVisible ( const vpImage< unsigned char > &  _I,
const vpCameraParameters _cam,
const vpHomogeneousMatrix _cMo,
const double &  angle,
bool &  changed 
)

Compute the number of visible polygons.

Parameters
_I: Image 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
Returns
Return the number of visible polygons

Definition at line 408 of file vpMbHiddenFaces.h.

Referenced by vpMbKltTracker::init(), vpMbKltTracker::postTracking(), vpMbKltTracker::setPose(), and vpMbEdgeTracker::visibleFace().

template<class PolygonType >
unsigned int vpMbHiddenFaces< PolygonType >::setVisible ( const vpImage< unsigned char > &  _I,
const vpCameraParameters _cam,
const vpHomogeneousMatrix _cMo,
const double &  angleAppears,
const double &  angleDisappears,
bool &  changed 
)

Compute the number of visible polygons.

Parameters
_I: Image 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
Returns
Return the number of visible polygons

Definition at line 427 of file vpMbHiddenFaces.h.

template<class PolygonType >
unsigned int vpMbHiddenFaces< PolygonType >::setVisible ( const vpHomogeneousMatrix _cMo,
const double &  angleAppears,
const double &  angleDisappears,
bool &  changed 
)

Compute the number of visible polygons.

Parameters
_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
Returns
Return the number of visible polygons

Definition at line 444 of file vpMbHiddenFaces.h.

template<class PolygonType >
unsigned int vpMbHiddenFaces< PolygonType >::setVisible ( const vpHomogeneousMatrix _cMo)
Deprecated:
This method is deprecated since it is no more used since ViSP 2.7.2.

Compute the number of visible polygons.

Parameters
_cMo: The pose of the camera
Returns
Return the number of visible polygons

Definition at line 639 of file vpMbHiddenFaces.h.

template<class PolygonType >
unsigned int vpMbHiddenFaces< PolygonType >::setVisibleOgre ( const vpImage< unsigned char > &  _I,
const vpCameraParameters _cam,
const vpHomogeneousMatrix _cMo,
const double &  angleAppears,
const double &  angleDisappears,
bool &  changed 
)

Compute the number of visible polygons through Ogre3D.

Parameters
_I: Image 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
Returns
Return the number of visible polygons

Definition at line 517 of file vpMbHiddenFaces.h.

Referenced by vpMbKltTracker::init(), vpMbKltTracker::postTracking(), vpMbKltTracker::setPose(), and vpMbEdgeTracker::visibleFace().

template<class PolygonType >
unsigned int vpMbHiddenFaces< PolygonType >::setVisibleOgre ( const vpHomogeneousMatrix _cMo,
const double &  angleAppears,
const double &  angleDisappears,
bool &  changed 
)

Compute the number of visible polygons through Ogre3D.

Parameters
_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
Returns
Return the number of visible polygons

Definition at line 534 of file vpMbHiddenFaces.h.

Member Data Documentation

template<class PolygonType = vpMbtPolygon>
bool vpMbHiddenFaces< PolygonType >::depthTest

Boolean specifying if a polygon has to be entirely in front of the camera or not.

Definition at line 189 of file vpMbHiddenFaces.h.

Referenced by vpMbHiddenFaces< vpMbtKltPolygon >::getDepthTest(), and vpMbHiddenFaces< PolygonType >::vpMbHiddenFaces().