JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
|
|
|
Go to the documentation of this file.
23 #include <opencv2/imgproc/imgproc.hpp>
27 itsGadget(gad), itsDidGet(false), itsDidSend(false), itsImagePtrForException(excimg)
34 if (itsGadget.get() ==
nullptr)
return;
37 if (itsDidGet ==
false)
return;
42 if (itsImagePtrForException)
44 if (itsDidSend ==
false) { *itsImagePtrForException = itsImage; }
50 if (itsDidSend ==
false)
try { itsGadget->send(itsImage); }
catch (...) { }
57 itsGadget->get(itsImage);
65 itsGadget->send(itsImage);
67 if (itsImagePtrForException) itsImagePtrForException->invalidate();
75 case CV_8UC3: sendScaledCvBGR(img, quality);
break;
76 case CV_8UC1: sendScaledCvGRAY(img, quality);
break;
77 case CV_8UC4: sendScaledCvRGBA(img, quality);
break;
78 default:
LFATAL(
"cv::Mat of type " <<
cvtypestr(img.type()) <<
" not supported.");
void sendCvGRAY(cv::Mat const &img, int quality=75) const
Shorthand to send a GRAY cv::Mat after converting it to the current output format.
Data collection mode RAW means that the latest available raw data is returned each time get() is called
void sendScaledCvRGBA(cv::Mat const &img, int quality=75) const
Shorthand to send a RGBA cv::Mat after converting it to the current output format.
cv::Mat rescaleCv(cv::Mat const &img, cv::Size const &newdims)
Rescale an OpenCV image, choosing the right kind of interpolation.
void convertCvRGBtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert a RGB cv::Mat to RawImage with already-allocated pixels and pixel type.
std::string cvtypestr(unsigned int cvtype)
Convert cv::Mat::type() code to to a string (e.g., CV_8UC1, CV_32SC3, etc)
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
void sendScaledCvGRAY(cv::Mat const &img, int quality=75) const
Shorthand to send a GRAY cv::Mat after converting it to the current output format.
unsigned int width
Image width in pixels.
OutputFrame(OutputFrame &&other)=default
Move constructor.
~OutputFrame()
Destructor, returns the buffers to the driver as needed.
void convertCvGRAYtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert a Gray cv::Mat to RawImage with already-allocated pixels and pixel type.
void sendCvRGB(cv::Mat const &img, int quality=75) const
Shorthand to send a RGB cv::Mat after converting it to the current output format.
void sendCv(cv::Mat const &img, int quality=75) const
Shorthand to send a cv::Mat after converting / scaling it to the current output format.
void convertCvRGBAtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert an RGBA cv::Mat to RawImage with already-allocated pixels and pixel type.
#define LFATAL(msg)
Convenience macro for users to print out console or syslog messages, FATAL level.
void convertCvBGRtoRawImage(cv::Mat const &src, RawImage &dst, int quality)
Convert a BGR cv::Mat to RawImage with already-allocated pixels and pixel type.
unsigned int height
Image height in pixels.
void sendScaledCvRGB(cv::Mat const &img, int quality=75) const
Shorthand to send a RGB cv::Mat after converting it to the current output format.
void sendCvRGBA(cv::Mat const &img, int quality=75) const
Shorthand to send a RGBA cv::Mat after converting it to the current output format.
void send() const
Send an image out over USB to the host computer.
void sendCvBGR(cv::Mat const &img, int quality=75) const
Shorthand to send a BGR cv::Mat after converting it to the current output format.
const RawImage & get() const
Get a pre-allocated image so that we can fill the pixel data and later send out over USB using send()
void sendScaledCvBGR(cv::Mat const &img, int quality=75) const
Shorthand to send a BGR cv::Mat after converting it to the current output format.