Visual Servoing Platform  version 3.2.0 under development (2019-01-22)
tutorial-grabber-CMU1394.cpp
1 
2 #include <visp3/core/vpImage.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/sensor/vp1394CMUGrabber.h>
5 
6 int main()
7 {
8 #ifdef VISP_HAVE_CMU1394
9  try {
11 
13  g.setVideoMode(0, 1); // 640x480 MONO8
14  g.setAutoShutter();
15  g.setAutoGain();
16  g.setFramerate(4); // 30 fps
17  g.open(I);
18 
19  std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
20 
21 #ifdef VISP_HAVE_GDI
22  vpDisplayGDI d(I);
23 #else
24  std::cout << "No image viewer is available..." << std::endl;
25 #endif
26 
27  while (1) {
28  g.acquire(I);
31  if (vpDisplay::getClick(I, false)) // A click to exit
32  break;
33  }
34  } catch (const vpException &e) {
35  std::cout << "Catch an exception: " << e << std::endl;
36  }
37 #else
38  std::cout << "Install CMU1394 SDK, configure and build ViSP again to use this example" << std::endl;
39 #endif
40 }
void setVideoMode(unsigned long format, unsigned long mode)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
unsigned int getWidth() const
Definition: vpImage.h:239
void open(vpImage< unsigned char > &I)
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:129
error that can be emited by ViSP classes.
Definition: vpException.h:71
static void flush(const vpImage< unsigned char > &I)
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void setFramerate(unsigned long fps)
void acquire(vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
unsigned int getHeight() const
Definition: vpImage.h:178