Visual Servoing Platform
version 3.6.1 under development (2024-12-17)
|
#include <visp3/detection/vpDetectorDataMatrixCode.h>
Public Member Functions | |
vpDetectorDataMatrixCode () | |
bool | detect (const vpImage< unsigned char > &I) VP_OVERRIDE |
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) |
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 bar code detector. This class is a wrapper over libdmtx available from http://www.libdmtx.org. Installation instructions are provided here https://visp.inria.fr/3rd_dmtx.
The detect() function allows to detect multiple QR codes in an image. Once detected, for each QR code it is possible to retrieve the location of the corners using getPolygon(), the encoded message using getMessage(), the bounding box using getBBox() and the center of gravity using getCog().
The following sample code shows how to use this class to detect QR codes in an image.
The previous example may produce results like:
Other examples are also provided in tutorial-barcode-detector.cpp and tutorial-barcode-detector-live.cpp
Definition at line 114 of file vpDetectorDataMatrixCode.h.
BEGIN_VISP_NAMESPACE vpDetectorDataMatrixCode::vpDetectorDataMatrixCode | ( | ) |
Default constructor that does nothing except setting detection timeout to 50ms. This value could be changed using setTimeout().
Definition at line 51 of file vpDetectorDataMatrixCode.cpp.
References vpDetectorBase::setTimeout().
|
virtual |
Detect datamatrix codes in the image. Return true if a code is detected, false otherwise. There is the setTimeout() function that allows to tune the value of the timeout used to detect a datamatrix code. By default, there is a timeout of 50 ms set in the constructor.
I | : Input image. |
Implements vpDetectorBase.
Definition at line 60 of file vpDetectorDataMatrixCode.cpp.
References vpImage< Type >::bitmap, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpDetectorBase::m_message, vpDetectorBase::m_nb_objects, vpDetectorBase::m_polygon, and vpDetectorBase::m_timeout_ms.
|
inherited |
Return the bounding box of the ith object.
Definition at line 93 of file vpDetectorBase.cpp.
References vpDetectorBase::m_polygon.
|
inherited |
Return the center of gravity location of the ith object.
Definition at line 79 of file vpDetectorBase.cpp.
References vpDetectorBase::m_polygon.
|
inlineinherited |
Returns the contained message of the ith object if there is one.
Definition at line 98 of file vpDetectorBase.h.
|
inherited |
Returns the contained message of the ith object if there is one.
Definition at line 65 of file vpDetectorBase.cpp.
References vpException::badValue, vpDetectorBase::m_message, and vpDetectorBase::m_polygon.
|
inlineinherited |
Return the number of objects that are detected.
Definition at line 108 of file vpDetectorBase.h.
|
inlineinherited |
Returns object container box as a vector of points.
Definition at line 113 of file vpDetectorBase.h.
|
inherited |
Returns ith object container box as a vector of points.
Definition at line 51 of file vpDetectorBase.cpp.
References vpException::badValue, and vpDetectorBase::m_polygon.
|
inlineinherited |
Set detector timeout in milli-seconds. When set to 0, there is no timeout.
Definition at line 123 of file vpDetectorBase.h.
Referenced by vpDetectorDataMatrixCode().
|
protectedinherited |
Message attached to each object.
Definition at line 129 of file vpDetectorBase.h.
Referenced by vpDetectorFace::detect(), vpDetectorAprilTag::detect(), detect(), and vpDetectorBase::getMessage().
|
protectedinherited |
Number of detected objects.
Definition at line 130 of file vpDetectorBase.h.
Referenced by vpDetectorFace::detect(), vpDetectorAprilTag::detect(), and detect().
|
protectedinherited |
For each object, defines the polygon that contains the object.
Definition at line 128 of file vpDetectorBase.h.
Referenced by vpDetectorFace::detect(), vpDetectorAprilTag::detect(), detect(), vpDetectorBase::getBBox(), vpDetectorBase::getCog(), vpDetectorBase::getMessage(), vpDetectorBase::getPolygon(), and vpDetectorAprilTag::getTagsCorners().
|
protectedinherited |