JeVoisBase
1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
Share this page: |
|
|
|
|
|
|
Go to the documentation of this file.
22 #include <linux/videodev2.h>
23 #include <opencv2/core/core.hpp>
24 #include <opencv2/imgproc/imgproc.hpp>
38 JEVOIS_DECLARE_PARAMETER(l2grad,
bool,
"Use more accurate L2 gradient norm if true, L1 if false",
false, ParamCateg);
64 public jevois::Parameter<thresh1, thresh2, aperture, l2grad>
92 cv::Canny(grayimg, edges, thresh1::get(), thresh2::get(), aperture::get(), l2grad::get());
107 unsigned short winw, winh;
111 int x = 0, y = 0;
unsigned short iw = 0, ih = 0;
116 helper.
itext(
"JeVois-Pro Edge Detection");
122 cv::Canny(grayimg, edges, thresh1::get(), thresh2::get(), aperture::get(), l2grad::get());
125 cv::Mat chans[4] { edges, edges, edges, edges };
126 cv::Mat mask; cv::merge(chans, 4, mask);
129 helper.
drawImage(
"edges", mask,
true, x, y, iw, ih,
false ,
true );
132 std::string
const & fpscpu = timer.stop();
133 helper.
iinfo(inframe, fpscpu, winw, winh);
void drawImage(char const *name, RawImage const &img, int &x, int &y, unsigned short &w, unsigned short &h, bool noalias=false, bool isoverlay=false)
bool startFrame(unsigned short &w, unsigned short &h)
JEVOIS_REGISTER_MODULE(EdgeDetection)
void itext(char const *txt, ImU32 const &col=IM_COL32_BLACK_TRANS, int line=-1)
cv::Mat convertToCvGray(RawImage const &src)
void require(char const *info, unsigned int w, unsigned int h, unsigned int f) const
Simple module to detect edges using the Canny algorithm from OpenCV.
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)
cv::Mat cvImage(RawImage const &src)
virtual ~EdgeDetection()
Virtual destructor for safe inheritance.
virtual void process(jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
Processing function.
friend friend class Module