![]() |
Visual Servoing Platform
version 3.2.0
|
#include <vpDetectorQRCode.h>
Public Member Functions | |
vpDetectorQRCode () | |
virtual | ~vpDetectorQRCode () |
bool | detect (const vpImage< unsigned char > &I) |
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 | |
zbar::ImageScanner | m_scanner |
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 libzbar available from http://zbar.sourceforge.net. Installation instructions are provided here https://visp.inria.fr/3rd_zbar.
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 vpDetectorQRCode.h.
vpDetectorQRCode::vpDetectorQRCode | ( | ) |
Default constructor.
Definition at line 47 of file vpDetectorQRCode.cpp.
|
inlinevirtual |
Definition at line 120 of file vpDetectorQRCode.h.
|
virtual |
Detect QR codes in the image. Return true if a code is detected, false otherwise.
I | : Input image. |
Implements vpDetectorBase.
Definition at line 59 of file vpDetectorQRCode.cpp.
|
inherited |
Return the bounding box of the ith object.
Definition at line 86 of file vpDetectorBase.cpp.
|
inherited |
Return the center of gravity location of the ith object.
Definition at line 73 of file vpDetectorBase.cpp.
|
inlineinherited |
Returns the contained message of the ith object if there is one.
Definition at line 106 of file vpDetectorBase.h.
|
inherited |
Returns the contained message of the ith object if there is one.
Definition at line 61 of file vpDetectorBase.cpp.
|
inlineinherited |
Return the number of objects that are detected.
Definition at line 116 of file vpDetectorBase.h.
|
inlineinherited |
Returns object container box as a vector of points.
Definition at line 121 of file vpDetectorBase.h.
|
inherited |
Returns ith object container box as a vector of points.
Definition at line 49 of file vpDetectorBase.cpp.
|
protectedinherited |
Message attached to each object.
Definition at line 70 of file vpDetectorBase.h.
|
protectedinherited |
Number of detected objects.
Definition at line 71 of file vpDetectorBase.h.
|
protectedinherited |
For each object, defines the polygon that contains the object.
Definition at line 66 of file vpDetectorBase.h.
|
protected |
QR code detector.
Definition at line 116 of file vpDetectorQRCode.h.