24 #include <opencv2/core/core.hpp>
93 itsArUco = addSubComponent<ArUco>(
"aruco");
94 itsQRcode = addSubComponent<QRcode>(
"qrcode");
110 cv::Mat cvimg = inframe.getCvGRAY();
114 zbar::Image zgray(cvimg.cols, cvimg.rows,
"Y800", cvimg.data, cvimg.total());
116 itsQRcode->sendSerial(
this, zgray, cvimg.cols, cvimg.rows);
117 zgray.set_data(
nullptr, 0);
127 std::vector<int> ids; std::vector<std::vector<cv::Point2f> > corners; std::vector<cv::Vec3d> rvecs, tvecs;
128 itsArUco->detectMarkers(cvimg, ids, corners);
129 if (
itsArUco->dopose::get() && ids.empty() ==
false)
itsArUco->estimatePoseSingleMarkers(corners, rvecs, tvecs);
130 itsArUco->sendSerial(
this, ids, corners, cvimg.cols, cvimg.rows, rvecs, tvecs);
147 inimg.
require(
"input",
w,
h, V4L2_PIX_FMT_YUYV);
153 outimg = outframe.get();
167 zbar::Image zgray(cvimg.cols, cvimg.rows,
"Y800", cvimg.data, cvimg.total());
171 itsQRcode->drawDetections(outimg, 3,
h + 23, zgray,
w,
h, 3);
172 zgray.set_data(
nullptr, 0);
184 std::vector<int> ids; std::vector<std::vector<cv::Point2f> > corners; std::vector<cv::Vec3d> rvecs, tvecs;
185 itsArUco->detectMarkers(cvimg, ids, corners);
186 if (
itsArUco->dopose::get() && ids.empty() ==
false)
itsArUco->estimatePoseSingleMarkers(corners, rvecs, tvecs);
189 itsArUco->sendSerial(
this, ids, corners,
w,
h, rvecs, tvecs);
191 itsArUco->drawDetections(outimg, 3,
h + 3, ids, corners, rvecs, tvecs);
194 std::string
const & fpscpu = timer.
stop();
215 unsigned short winw, winh;
219 int x = 0, y = 0;
unsigned short iw = 0, ih = 0;
225 helper.
itext(
"JeVois-Pro ArUco + ARtoolkit + QRcode/Barcode Detection");
233 zbar::Image zgray(cvimg.cols, cvimg.rows,
"Y800", cvimg.data, cvimg.total());
246 std::vector<int> ids; std::vector<std::vector<cv::Point2f> > corners; std::vector<cv::Vec3d> rvecs, tvecs;
247 itsArUco->detectMarkers(cvimg, ids, corners);
248 if (
itsArUco->dopose::get() && ids.empty() ==
false)
itsArUco->estimatePoseSingleMarkers(corners, rvecs, tvecs);
251 itsArUco->sendSerial(
this, ids, corners,
w, h, rvecs, tvecs);
252 itsArUco->drawDetections(helper, ids, corners, rvecs, tvecs);
259 itsQRcode->drawDetections(helper, zgray,
w, h);
260 zgray.set_data(
nullptr, 0);
266 std::string
const & fpscpu = timer.stop();
267 helper.
iinfo(inframe, fpscpu, winw, winh);