ViSP
2.10.0
|
#include <vpDetectorDataMatrixCode.h>
Public Member Functions | |
vpDetectorDataMatrixCode () | |
virtual | ~vpDetectorDataMatrixCode () |
bool | detect (const vpImage< unsigned char > &I) |
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 |
Base class for bar code detector. This class is a wrapper over libdmtx available from http://www.libdmtx.org/
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 113 of file vpDetectorDataMatrixCode.h.
vpDetectorDataMatrixCode::vpDetectorDataMatrixCode | ( | ) |
Default constructor that does nothing.
Definition at line 54 of file vpDetectorDataMatrixCode.cpp.
|
inlinevirtual |
Definition at line 117 of file vpDetectorDataMatrixCode.h.
|
virtual |
Detect datamatrix bar codes in the image. Return true if a bar code is detected, false otherwise.
I | : Input image. |
Implements vpDetectorBase.
Definition at line 63 of file vpDetectorDataMatrixCode.cpp.
References vpImage< Type >::bitmap, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpDetectorBase::m_message, vpDetectorBase::m_nb_objects, and vpDetectorBase::m_polygon.
|
inlineinherited |
Return the bounding box of the ith object.
Definition at line 141 of file vpDetectorBase.h.
|
inlineinherited |
Return the center of gravity location of the ith object.
Definition at line 129 of file vpDetectorBase.h.
|
inlineinherited |
Returns the contained message of the ith object if there is one.
Definition at line 108 of file vpDetectorBase.h.
References vpException::badValue.
|
inlineinherited |
Returns the contained message of the ith object if there is one.
Definition at line 118 of file vpDetectorBase.h.
|
inlineinherited |
Return the number of objects that are detected.
Definition at line 125 of file vpDetectorBase.h.
|
inlineinherited |
Returns object container box as a vector of points.
Definition at line 90 of file vpDetectorBase.h.
|
inlineinherited |
Returns ith object container box as a vector of points.
Definition at line 98 of file vpDetectorBase.h.
References vpException::badValue.
|
protectedinherited |
Message attached to each object.
Definition at line 68 of file vpDetectorBase.h.
Referenced by vpDetectorFace::detect(), detect(), and vpDetectorQRCode::detect().
|
protectedinherited |
Number of detected objects.
Definition at line 69 of file vpDetectorBase.h.
Referenced by vpDetectorFace::detect(), detect(), and vpDetectorQRCode::detect().
|
protectedinherited |
For each object, defines the polygon that contains the object.
Definition at line 67 of file vpDetectorBase.h.
Referenced by vpDetectorFace::detect(), detect(), and vpDetectorQRCode::detect().