ViSP  2.8.0
tutorial-grabber-opencv.cpp
1 
2 #include <visp/vpDisplayOpenCV.h>
3 #include <visp/vpOpenCVGrabber.h>
4 
5 int main()
6 {
7 #ifdef VISP_HAVE_OPENCV
9 
11  g.open(I);
12 
13  std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
14  vpDisplayOpenCV d(I);
15 
16  while(1) {
17  g.acquire(I);
20  if (vpDisplay::getClick(I, false))
21  break;
22  }
23 #endif
24 }
unsigned int getWidth() const
Definition: vpImage.h:159
static void flush(const vpImage< unsigned char > &I)
Definition: vpDisplay.cpp:1991
static void display(const vpImage< unsigned char > &I)
Definition: vpDisplay.cpp:203
The vpDisplayOpenCV allows to display image using the opencv library.
void acquire(vpImage< unsigned char > &I)
unsigned int getHeight() const
Definition: vpImage.h:150
virtual bool getClick(bool blocking=true)=0
Class for cameras video capture using OpenCV library.