Visual Servoing Platform  version 3.1.0

#include <visp3/detection/vpDetectorBase.h>

+ Inheritance diagram for vpDetectorBase:

Public Member Functions

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

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:

testAprilTag.cpp, tutorial-apriltag-detector-live.cpp, tutorial-apriltag-detector.cpp, tutorial-barcode-detector-live.cpp, and tutorial-barcode-detector.cpp.

Definition at line 64 of file vpDetectorBase.h.

Constructor & Destructor Documentation

◆ vpDetectorBase()

vpDetectorBase::vpDetectorBase ( )

Default constructor.

Definition at line 45 of file vpDetectorBase.cpp.

◆ ~vpDetectorBase()

virtual vpDetectorBase::~vpDetectorBase ( )

Default destructor.

Definition at line 82 of file vpDetectorBase.h.

Member Function Documentation

◆ detect()

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

Detect objects in an image.

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

Implemented in vpDetectorAprilTag, vpDetectorQRCode, vpDetectorDataMatrixCode, and vpDetectorFace.

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

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

◆ getBBox()

◆ getCog()

vpImagePoint vpDetectorBase::getCog ( size_t  i) const

Return the center of gravity location of the ith object.

Definition at line 74 of file vpDetectorBase.cpp.

References m_polygon.

◆ getMessage() [1/2]

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

◆ getMessage() [2/2]

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

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

Definition at line 62 of file vpDetectorBase.cpp.

References vpException::badValue, m_message, and m_polygon.

◆ getNbObjects()

◆ getPolygon() [1/2]

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

◆ getPolygon() [2/2]

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

Returns ith object container box as a vector of points.

Definition at line 50 of file vpDetectorBase.cpp.

References vpException::badValue, and m_polygon.

Member Data Documentation

◆ m_message

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

◆ m_nb_objects

size_t vpDetectorBase::m_nb_objects

◆ m_polygon

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

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

Definition at line 67 of file vpDetectorBase.h.

Referenced by vpDetectorFace::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorQRCode::detect(), vpDetectorAprilTag::detect(), getBBox(), getCog(), getMessage(), and getPolygon().