25#include <opencv2/core/core.hpp>
26#include <opencv2/imgproc/imgproc.hpp>
29#include <linux/videodev2.h>
35 "Note that currently, confidence values are binary (only 0 or 1), and quite conservative "
36 "(many good detections may get a confidence of 0 if they are not very clean).",
37 0.0F, roadfinder::ParamCateg);
131 cv::Mat imggray = inframe.getCvGRAY();
138 int const w = imggray.cols;
139 std::pair<Point2D<int>,
float> vp =
itsRoadFinder->getCurrVanishingPoint();
140 if (vp.second >= vpconf::get())
sendSerialImg1Dx(w, vp.first.i, 0.0F,
"vp");
150 inimg.
require(
"input", w,
h, V4L2_PIX_FMT_YUYV);
166 outimg.
require(
"output", w,
h + 16, V4L2_PIX_FMT_YUYV);
169 unsigned short const txtcol = 0xa0ff;
180 std::pair<Point2D<int>,
float> vp =
itsRoadFinder->getCurrVanishingPoint();
181 if (vp.second >= vpconf::get())
sendSerialImg1Dx(w, vp.first.i, 0.0F,
"vp");
184 std::ostringstream otxt; otxt << std::fixed << std::setprecision(3);
185 otxt <<
"VP x=" << vp.first.i <<
" (" << vp.second <<
") CTR=" << std::setprecision(1);
189 otxt << cp.i <<
" TGT=" << tp.i <<
" fTPX=" << tpx;
JEVOIS_REGISTER_MODULE(ArUcoBlob)
jevois::Timer itsProcessingTimer
Module internals.
virtual ~RoadNavigation()
Virtual destructor for safe inheritance.
virtual void process(jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
Processing function with USB video out.
std::shared_ptr< RoadFinder > itsRoadFinder
JEVOIS_DECLARE_PARAMETER(vpconf, float, "Minimum vanishing point confidence required to send a serial message. " "Note that currently, confidence values are binary (only 0 or 1), and quite conservative " "(many good detections may get a confidence of 0 if they are not very clean).", 0.0F, roadfinder::ParamCateg)
Parameter.
virtual void process(jevois::InputFrame &&inframe) override
Processing function, no video out.
RoadNavigation(std::string const &instance)
Constructor.
void require(char const *info, unsigned int w, unsigned int h, unsigned int f) const
StdModule(std::string const &instance)
void sendSerialImg1Dx(unsigned int camw, float x, float size=0.0F, std::string const &id="", std::string const &extra="")
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)
unsigned short constexpr Black
unsigned short constexpr White