JeVois
1.18
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
 |
 |
|
Go to the documentation of this file.
23 #include <opencv2/videoio.hpp>
24 #include <opencv2/imgproc/imgproc.hpp>
31 if (
itsCap.open(filename) ==
false)
LFATAL(
"Failed to open movie or image sequence [" << filename <<
']');
53 static size_t frameidx = 0;
57 if (itsCap.read(frame) ==
false)
59 LINFO(
"End of input - Rewinding...");
62 itsCap.set(cv::CAP_PROP_POS_AVI_RATIO, 0);
65 if (itsCap.read(frame) ==
false)
LFATAL(
"Could not read next video frame");
69 if (frame.cols !=
int(itsMapping.cw) || frame.rows !=
int(itsMapping.ch))
71 if (frameidx++ % 100 == 0)
72 LINFO(
"Resizing frame from " << frame.cols <<
'x'<< frame.rows <<
" to " << itsMapping.cw <<
'x'<< itsMapping.ch);
73 cv::resize(frame, frame, cv::Size(itsMapping.cw, itsMapping.ch));
80 img.
width = itsMapping.cw;
81 img.
height = itsMapping.ch;
82 img.
fmt = itsMapping.cfmt;
83 img.
fps = itsMapping.cfps;
100 {
throw std::runtime_error(
"Operation queryControl() not supported by MovieInput"); }
104 {
throw std::runtime_error(
"Operation queryMenu() not supported by MovieInput"); }
108 {
throw std::runtime_error(
"Operation getControl() not supported by MovieInput"); }
112 {
throw std::runtime_error(
"Operation setControl() not supported by MovieInput"); }
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
size_t bufindex
The index of the data buffer in the kernel driver.
float fps
Programmed frames/s as given by current video mapping, may not be actual.
unsigned int width
Image width in pixels.
#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.
unsigned int fmt
Pixel format as a V4L2_PIX_FMT_XXX.
A V4L2 video buffer, to be held in a shared_ptr.
std::shared_ptr< VideoBuf > buf
The pixel data buffer.
#define LINFO(msg)
Convenience macro for users to print out console or syslog messages, INFO level.