How to grab images from a remote source using the yarp::dev::IFrameGrabberImage interface.
How to grab images from a remote source using the yarp::dev::IFrameGrabberImage interface.
- See also
- yarp::dev::IFrameGrabberImage::getImage
#include <cstdio>
using yarp::sig::PixelRgb;
int main(int argc, char* argv[])
{
Property config;
config.put("device", "frameGrabber_nwc_yarp");
config.put("local", "/client");
config.put("remote", "/fakey");
PolyDriver dd(config);
if (!dd.isValid()) {
printf("Failed to create and configure device\n");
return 1;
}
IFrameGrabberImage* grabberInterface;
if (!dd.view(grabberInterface)) {
printf("Failed to view device through IFrameGrabberImage interface\n");
return 1;
}
ImageOf<PixelRgb> img;
grabberInterface->getImage(img);
printf("Got a %zux%zu image\n", img.width(), img.height());
dd.close();
return 0;
}
A container for a device driver.
Utilities for manipulating the YARP network, including initialization and shutdown.
A class for storing options and configuration information.
The main, catch-all namespace for YARP.