YARP
Yet Another Robot Platform
Example for opencv_grabber (opencv_grabber_basic)

Instantiates opencv_grabber device implemented by OpenCVGrabber. More...

+ Collaboration diagram for Example for opencv_grabber (opencv_grabber_basic):

Instantiates opencv_grabber device implemented by OpenCVGrabber.

# read a camera using opencv
device opencv_grabber

If this text is saved in a file called opencv_grabber_basic.ini then the device can be created by doing:

yarpdev --file opencv_grabber_basic.ini

Of course, the configuration could be passed just as command line options, or as a yarp::os::Property object in a program:

Property p;
p.fromConfigFile("opencv_grabber_basic.ini");
// of course you could construct the Property object on-the-fly
PolyDriver dev;
dev.open(p);
if (dev.isValid()) { /* use the device via view method */ }

Here is a list of properties checked when starting up a device based on this configuration file. Note that which properties are checked can depend on whether other properties are present. In some cases properties can also vary between operating systems. So this is just an example

PROPERTYDESCRIPTIONDEFAULT
device
movieif present, read from specified file rather than camera
cameraif present, read from camera identified by this index0
framerateif present, specifies desired camera device framerate
flip_xif present, flip the image along the x-axis
flip_yif present, flip the image along the y-axis
transposeif present, rotate the image along of 90 degrees
widthif present, specifies desired image width
heightif present, specifies desired image height
See also
OpenCVGrabber