JeVoisBase
1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
Share this page: |
|
|
|
 |
 |
|
Go to the documentation of this file.
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);
127 static unsigned short const txtcol = jevois::yuyv::White;
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);
std::future< std::invoke_result_t< std::decay_t< Function >, std::decay_t< Args >... > > async(Function &&f, Args &&... args)
bool startFrame(unsigned short &w, unsigned short &h)
void itext(char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
virtual void process(jevois::InputFrame &&inframe) override
Processing function, no video output.
JEVOIS_REGISTER_MODULE(DemoQRcode)
cv::Mat convertToCvGray(RawImage const &src)
void require(char const *info, unsigned int w, unsigned int h, unsigned int f) const
DemoQRcode(std::string const &instance)
Constructor.
virtual ~DemoQRcode()
Virtual destructor for safe inheritance.
void writeText(RawImage &img, std::string const &txt, int x, int y, unsigned int col, Font font=Font6x10)
std::shared_ptr< QRcode > itsQRcode
const std::string & stop(double *seconds)
void drawFilledRect(RawImage &img, int x, int y, unsigned int w, unsigned int h, unsigned int col)
StdModule(std::string const &instance)
Simple demo of QR-code and barcode detection and decoding using the ZBar library.
void drawInputFrame(char const *name, InputFrame const &frame, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool casync=false)
void iinfo(jevois::InputFrame const &inframe, std::string const &fpscpu, unsigned short winw=0, unsigned short winh=0)
virtual void process(jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
Processing function with video output to USB.
void paste(RawImage const &src, RawImage &dest, int dx, int dy)