22#include <linux/videodev2.h>
23#include <opencv2/core/core.hpp>
24#include <opencv2/imgproc/imgproc.hpp>
68 public jevois::Parameter<thresh1, thresh2, aperture, l2grad, thresh1delta, thresh2delta>
94 std::vector<std::future<void> > fut;
96 for (
int i = 0; i < 3; ++i)
100 cv::Mat edges(grayimg.rows, grayimg.cols, CV_8UC1, outimg.pixelsw<unsigned char>() + i * grayimg.total());
102 cv::Canny(grayimg, edges, thresh1::get() + i * thresh1delta::get(),
103 thresh2::get() + i * thresh2delta::get(), aperture::get(), l2grad::get());
107 cv::Mat edges(grayimg.rows, grayimg.cols, CV_8UC1, outimg.
pixelsw<
unsigned char>() + 3 * grayimg.total());
108 cv::Canny(grayimg, edges, thresh1::get() + 3 * thresh1delta::get(),
109 thresh2::get() + 3 * thresh2delta::get(), aperture::get(), l2grad::get());
JEVOIS_REGISTER_MODULE(ArUcoBlob)
Simple module to detect edges, running 4 filters in parallel with 4 different settings.
virtual ~EdgeDetectionX4()
Virtual destructor for safe inheritance.
JEVOIS_DECLARE_PARAMETER(thresh1, double, "First threshold for hysteresis", 20.0, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(thresh1delta, double, "First threshold delta over threads", 50.0, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(thresh2delta, double, "Second threshold delta over threads", 50.0, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(l2grad, bool, "Use more accurate L2 gradient norm if true, L1 if false", false, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(aperture, int, "Aperture size for the Sobel operator", 3, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(thresh2, double, "Second threshold for hysteresis", 60.0, ParamCateg)
Parameter.
virtual void process(jevois::InputFrame &&inframe, jevois::OutputFrame &&outframe) override
Processing function.
friend friend class Module
void require(char const *info, unsigned int w, unsigned int h, unsigned int f) const
std::string warnAndIgnoreException(std::string const &prefix="")
cv::Mat convertToCvGray(RawImage const &src)
std::future< std::invoke_result_t< std::decay_t< Function >, std::decay_t< Args >... > > async(Function &&f, Args &&... args)