opencv_grabber
: An image frame grabber device using OpenCV to capture images from cameras and AVI files.
More...
#include <opencv/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... | |
Public Member Functions inherited from yarp::dev::IFrameGrabberImage | |
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... | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~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... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Public Member Functions inherited from yarp::dev::IPreciselyTimed | |
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 |
opencv_grabber
: An image frame grabber device using OpenCV to capture images from cameras and AVI files.
Definition at line 44 of file OpenCVGrabber.h.
|
inline |
Create an OpenCV image grabber.
This initializes members to reasonable default values, the real initialization is done in open().
Definition at line 56 of file OpenCVGrabber.h.
|
inlinevirtual |
Destroy an OpenCV image grabber.
Definition at line 70 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 164 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 227 of file OpenCVGrabber.cpp.
|
inlineoverridevirtual |
Implements the IPreciselyTimed interface.
Implements yarp::dev::IPreciselyTimed.
Definition at line 94 of file OpenCVGrabber.h.
|
inlineoverridevirtual |
Get the height of images a grabber produces.
Implements yarp::dev::IFrameGrabberImage.
Definition at line 84 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 71 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 182 of file OpenCVGrabber.cpp.
|
inlineoverridevirtual |
Get the width of images a grabber produces.
Implements yarp::dev::IFrameGrabberImage.
Definition at line 88 of file OpenCVGrabber.h.
|
protected |
Whether reading from file or camera.
Definition at line 110 of file OpenCVGrabber.h.
|
protected |
OpenCV image capture object.
Definition at line 113 of file OpenCVGrabber.h.
|
protected |
Saved copy of the device configuration.
Definition at line 121 of file OpenCVGrabber.h.
|
protected |
Definition at line 117 of file OpenCVGrabber.h.
|
protected |
Definition at line 118 of file OpenCVGrabber.h.
|
protected |
Height of the images a grabber produces.
Definition at line 101 of file OpenCVGrabber.h.
|
protected |
Definition at line 123 of file OpenCVGrabber.h.
|
protected |
Whether to loop or not.
Definition at line 104 of file OpenCVGrabber.h.
|
protected |
Definition at line 107 of file OpenCVGrabber.h.
|
protected |
Definition at line 106 of file OpenCVGrabber.h.
|
protected |
Definition at line 116 of file OpenCVGrabber.h.
|
protected |
Width of the images a grabber produces.
Definition at line 99 of file OpenCVGrabber.h.