opencv_grabber
: An image frame grabber device using OpenCV to capture images from cameras and AVI files.
More...
#include <opencvGrabber/OpenCVGrabber.h>
Public Member Functions | |
OpenCVGrabber () | |
virtual | ~OpenCVGrabber () |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. | |
bool | close () override |
Close a grabber. | |
bool | getImage (yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override |
Read an image from the grabber. | |
int | height () const override |
Return the height of each frame. | |
int | width () const override |
Return the width of each frame. | |
yarp::os::Stamp | getLastInputStamp () override |
Implements the IPreciselyTimed interface. | |
![]() | |
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 image from the frame grabber. | |
![]() | |
virtual | ~IFrameGrabberImageBase () |
Destructor. | |
![]() | |
DeviceDriver () | |
DeviceDriver (const DeviceDriver &other)=delete | |
DeviceDriver (DeviceDriver &&other) noexcept=delete | |
DeviceDriver & | operator= (const DeviceDriver &other)=delete |
DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
virtual | ~DeviceDriver () |
virtual std::string | id () const |
Return the id assigned to the PolyDriver. | |
virtual void | setId (const std::string &id) |
Set the id for this device. | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. | |
![]() | |
virtual | ~IPreciselyTimed () |
![]() | |
OpenCVGrabber_ParamsParser () | |
~OpenCVGrabber_ParamsParser () override=default | |
bool | parseParams (const yarp::os::Searchable &config) override |
Parse the DeviceDriver parameters. | |
std::string | getDeviceClassName () const override |
Get the name of the DeviceDriver class. | |
std::string | getDeviceName () const override |
Get the name of the device (i.e. | |
std::string | getDocumentationOfDeviceParams () const override |
Get the documentation of the DeviceDriver's parameters. | |
std::vector< std::string > | getListOfParams () const override |
Return a list of all params used by the device. | |
![]() | |
virtual | ~IDeviceDriverParams () |
Protected Attributes | |
bool | m_saidSize = false |
bool | m_saidResize = false |
bool | fromFile = false |
Whether reading from file or camera. | |
cv::VideoCapture | m_cap |
OpenCV image capture object. | |
yarp::os::Property | m_config |
Saved copy of the device configuration. | |
yarp::os::Stamp | m_laststamp |
Additional Inherited Members | |
![]() | |
const std::string | m_device_classname = {"OpenCVGrabber"} |
const std::string | m_device_name = {"opencv_grabber"} |
bool | m_parser_is_strict = false |
const parser_version_type | m_parser_version = {} |
const std::string | m_movie_defaultValue = {""} |
const std::string | m_loop_defaultValue = {"false"} |
const std::string | m_camera_defaultValue = {"0"} |
const std::string | m_framerate_defaultValue = {"-1"} |
const std::string | m_width_defaultValue = {"0"} |
const std::string | m_height_defaultValue = {"0"} |
const std::string | m_flip_x_defaultValue = {"false"} |
const std::string | m_flip_y_defaultValue = {"false"} |
const std::string | m_transpose_defaultValue = {"false"} |
std::string | m_movie = {} |
bool | m_loop = {false} |
int | m_camera = {0} |
double | m_framerate = {-1} |
int | m_width = {0} |
int | m_height = {0} |
bool | m_flip_x = {false} |
bool | m_flip_y = {false} |
bool | m_transpose = {false} |
opencv_grabber
: An image frame grabber device using OpenCV to capture images from cameras and AVI files.
Parameters required by this device are shown in class: OpenCVGrabber_ParamsParser
Definition at line 28 of file OpenCVGrabber.h.
|
inline |
Definition at line 36 of file OpenCVGrabber.h.
|
inlinevirtual |
Definition at line 42 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 128 of file OpenCVGrabber.cpp.
|
overridevirtual |
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. |
Implements yarp::dev::IFrameGrabberOf< yarp::sig::ImageOf< yarp::sig::PixelRgb > >.
Definition at line 146 of file OpenCVGrabber.cpp.
|
inlineoverridevirtual |
Implements the IPreciselyTimed interface.
Implements yarp::dev::IPreciselyTimed.
Definition at line 56 of file OpenCVGrabber.h.
|
inlineoverridevirtual |
Return the height of each frame.
Implements yarp::dev::IFrameGrabberImageBase.
Definition at line 49 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 56 of file OpenCVGrabber.cpp.
|
inlineoverridevirtual |
Return the width of each frame.
Implements yarp::dev::IFrameGrabberImageBase.
Definition at line 50 of file OpenCVGrabber.h.
|
protected |
Whether reading from file or camera.
Definition at line 64 of file OpenCVGrabber.h.
|
protected |
OpenCV image capture object.
Definition at line 67 of file OpenCVGrabber.h.
|
protected |
Saved copy of the device configuration.
Definition at line 70 of file OpenCVGrabber.h.
|
protected |
Definition at line 72 of file OpenCVGrabber.h.
|
protected |
Definition at line 61 of file OpenCVGrabber.h.
|
protected |
Definition at line 60 of file OpenCVGrabber.h.