tutorial-visp-grabber-1394.cpp
Go to the documentation of this file.
1 #include <visp/vp1394TwoGrabber.h>
3 #include <visp/vpDisplayX.h>
4 #include <visp/vpImage.h>
5 
6 int
7 main()
8 {
9 #ifdef VISP_HAVE_DC1394_2
10  try
11  {
12  vpImage< unsigned char > I; // Create a gray level image container
13  bool reset = true; // Enable bus reset during construction (default)
14  vp1394TwoGrabber g( reset ); // Create a grabber based on libdc1394-2.x third party lib
15 
16  g.setVideoMode( vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8 );
17  g.setFramerate( vp1394TwoGrabber::vpFRAMERATE_60 );
18  g.open( I );
19 
20  std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
21 
22 #ifdef VISP_HAVE_X11
23  vpDisplayX d( I );
24 #else
25  std::cout << "No image viewer is available..." << std::endl;
26 #endif
27 
28  while ( 1 )
29  {
30  g.acquire( I );
31  vpDisplay::display( I );
32  vpDisplay::flush( I );
33  if ( vpDisplay::getClick( I, false ) )
34  break;
35  }
36  }
37  catch ( vpException e )
38  {
39  std::cout << "Catch an exception: " << e << std::endl;
40  }
41 #endif
42 }
d


visp_ros
Author(s): Francois Pasteau, Fabien Spindler, Gatien Gaumerais, Alexander Oliva
autogenerated on Tue Mar 1 2022 00:03:22