JeVois
1.17
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
 |
 |
|
Go to the documentation of this file.
21 #include <opencv2/core/core.hpp>
26 #include <ovxlib/vsi_nn_pub.h>
32 namespace preprocessor
44 "UINT8 blob, typically for use with quantized networks",
45 2.0
F / 255.0
F, ParamCateg);
49 cv::Scalar(127.5
F, 127.5
F, 127.5
F), ParamCateg);
53 "with same aspect ratio as the network's input tensor, and then rescale it to that "
54 "tensor's width and height (hence with cropping but no distortion). Otherwise, use "
55 "the whole image and rescale it to the network's input width and height with some "
56 "possible stretching.",
77 public jevois::Parameter<preprocessor::rgb, preprocessor::showin>
88 virtual void freeze(
bool doit) = 0;
101 std::vector<cv::Mat>
const &
blobs()
const;
104 cv::Size
blobsize(
size_t num)
const;
109 void b2i(
float & x,
float & y,
size_t blobnum = 0);
114 void b2i(
float & x,
float & y, cv::Size
const & bsiz,
bool letterboxed);
128 virtual std::vector<cv::Mat>
process(cv::Mat
const & img,
bool isrgb,
129 std::vector<vsi_nn_tensor_attr_t>
const & attrs,
130 std::vector<cv::Rect> & crops) = 0;
137 std::vector<vsi_nn_tensor_attr_t> itsAttrs;
138 std::vector<cv::Mat> itsBlobs;
139 std::vector<cv::Rect> itsCrops;
141 cv::Size itsImageSize;
142 unsigned int itsImageFmt;
cv::Size blobsize(size_t num) const
Access the width and height of a given blob, accounting for NCHW or NHWC.
friend class Component
Allow Component to access our registry data, everyone else is locked out.
cv::Rect getUnscaledCropRect(size_t blobnum=0)
Get unscaled crop rectangle in image coordinates.
JEVOIS_DECLARE_PARAMETER(thresh1, double, "First threshold for hysteresis", 50.0, ParamCateg)
A component of a model hierarchy.
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
const std::vector< cv::Mat > & blobs() const
Access the last computed blobs (or empty if process() has not yet been called)
A category to which multiple ParameterDef definitions can belong.
Helper class to assist modules in creating graphical and GUI elements.
Pre-Processor for neural network pipeline.
virtual void freeze(bool doit)=0
Freeze/unfreeze parameters that users should not change while running.
virtual void sendreport(jevois::StdModule *mod, jevois::RawImage *outimg=nullptr, jevois::OptGUIhelper *helper=nullptr, bool overlay=true, bool idle=false)
Report what happened in last process() to console/output video/GUI.
virtual void report(jevois::StdModule *mod, jevois::RawImage *outimg=nullptr, jevois::OptGUIhelper *helper=nullptr, bool overlay=true, bool idle=false)=0
Report what happened in last process() to console/output video/GUI.
const cv::Size & imagesize() const
Access the last processed image size.
void b2i(float &x, float &y, size_t blobnum=0)
Convert coordinates from blob back to original image.
std::vector< cv::Mat > process(jevois::RawImage const &img, std::vector< vsi_nn_tensor_attr_t > const &attrs)
Extract blobs from input image.
Base class for a module that supports standardized serial messages.
virtual ~PreProcessor()
Destructor.