Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches

#include <vpDetectorBase.h>

Inheritance diagram for vpDetectorBase:

Public Member Functions

 vpDetectorBase ()
 vpDetectorBase (const vpDetectorBase &o)
virtual ~vpDetectorBase ()
virtual bool detect (const vpImage< unsigned char > &I)=0

Inherited functionalities from vpDetectorBase

std::vector< std::vector< vpImagePoint > > m_polygon
std::vector< std::string > m_message
size_t m_nb_objects
unsigned long m_timeout_ms
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)
void setTimeout (unsigned long timeout_ms)

Detailed Description

Base class for object detection.

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

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

Definition at line 62 of file vpDetectorBase.h.

Constructor & Destructor Documentation

◆ vpDetectorBase() [1/2]

BEGIN_VISP_NAMESPACE vpDetectorBase::vpDetectorBase ( )

Default constructor.

Definition at line 41 of file vpDetectorBase.cpp.

References m_message, m_nb_objects, m_polygon, and m_timeout_ms.

Referenced by vpDetectorAprilTag::vpDetectorAprilTag(), and vpDetectorBase().

◆ vpDetectorBase() [2/2]

vpDetectorBase::vpDetectorBase ( const vpDetectorBase & o)

Definition at line 43 of file vpDetectorBase.cpp.

References m_message, m_nb_objects, m_polygon, m_timeout_ms, and vpDetectorBase().

◆ ~vpDetectorBase()

virtual vpDetectorBase::~vpDetectorBase ( )
inlinevirtual

Default destructor.

Definition at line 73 of file vpDetectorBase.h.

Member Function Documentation

◆ detect()

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 vpDetectorAprilTag, vpDetectorDataMatrixCode, vpDetectorFace, and vpDetectorQRCode.

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

References getBBox(), and getCog().

Referenced by visp.python.rbt.xfeat.XFeatTrackingBackend.XFeatTrackingBackend::process_frame().

◆ getBBox()

vpRect vpDetectorBase::getBBox ( size_t i) const

◆ getCog()

vpImagePoint vpDetectorBase::getCog ( size_t i) const

Return the center of gravity location of the ith object.

Examples
servoBiclopsPoint2DArtVelocity.cpp, servoPololuPtuPoint2DJointVelocity.cpp, and tutorial-flir-ptu-ibvs.cpp.

Definition at line 78 of file vpDetectorBase.cpp.

References m_polygon.

Referenced by detect().

◆ getMessage() [1/2]

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

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

Examples
catchAprilTag.cpp, catchArUco.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, tutorial-face-detector-live.cpp, and tutorial-face-detector.cpp.

Definition at line 98 of file vpDetectorBase.h.

References m_message.

◆ 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 64 of file vpDetectorBase.cpp.

References vpException::badValue, m_message, and m_polygon.

◆ getNbObjects()

◆ getPolygon() [1/2]

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

Returns object container box as a vector of points.

Examples
catchAprilTag.cpp, tutorial-barcode-detector-live.cpp, tutorial-barcode-detector.cpp, and tutorial-pose-from-qrcode-image.cpp.

Definition at line 113 of file vpDetectorBase.h.

References m_polygon.

◆ 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.

◆ setTimeout()

void vpDetectorBase::setTimeout ( unsigned long timeout_ms)
inline

Set detector timeout in milli-seconds. When set to 0, there is no timeout.

Definition at line 123 of file vpDetectorBase.h.

References m_timeout_ms.

Referenced by vpDetectorDataMatrixCode::vpDetectorDataMatrixCode().

Member Data Documentation

◆ m_message

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

◆ m_nb_objects

size_t vpDetectorBase::m_nb_objects
protected

◆ m_polygon

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

◆ m_timeout_ms

unsigned long vpDetectorBase::m_timeout_ms
protected

Detection timeout.

Definition at line 131 of file vpDetectorBase.h.

Referenced by vpDetectorDataMatrixCode::detect(), setTimeout(), vpDetectorBase(), and vpDetectorBase().