![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpDetectorQRCode.h>
Public Member Functions | |
| vpDetectorQRCode () | |
| bool | detect (const vpImage< unsigned char > &I) VP_OVERRIDE |
Protected Attributes | |
| zbar::ImageScanner | m_scanner |
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) |
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:
Tutorials
If you are interested in QR code detection, you may have a look at:
Definition at line 119 of file vpDetectorQRCode.h.
| BEGIN_VISP_NAMESPACE vpDetectorQRCode::vpDetectorQRCode | ( | ) |
|
virtual |
Detect QR codes in the image. Return true if a code is detected, false otherwise.
| I | : Input image. |
Implements vpDetectorBase.
Definition at line 56 of file vpDetectorQRCode.cpp.
References vpDetectorBase::m_message, vpDetectorBase::m_nb_objects, vpDetectorBase::m_polygon, and m_scanner.
Referenced by visp.python.rbt.xfeat.XFeatTrackingBackend.XFeatTrackingBackend::process_frame().
|
inherited |
Return the bounding box of the ith object.
Definition at line 92 of file vpDetectorBase.cpp.
References m_polygon.
Referenced by detect().
|
inherited |
Return the center of gravity location of the ith object.
Definition at line 78 of file vpDetectorBase.cpp.
References m_polygon.
Referenced by detect().
|
inlineinherited |
Returns the contained message of the ith object if there is one.
Definition at line 98 of file vpDetectorBase.h.
References m_message.
|
inherited |
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.
|
inlineinherited |
Return the number of objects that are detected.
Definition at line 108 of file vpDetectorBase.h.
References m_nb_objects.
|
inlineinherited |
Returns object container box as a vector of points.
Definition at line 113 of file vpDetectorBase.h.
References m_polygon.
|
inherited |
Returns ith object container box as a vector of points.
Definition at line 50 of file vpDetectorBase.cpp.
References vpException::badValue, and 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.
References m_timeout_ms.
Referenced by vpDetectorDataMatrixCode::vpDetectorDataMatrixCode().
|
protectedinherited |
Message attached to each object.
Definition at line 129 of file vpDetectorBase.h.
Referenced by vpDetectorAprilTag::detect(), vpDetectorAprilTag::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorFace::detect(), vpDetectorQRCode::detect(), getMessage(), getMessage(), vpDetectorBase(), and vpDetectorBase().
|
protectedinherited |
Number of detected objects.
Definition at line 130 of file vpDetectorBase.h.
Referenced by vpDetectorAprilTag::detect(), vpDetectorAprilTag::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorFace::detect(), vpDetectorQRCode::detect(), getNbObjects(), vpDetectorBase(), and vpDetectorBase().
|
protectedinherited |
For each object, defines the polygon that contains the object.
Definition at line 128 of file vpDetectorBase.h.
Referenced by vpDetectorAprilTag::detect(), vpDetectorAprilTag::detect(), vpDetectorDataMatrixCode::detect(), vpDetectorFace::detect(), vpDetectorQRCode::detect(), getBBox(), getCog(), getMessage(), getPolygon(), getPolygon(), vpDetectorAprilTag::getTagsCorners(), vpDetectorBase(), and vpDetectorBase().
|
protected |
QR code detector.
Definition at line 122 of file vpDetectorQRCode.h.
Referenced by detect(), and vpDetectorQRCode().
|
protectedinherited |
Detection timeout.
Definition at line 131 of file vpDetectorBase.h.
Referenced by vpDetectorDataMatrixCode::detect(), setTimeout(), vpDetectorBase(), and vpDetectorBase().