42 #include <visp/vpConfig.h>
53 #include <visp/vpConfig.h>
55 #if defined(VISP_HAVE_OPENCV)
57 #include <visp/vpDisplayOpenCV.h>
58 #include <visp/vpImage.h>
59 #include <visp/vpImageConvert.h>
60 #include <visp/vpOpenCVGrabber.h>
66 int main(
int argc,
char** argv)
71 device = atoi(argv[1]);
73 std::cout <<
"Use device: " << device << std::endl;
74 cv::VideoCapture cap(device);
75 cap.set(CV_CAP_PROP_FRAME_WIDTH, 640);
76 cap.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
82 IplImage iplimage = frame;
83 std::cout <<
"Image size: " << iplimage.width <<
" "
84 << iplimage.height << std::endl;
106 std::cout <<
"Catch an exception: " << e << std::endl;
114 std::cout <<
"OpenCV is not available..." << std::endl;
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
error that can be emited by ViSP classes.
static void flush(const vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
virtual bool getClick(bool blocking=true)=0