JeVoisBase  1.5
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
DemoQRcode Class Reference

Simple demo of QRcode and barcode detection and decoding using the ZBar library. More...

Inheritance diagram for DemoQRcode:
Collaboration diagram for DemoQRcode:

Public Member Functions

 DemoQRcode (std::string const &instance)
 Constructor. More...
 
virtual ~DemoQRcode ()
 Virtual destructor for safe inheritance. More...
 
virtual void process (jevois::InputFrame &&inframe) override
 Processing function, no video output. More...
 
virtual void process (jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
 Processing function with video output to USB. More...
 
- Public Member Functions inherited from jevois::StdModule
 StdModule (std::string const &instance)
 
virtual ~StdModule ()
 
void sendSerialImg1Dx (unsigned int camw, float x, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd1Dx (float x, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialImg1Dy (unsigned int camh, float y, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd1Dy (float y, float size=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialImg2D (unsigned int camw, unsigned int camh, float x, float y, float w=0.0F, float h=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd2D (float x, float y, float w=0.0F, float h=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialContour2D (unsigned int camw, unsigned int camh, std::vector< cv::Point_< T > > points, std::string const &id="", std::string const &extra="")
 
void sendSerialStd3D (float x, float y, float z, float w=0.0F, float h=0.0F, float d=0.0F, float q1=0.0F, float q2=0.0F, float q3=0.0f, float q4=0.0F, std::string const &id="", std::string const &extra="")
 
void sendSerialStd3D (std::vector< cv::Point3f > points, std::string const &id="", std::string const &extra="")
 
- Public Member Functions inherited from jevois::Module
 Module (std::string const &instance)
 
virtual ~Module ()
 
virtual void sendSerial (std::string const &str)
 
virtual void parseSerial (std::string const &str, std::shared_ptr< UserInterface > s)
 
virtual void supportedCommands (std::ostream &os)
 
 JEVOIS_DEFINE_ENUM_CLASS (SerStyle,(Terse)(Normal)(Detail)(Fine)) JEVOIS_DECLARE_PARAMETER(serstyle
 
 JEVOIS_DECLARE_PARAMETER (serprec, unsigned int, "Number of decimal points in standardized serial messages as " "defined in http://jevois.org/doc/UserSerialStyle.html", 0U, ParamCateg)
 
- Public Member Functions inherited from jevois::Component
 Component (std::string const &instance)
 
virtual ~Component ()
 
std::shared_ptr< ComponentgetSubComponent (std::string const &instance) const
 
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 
void removeSubComponent (std::shared_ptr< Comp > &component)
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 
bool isTopLevel () const
 
bool initialized () const
 
std::string const & className () const
 
std::string const & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor)
 
void unFreezeParam (std::string const &paramdescriptor)
 
void freezeAllParams ()
 
void unFreezeAllParams ()
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
void setPath (std::string const &path)
 
std::string absolutePath (std::string const &path="")
 
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 
void removeSubComponent (std::shared_ptr< Comp > &component)
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 
bool isTopLevel () const
 
bool initialized () const
 
std::string const & className () const
 
std::string const & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor)
 
void unFreezeParam (std::string const &paramdescriptor)
 
void freezeAllParams ()
 
void unFreezeAllParams ()
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
void setPath (std::string const &path)
 
std::string absolutePath (std::string const &path="")
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 

Protected Attributes

std::shared_ptr< QRcodeitsQRcode
 

Additional Inherited Members

- Protected Member Functions inherited from jevois::Component
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
- Protected Member Functions inherited from jevois::ParameterRegistry
void addParameter (ParameterBase *const param)
 
void removeParameter (ParameterBase *const param)
 
void callbackInitCall ()
 

Detailed Description

Simple demo of QRcode and barcode detection and decoding using the ZBar library.

Detect barcodes and QR-codes, and decode their contents.

QR-codes (Quick Response Codes) are popular 2D patterns that contain embedded information, such as a string of text, a URL, etc. They basically work like barcodes, coding information into a high-contrast, geometric pattern that is easier to detect and decode by a machine that more conventional human-written text or drawings.

One can generate QR-codes containing different kinds of information, for example using online QR-code generators, such as http://www.qr-code-generator.com/

JeVois detects and decodes QR-codes and other barcodes. The implementation of the detection and decoding algorithm used in JeVois is from the popular library ZBar, found at http://zbar.sourceforge.net/

Serial Messages

This module can send standardized serial messages as described in Standardized serial messages formatting. One message is issued for every detected QR-code or barcode, on every video frame.

  • Serial message type: 2D
  • id: type of symbol (e.g., QR-Code, ISBN13, etc).
  • x, y, or vertices: standardized 2D coordinates of symbol center or of corners of bounding box (depending on serstyle)
  • w, h: standardized object size
  • extra: decoded contents (e.g., URL that was in a QR-code, ISBN number from a barcode, etc)

Note that when serstyle is Fine, only 4 corners are returned for each detected QR-code, but many points are returned all over each detected barcode. Beware to not exceed your serial bandwidth in that case.

Author
Laurent Itti
Display Name:
Demo QR-code
Videomapping:
YUYV 640 526 15.0 YUYV 640 480 15.0 JeVois DemoQRcode
Videomapping:
YUYV 320 286 30.0 YUYV 320 240 30.0 JeVois DemoQRcode
Videomapping:
NONE 0 0 0 YUYV 640 480 15.0 JeVois DemoQRcode
Videomapping:
NONE 0 0 0 YUYV 320 240 30.0 JeVois DemoQRcode
Email:
itti@usc.edu
Address:
University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA
Main URL:
http://jevois.org
Support URL:
http://jevois.org/doc
Other URL:
http://iLab.usc.edu
License:
GPL v3
Distribution:
Unrestricted
Restrictions:
None

Definition at line 73 of file DemoQRcode.C.

Constructor & Destructor Documentation

◆ DemoQRcode()

DemoQRcode::DemoQRcode ( std::string const &  instance)
inline

Constructor.

Definition at line 80 of file DemoQRcode.C.

References itsQRcode.

◆ ~DemoQRcode()

virtual DemoQRcode::~DemoQRcode ( )
inlinevirtual

Virtual destructor for safe inheritance.

Definition at line 86 of file DemoQRcode.C.

Member Function Documentation

◆ process() [1/2]

virtual void DemoQRcode::process ( jevois::InputFrame &&  inframe)
inlineoverridevirtual

Processing function, no video output.

Reimplemented from jevois::Module.

Definition at line 92 of file DemoQRcode.C.

References jevois::rawimage::convertToCvGray(), jevois::RawImage::height, itsQRcode, and jevois::RawImage::width.

◆ process() [2/2]

virtual void DemoQRcode::process ( jevois::InputFrame &&  inframe,
jevois::OutputFrame &&  outframe 
)
inlineoverridevirtual

Member Data Documentation

◆ itsQRcode

std::shared_ptr<QRcode> DemoQRcode::itsQRcode
protected

Definition at line 173 of file DemoQRcode.C.

Referenced by DemoQRcode(), and process().


The documentation for this class was generated from the following file: