Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
tutorial-grabber-1394.cpp
1 #include <visp3/sensor/vp1394TwoGrabber.h>
3 #include <visp3/gui/vpDisplayX.h>
4 #include <visp3/core/vpImage.h>
5 
6 int main()
7 {
8 #ifdef VISP_HAVE_DC1394
9  try {
10  vpImage<unsigned char> I; // Create a gray level image container
11  bool reset = true; // Enable bus reset during construction (default)
13  vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib
15 
18  g.setFramerate(vp1394TwoGrabber::vpFRAMERATE_60);
21  g.open(I);
23 
24  std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
25 
26 #ifdef VISP_HAVE_X11
27  vpDisplayX d(I);
28 #else
29  std::cout << "No image viewer is available..." << std::endl;
30 #endif
31 
32  while(1) {
34  g.acquire(I);
39  if (vpDisplay::getClick(I, false))
40  break;
42  }
43  }
44  catch(vpException &e) {
45  std::cout << "Catch an exception: " << e << std::endl;
46  }
47 #endif
48 }
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
unsigned int getWidth() const
Definition: vpImage.h:226
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Definition: vpDisplayX.h:153
error that can be emited by ViSP classes.
Definition: vpException.h:73
static void flush(const vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
unsigned int getHeight() const
Definition: vpImage.h:175
Class for firewire ieee1394 video devices using libdc1394-2.x api.