ViSP  2.9.0
tutorial-grabber-opencv.cpp
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpOpenCVGrabber.h>
int main()
{
#ifdef VISP_HAVE_OPENCV
try {
g.open(I);
std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
while(1) {
g.acquire(I);
if (vpDisplay::getClick(I, false))
break;
}
}
catch(vpException e) {
std::cout << "Catch an exception: " << e << std::endl;
}
#endif
}