Visual Servoing Platform
version 3.4.0
|
#include <vpDetectorBase.h>
Public Member Functions | |
vpDetectorBase () | |
vpDetectorBase (const vpDetectorBase &o) | |
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) |
void | setTimeout (unsigned long timeout_ms) |
Protected Attributes | |
std::vector< std::vector< vpImagePoint > > | m_polygon |
std::vector< std::string > | m_message |
size_t | m_nb_objects |
unsigned long | m_timeout_ms |
Base class for object detection.
This class is a generic class that can be used to detect:
Definition at line 64 of file vpDetectorBase.h.
vpDetectorBase::vpDetectorBase | ( | ) |
Default constructor.
Definition at line 45 of file vpDetectorBase.cpp.
vpDetectorBase::vpDetectorBase | ( | const vpDetectorBase & | o | ) |
Definition at line 47 of file vpDetectorBase.cpp.
|
inlinevirtual |
Default destructor.
Definition at line 81 of file vpDetectorBase.h.
|
pure virtual |
Detect objects in an image.
I | : Image where to detect objects. |
Implemented in vpDetectorAprilTag, vpDetectorQRCode, vpDetectorDataMatrixCode, and vpDetectorDNN.
Referenced by vpDetectorDataMatrixCode::~vpDetectorDataMatrixCode(), and vpDetectorQRCode::~vpDetectorQRCode().
vpRect vpDetectorBase::getBBox | ( | size_t | i | ) | const |
Return the bounding box of the ith object.
Definition at line 92 of file vpDetectorBase.cpp.
References m_polygon.
vpImagePoint vpDetectorBase::getCog | ( | size_t | i | ) | const |
Return the center of gravity location of the ith object.
Definition at line 79 of file vpDetectorBase.cpp.
References m_polygon.
|
inline |
Returns the contained message of the ith object if there is one.
Definition at line 106 of file vpDetectorBase.h.
std::string & vpDetectorBase::getMessage | ( | size_t | i | ) |
Returns the contained message of the ith object if there is one.
Definition at line 67 of file vpDetectorBase.cpp.
References vpException::badValue, m_message, and m_polygon.
|
inline |
Return the number of objects that are detected.
Definition at line 116 of file vpDetectorBase.h.
|
inline |
Returns object container box as a vector of points.
Definition at line 121 of file vpDetectorBase.h.
std::vector< vpImagePoint > & vpDetectorBase::getPolygon | ( | size_t | i | ) |
Returns ith object container box as a vector of points.
Definition at line 55 of file vpDetectorBase.cpp.
References vpException::badValue, and m_polygon.
|
inline |
Set detector timeout in milli-seconds. When set to 0, there is no timeout.
Definition at line 129 of file vpDetectorBase.h.
Referenced by vpDetectorDataMatrixCode::vpDetectorDataMatrixCode().
|
protected |
Message attached to each object.
Definition at line 68 of file vpDetectorBase.h.
Referenced by vpDetectorDNN::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorQRCode::detect(), vpDetectorAprilTag::detect(), and getMessage().
|
protected |
Number of detected objects.
Definition at line 69 of file vpDetectorBase.h.
Referenced by vpDetectorDNN::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorQRCode::detect(), and vpDetectorAprilTag::detect().
|
protected |
For each object, defines the polygon that contains the object.
Definition at line 67 of file vpDetectorBase.h.
Referenced by vpDetectorDNN::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorQRCode::detect(), vpDetectorAprilTag::detect(), getBBox(), getCog(), getMessage(), getPolygon(), and vpDetectorAprilTag::getTagsCorners().
|
protected |
Detection timeout.
Definition at line 70 of file vpDetectorBase.h.
Referenced by vpDetectorDataMatrixCode::detect().