How to grab images from a remote source using the yarp::dev::IFrameGrabber interface.
#include <cstdio>
int main(
int argc,
char* argv[])
{
Property config;
config.put("device", "remote_grabber");
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;
}