An image frame grabber device using OpenCV to capture images from cameras and AVI files. More...
#include <opencv/OpenCVGrabber.h>
An image frame grabber device using OpenCV to capture images from cameras and AVI files.
Definition at line 45 of file OpenCVGrabber.h.
Public Member Functions | |
OpenCVGrabber () | |
Create an OpenCV image grabber. More... | |
virtual | ~OpenCVGrabber () |
Destroy an OpenCV image grabber. More... | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | close () override |
Close a grabber. More... | |
bool | getImage (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override |
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied. More... | |
virtual bool | sendImage (const cv::Mat &frame, yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) |
Read an image from the grabber. More... | |
int | height () const override |
Get the height of images a grabber produces. More... | |
int | width () const override |
Get the width of images a grabber produces. More... | |
yarp::os::Stamp | getLastInputStamp () override |
Implements the IPreciselyTimed interface. More... | |
![]() | |
virtual | ~IFrameGrabberImage () |
Destructor. More... | |
virtual bool | getImageCrop (cropType_id_t cropType, yarp::sig::VectorOf< std::pair< int, int > > vertices, yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) |
Get a crop of the rgb image from the frame grabber, if required demosaicking/color reconstruction is applied. More... | |
![]() | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
![]() | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
![]() | |
virtual | ~IPreciselyTimed () |
Protected Attributes | |
size_t | m_w |
Width of the images a grabber produces. More... | |
size_t | m_h |
Height of the images a grabber produces. More... | |
bool | m_loop |
Whether to loop or not. More... | |
bool | m_saidSize |
bool | m_saidResize |
bool | fromFile |
Whether reading from file or camera. More... | |
cv::VideoCapture | m_cap |
OpenCV image capture object. More... | |
bool | m_transpose |
bool | m_flip_x |
bool | m_flip_y |
yarp::os::Property | m_config |
Saved copy of the device configuration. More... | |
yarp::os::Stamp | m_laststamp |
|
inline |
Create an OpenCV image grabber.
This initializes members to reasonable default values, the real initialization is done in open().
Definition at line 60 of file OpenCVGrabber.h.
|
inlinevirtual |
Destroy an OpenCV image grabber.
Definition at line 74 of file OpenCVGrabber.h.
|
overridevirtual |
Close a grabber.
This is called by yarp to free any allocated hardware or software resources when the driver instance is no longer needed.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 194 of file OpenCVGrabber.cpp.
|
overridevirtual |
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied.
image | the image to be filled |
Implements yarp::dev::IFrameGrabberImage.
Definition at line 257 of file OpenCVGrabber.cpp.
|
inlineoverridevirtual |
Implements the IPreciselyTimed interface.
Implements yarp::dev::IPreciselyTimed.
Definition at line 98 of file OpenCVGrabber.h.
|
inlineoverridevirtual |
Get the height of images a grabber produces.
Implements yarp::dev::IFrameGrabberImage.
Definition at line 88 of file OpenCVGrabber.h.
|
overridevirtual |
Open the DeviceDriver.
config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 74 of file OpenCVGrabber.cpp.
|
virtual |
Read an image from the grabber.
image | The image to read. The image will be resized to the dimensions the grabber is using, and the captured image data will be written to it. |
Definition at line 212 of file OpenCVGrabber.cpp.
|
inlineoverridevirtual |
Get the width of images a grabber produces.
Implements yarp::dev::IFrameGrabberImage.
Definition at line 92 of file OpenCVGrabber.h.
|
protected |
Whether reading from file or camera.
Definition at line 114 of file OpenCVGrabber.h.
|
protected |
OpenCV image capture object.
Definition at line 117 of file OpenCVGrabber.h.
|
protected |
Saved copy of the device configuration.
Definition at line 125 of file OpenCVGrabber.h.
|
protected |
Definition at line 121 of file OpenCVGrabber.h.
|
protected |
Definition at line 122 of file OpenCVGrabber.h.
|
protected |
Height of the images a grabber produces.
Definition at line 105 of file OpenCVGrabber.h.
|
protected |
Definition at line 127 of file OpenCVGrabber.h.
|
protected |
Whether to loop or not.
Definition at line 108 of file OpenCVGrabber.h.
|
protected |
Definition at line 111 of file OpenCVGrabber.h.
|
protected |
Definition at line 110 of file OpenCVGrabber.h.
|
protected |
Definition at line 120 of file OpenCVGrabber.h.
|
protected |
Width of the images a grabber produces.
Definition at line 103 of file OpenCVGrabber.h.