JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
QRcode and Barcode detection using ZBar. More...
#include <jevoisbase/Components/QRcode/QRcode.H>
Public Member Functions | |
QRcode (std::string const &instance) | |
Constructor. | |
~QRcode () | |
Destructor. | |
void | process (zbar::Image &image) |
Process a greayscale image. | |
void | process (zbar::Image &image, std::vector< std::string > &results) |
Process a greayscale image. | |
void | drawDetections (jevois::RawImage &outimg, int txtx, int txty, zbar::Image &zgray, int w, int h, size_t nshow) |
Draw any markers previously detected by process() | |
void | drawDetections (jevois::GUIhelper &helper, zbar::Image &zgray, int w, int h) |
Draw any markers previously detected by process() | |
void | sendSerial (jevois::StdModule *mod, zbar::Image &img, unsigned int camw, unsigned int camh) |
Send serial messages about our detections. | |
Public Member Functions inherited from jevois::Component | |
Component (std::string const &instance) | |
virtual | ~Component () |
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 ¶mdescriptor, T const &val) |
void | setParamValUnique (std::string const ¶mdescriptor, T const &val) |
std::vector< std::pair< std::string, T > > | getParamVal (std::string const ¶mdescriptor) const |
T | getParamValUnique (std::string const ¶mdescriptor) const |
std::vector< std::string > | setParamString (std::string const ¶mdescriptor, std::string const &val) |
void | setParamStringUnique (std::string const ¶mdescriptor, std::string const &val) |
std::vector< std::pair< std::string, std::string > > | getParamString (std::string const ¶mdescriptor) const |
std::string | getParamStringUnique (std::string const ¶mdescriptor) const |
void | freezeParam (std::string const ¶mdescriptor, bool doit) |
void | freezeAllParams (bool doit) |
std::string | descriptor () const |
void | setParamsFromFile (std::string const &filename) |
std::istream & | setParamsFromStream (std::istream &is, std::string const &absfile) |
virtual void | paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="") |
void | foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="") |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category) |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category) |
void | setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true) |
void | removeDynamicParameter (std::string const &name, bool throw_if_not_found=true) |
void | setPath (std::string const &path) |
std::filesystem::path | absolutePath (std::filesystem::path 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 ¶mdescriptor, T const &val) |
void | setParamValUnique (std::string const ¶mdescriptor, T const &val) |
std::vector< std::pair< std::string, T > > | getParamVal (std::string const ¶mdescriptor) const |
T | getParamValUnique (std::string const ¶mdescriptor) const |
std::vector< std::string > | setParamString (std::string const ¶mdescriptor, std::string const &val) |
void | setParamStringUnique (std::string const ¶mdescriptor, std::string const &val) |
std::vector< std::pair< std::string, std::string > > | getParamString (std::string const ¶mdescriptor) const |
std::string | getParamStringUnique (std::string const ¶mdescriptor) const |
void | freezeParam (std::string const ¶mdescriptor, bool doit) |
void | freezeAllParams (bool doit) |
std::string | descriptor () const |
void | setParamsFromFile (std::string const &filename) |
std::istream & | setParamsFromStream (std::istream &is, std::string const &absfile) |
virtual void | paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="") |
void | foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="") |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category) |
std::shared_ptr< DynamicParameter< T > > | addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category) |
void | setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true) |
void | removeDynamicParameter (std::string const &name, bool throw_if_not_found=true) |
void | setPath (std::string const &path) |
std::filesystem::path | absolutePath (std::filesystem::path const &path="") |
Public Member Functions inherited from jevois::ParameterRegistry | |
virtual | ~ParameterRegistry () |
Protected Member Functions | |
void | onParamChange (qrcode::symbol const ¶m, std::string const &newval) override |
Parse symbol config strings when they change. | |
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 () |
Protected Attributes | |
std::shared_ptr< zbar::ImageScanner > | itsScanner |
Related Symbols | |
(Note that these are not member symbols.) | |
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (symbol, std::string, "Type(s) of QR code / barcode symbols searched for, " "multiple entries are possible and should be separated by / characters. " "Selecting many symbol types or ALL will slow down processing. Supported " "symbols are: QRCODE, EAN2, EAN5, EAN8, EAN13, UPCE, UPCA, ISBN10, ISBN13, " "COMPOSITE, I25, DATABAR, DATABAREXP, CODABAR, CODE39, PDF417, CODE93, " "and CODE128", "ALL", ParamCateg) | |
Parameter. | |
JEVOIS_DECLARE_PARAMETER (xdensity, int, "Scanner vertical scan density (pixel stride), or 0 to disable", 1, ParamCateg) | |
Parameter. | |
JEVOIS_DECLARE_PARAMETER (ydensity, int, "Scanner horizontal scan density (pixel stride), or 0 to disable", 1, ParamCateg) | |
Parameter. | |
QRcode and Barcode detection using ZBar.
This is drectly modeled after the scan_image.cpp ZBar example code.
QRcode::QRcode | ( | std::string const & | instance | ) |
void QRcode::drawDetections | ( | jevois::GUIhelper & | helper, |
zbar::Image & | zgray, | ||
int | w, | ||
int | h | ||
) |
Draw any markers previously detected by process()
Definition at line 211 of file QRcode.C.
References jevois::GUIhelper::drawPoly(), jevois::GUIhelper::drawRect(), h, and jevois::GUIhelper::itext().
Referenced by FirstPython.FirstPython::process(), and PythonObject6D.PythonObject6D::process().
void QRcode::drawDetections | ( | jevois::RawImage & | outimg, |
int | txtx, | ||
int | txty, | ||
zbar::Image & | zgray, | ||
int | w, | ||
int | h, | ||
size_t | nshow | ||
) |
Draw any markers previously detected by process()
If txtx,txty are positive, also print a text string there
Definition at line 148 of file QRcode.C.
References jevois::yuyv::DarkPink, jevois::rawimage::drawLine(), jevois::rawimage::drawRect(), h, jevois::yuyv::White, and jevois::rawimage::writeText().
Referenced by FirstPython.FirstPython::process(), and PythonObject6D.PythonObject6D::process().
|
overrideprotected |
Parse symbol config strings when they change.
Definition at line 35 of file QRcode.C.
References itsScanner, JEVOIS_UNUSED_PARAM, LFATAL, and jevois::split().
void QRcode::process | ( | zbar::Image & | image | ) |
Process a greayscale image.
Results will be stored in the image
Definition at line 94 of file QRcode.C.
References itsScanner, and LERROR.
void QRcode::process | ( | zbar::Image & | image, |
std::vector< std::string > & | results | ||
) |
Process a greayscale image.
Results will be stored in the provided vector
Definition at line 106 of file QRcode.C.
References itsScanner, and LERROR.
void QRcode::sendSerial | ( | jevois::StdModule * | mod, |
zbar::Image & | img, | ||
unsigned int | camw, | ||
unsigned int | camh | ||
) |
Send serial messages about our detections.
Definition at line 126 of file QRcode.C.
References jevois::StdModule::sendSerialContour2D().
|
related |
Parameter.
|
related |
Parameter.
|
related |
Parameter.
|
protected |