ViSP  2.10.0
tutorial-grabber-opencv.cpp
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpOpenCVGrabber.h>
int main()
{
#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x020408)
try {
vpOpenCVGrabber g;
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
}