22#include <opencv2/core/core.hpp>
23#include <opencv2/imgproc/imgproc.hpp>
87 {
itsQRcode = addSubComponent<QRcode>(
"qrcode"); }
111 zbar::Image zgray(grayimg.cols, grayimg.rows,
"Y800", grayimg.data, grayimg.total());
118 zgray.set_data(
nullptr, 0);
128 size_t const nshow = 4;
137 inimg.
require(
"input", w,
h, V4L2_PIX_FMT_YUYV);
142 outimg = outframe.get();
143 outimg.
require(
"output", w,
h + nshow * 10 + 6, inimg.
fmt);
151 zbar::Image zgray(grayimg.cols, grayimg.rows,
"Y800", grayimg.data, grayimg.total());
161 itsQRcode->drawDetections(outimg, 3,
h + 3, zgray, w,
h, nshow);
167 zgray.set_data(
nullptr, 0);
170 std::string
const & fpscpu = timer.
stop();
186 unsigned short winw, winh;
190 int x = 0, y = 0;
unsigned short iw = 0, ih = 0;
196 helper.
itext(
"JeVois-Pro QRcode/Barcode Detection");
202 zbar::Image zgray(grayimg.cols, grayimg.rows,
"Y800", grayimg.data, grayimg.total());
206 itsQRcode->drawDetections(helper, zgray, w,
h);
212 zgray.set_data(
nullptr, 0);
218 std::string
const & fpscpu = timer.
stop();
219 helper.
iinfo(inframe, fpscpu, winw, winh);
JEVOIS_REGISTER_MODULE(ArUcoBlob)
Simple demo of QR-code and barcode detection and decoding using the ZBar library.
virtual void process(jevois::InputFrame &&inframe, jevois::GUIhelper &helper) override
Processing function with JeVois-Pro GUI.
std::shared_ptr< QRcode > itsQRcode
virtual void process(jevois::InputFrame &&inframe) override
Processing function, no video output.
virtual ~DemoQRcode()
Virtual destructor for safe inheritance.
DemoQRcode(std::string const &instance)
Constructor.
virtual void process(jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
Processing function with video output to USB.
void drawInputFrame(char const *name, InputFrame const &frame, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool casync=false)
bool startFrame(unsigned short &w, unsigned short &h)
void iinfo(jevois::InputFrame const &inframe, std::string const &fpscpu, unsigned short winw=0, unsigned short winh=0)
void itext(char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
void require(char const *info, unsigned int w, unsigned int h, unsigned int f) const
StdModule(std::string const &instance)
std::string const & stop(double *seconds)
void paste(RawImage const &src, RawImage &dest, int dx, int dy)
void writeText(RawImage &img, std::string const &txt, int x, int y, unsigned int col, Font font=Font6x10)
cv::Mat convertToCvGray(RawImage const &src)
void drawFilledRect(RawImage &img, int x, int y, unsigned int w, unsigned int h, unsigned int col)
std::future< std::invoke_result_t< std::decay_t< Function >, std::decay_t< Args >... > > async(Function &&f, Args &&... args)
unsigned short constexpr White