ViSP  2.10.0
vpDetectorBase Class Referenceabstract

#include <vpDetectorBase.h>

+ Inheritance diagram for vpDetectorBase:

Public Member Functions

 vpDetectorBase ()
 
virtual ~vpDetectorBase ()
 
virtual bool detect (const vpImage< unsigned char > &I)=0
 
std::vector< std::vector< vpImagePoint > > & getPolygon ()
 
std::vector< vpImagePoint > & getPolygon (size_t i)
 
std::string & getMessage (size_t i)
 
std::vector< std::string > & getMessage ()
 
size_t getNbObjects () const
 
vpImagePoint getCog (size_t i) const
 
vpRect getBBox (size_t i) const
 

Protected Attributes

std::vector< std::vector< vpImagePoint > > m_polygon
 
std::vector< std::string > m_message
 
size_t m_nb_objects
 

Detailed Description

Base class for object detection.

This class is a generic class that can be used to detect:

Examples:
tutorial-barcode-detector-live.cpp, and tutorial-barcode-detector.cpp.

Definition at line 64 of file vpDetectorBase.h.

Constructor & Destructor Documentation

vpDetectorBase::vpDetectorBase ( )
inline

Default constructor.

Definition at line 75 of file vpDetectorBase.h.

virtual vpDetectorBase::~vpDetectorBase ( )
inlinevirtual

Default destructor.

Definition at line 79 of file vpDetectorBase.h.

Member Function Documentation

virtual bool vpDetectorBase::detect ( const vpImage< unsigned char > &  I)
pure virtual

Detect objects in an image.

Parameters
I: Image where to detect objects.
Returns
true if one or multiple objects are detected, false otherwise.

Implemented in vpDetectorQRCode, vpDetectorDataMatrixCode, and vpDetectorFace.

Examples:
tutorial-barcode-detector-live.cpp, and tutorial-barcode-detector.cpp.
vpRect vpDetectorBase::getBBox ( size_t  i) const
inline

Return the bounding box of the ith object.

Examples:
tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-face-detector-live.cpp, and tutorial-face-detector.cpp.

Definition at line 141 of file vpDetectorBase.h.

vpImagePoint vpDetectorBase::getCog ( size_t  i) const
inline

Return the center of gravity location of the ith object.

Definition at line 129 of file vpDetectorBase.h.

std::string& vpDetectorBase::getMessage ( size_t  i)
inline

Returns the contained message of the ith object if there is one.

Examples:
tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-face-detector-live.cpp, and tutorial-face-detector.cpp.

Definition at line 108 of file vpDetectorBase.h.

References vpException::badValue.

std::vector< std::string >& vpDetectorBase::getMessage ( )
inline

Returns the contained message of the ith object if there is one.

Definition at line 118 of file vpDetectorBase.h.

size_t vpDetectorBase::getNbObjects ( ) const
inline

Return the number of objects that are detected.

Examples:
tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-face-detector-live.cpp, and tutorial-face-detector.cpp.

Definition at line 125 of file vpDetectorBase.h.

std::vector< std::vector<vpImagePoint> >& vpDetectorBase::getPolygon ( )
inline

Returns object container box as a vector of points.

Examples:
tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-face-detector-live.cpp, and tutorial-face-detector.cpp.

Definition at line 90 of file vpDetectorBase.h.

std::vector<vpImagePoint>& vpDetectorBase::getPolygon ( size_t  i)
inline

Returns ith object container box as a vector of points.

Definition at line 98 of file vpDetectorBase.h.

References vpException::badValue.

Member Data Documentation

std::vector< std::string > vpDetectorBase::m_message
protected

Message attached to each object.

Definition at line 68 of file vpDetectorBase.h.

Referenced by vpDetectorFace::detect(), vpDetectorDataMatrixCode::detect(), and vpDetectorQRCode::detect().

size_t vpDetectorBase::m_nb_objects
protected

Number of detected objects.

Definition at line 69 of file vpDetectorBase.h.

Referenced by vpDetectorFace::detect(), vpDetectorDataMatrixCode::detect(), and vpDetectorQRCode::detect().

std::vector< std::vector<vpImagePoint> > vpDetectorBase::m_polygon
protected

For each object, defines the polygon that contains the object.

Definition at line 67 of file vpDetectorBase.h.

Referenced by vpDetectorFace::detect(), vpDetectorDataMatrixCode::detect(), and vpDetectorQRCode::detect().