JeVois
1.22
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Core/VideoInput.H>
Base class for video input, which will get derived into Camera and MovieInput.
Engine uses a VideoInput to capture input frames and pass them to its currently loaded machine vision Module for processing. The VideoInput class is abstract and simply defines the interface. For live video processing, Engine will implement its VideoInput as a Camera, and for processing of pre-recorded videos or image sequences (useful to debug or tune an algorithm on reproducible image sequences), it can also implement its VideoInout as a MovieInput.
Definition at line 31 of file VideoInput.H.
Public Member Functions | |
VideoInput (std::string const &devname, unsigned int const nbufs=0) | |
Constructor. | |
virtual | ~VideoInput () |
Virtual destructor for save inheritance. | |
virtual void | streamOn ()=0 |
Start streaming. | |
virtual void | abortStream ()=0 |
Abort streaming. | |
virtual void | streamOff ()=0 |
Stop streaming. | |
virtual void | get (RawImage &img)=0 |
Get the next captured buffer. | |
virtual bool | hasScaledImage () const |
Check whether a second input image scaled by the JeVoisPro Platform ISP is available. | |
virtual void | get2 (RawImage &img) |
Get the next captured ISP-scaled secondary buffer. | |
virtual void | done (RawImage &img)=0 |
Indicate that user processing is done with an image previously obtained via get() | |
virtual void | done2 (RawImage &img) |
Indicate that user processing is done with a second ISP-scaled image previously obtained via get2() | |
virtual void | queryControl (struct v4l2_queryctrl &qc) const =0 |
Get information about a control, throw if unsupported by hardware. | |
virtual void | queryMenu (struct v4l2_querymenu &qm) const =0 |
Get the available menu entry names for a menu-type control, throw if unsupported by hardware. | |
virtual void | getControl (struct v4l2_control &ctrl) const =0 |
Get a control's current value, throw if unsupported by hardware. | |
virtual void | setControl (struct v4l2_control const &ctrl)=0 |
Set a control, throw if the hardware rejects the value. | |
virtual void | setFormat (VideoMapping const &m)=0 |
Set the video format and frame rate. | |
Protected Attributes | |
std::string const | itsDevName |
Our device or movie file name. | |
unsigned int const | itsNbufs |
Our number of buffers. | |
jevois::VideoInput::VideoInput | ( | std::string const & | devname, |
unsigned int const | nbufs = 0 |
||
) |
Constructor.
devname | name of the device, or movie file, or empty |
nbufs | number of video buffers to use, or 0 for automatic. |
Definition at line 21 of file VideoInput.C.
|
virtual |
Virtual destructor for save inheritance.
Definition at line 27 of file VideoInput.C.
|
pure virtual |
Abort streaming.
This only cancels future get() and done() calls, one should still call streamOff() to turn off streaming.
Implemented in jevois::Camera, and jevois::MovieInput.
|
pure virtual |
Indicate that user processing is done with an image previously obtained via get()
You should call this as soon after get() as possible, once you are finished with the RawImage data so that it can be recycled.
Implemented in jevois::Camera, and jevois::MovieInput.
|
virtual |
Indicate that user processing is done with a second ISP-scaled image previously obtained via get2()
You should call this as soon after get2() as possible, once you are finished with the RawImage data so that it can be recycled. Default implementation throws.
Reimplemented in jevois::Camera, and jevois::MovieInput.
Definition at line 39 of file VideoInput.C.
|
pure virtual |
Get the next captured buffer.
Throws if we are not streaming or blocks until an image is available (has been captured). The image img should have been allocated by the caller and will be filled in by what we receive from the device here.
Implemented in jevois::Camera, and jevois::MovieInput.
|
virtual |
Get the next captured ISP-scaled secondary buffer.
On JeVois-Pro Platform only, the camera ISP can output 2 frames: 1) raw from sensor, 2) scaled by ISP. This function is to access the ISP scaled frame. Throws if not JeVois-Pro Platform or the camera crop type is not jevois::CropType::CropScale. Throws if we are not streaming or blocks until an image is available (has been captured). The image img should have been allocated by the caller and will be filled in by what we receive from the device here. Default implementation throws.
Reimplemented in jevois::Camera, and jevois::MovieInput.
Definition at line 35 of file VideoInput.C.
|
pure virtual |
Get a control's current value, throw if unsupported by hardware.
This is just a pass-through to VIDIOC_G_CTRL
Implemented in jevois::Camera, and jevois::MovieInput.
|
virtual |
Check whether a second input image scaled by the JeVoisPro Platform ISP is available.
Returns false unless we are on JeVois-Pro Platform and the camera format modifier jevois::CropType::CropScale is currently in use.
Reimplemented in jevois::Camera, and jevois::MovieInput.
Definition at line 31 of file VideoInput.C.
|
pure virtual |
Get information about a control, throw if unsupported by hardware.
Caller should zero-out qc and then set the id field to the desired control id. See VIDIOC_QUERYCTRL for more information.
Implemented in jevois::Camera, and jevois::MovieInput.
|
pure virtual |
Get the available menu entry names for a menu-type control, throw if unsupported by hardware.
Caller should zero-out qm and then set the id and index fields to the desired control id and menu item index. See VIDIOC_QUERYMENU for more information.
Implemented in jevois::Camera, and jevois::MovieInput.
|
pure virtual |
Set a control, throw if the hardware rejects the value.
This is just a pass-through to VIDIOC_S_CTRL
Implemented in jevois::Camera, and jevois::MovieInput.
|
pure virtual |
Set the video format and frame rate.
Implemented in jevois::Camera, and jevois::MovieInput.
|
pure virtual |
Stop streaming.
Implemented in jevois::Camera, and jevois::MovieInput.
|
pure virtual |
Start streaming.
Implemented in jevois::Camera, and jevois::MovieInput.
|
protected |
Our device or movie file name.
Definition at line 106 of file VideoInput.H.
|
protected |
Our number of buffers.
Definition at line 107 of file VideoInput.H.