Visual Servoing Platform  version 3.0.0
tutorial-grabber-CMU1394.cpp
1 
2 #include <visp3/sensor/vp1394CMUGrabber.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/core/vpImage.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  }
35  catch(vpException e) {
36  std::cout << "Catch an exception: " << e << std::endl;
37  }
38 #endif
39 }
void setVideoMode(unsigned long format, unsigned long mode)
unsigned int getWidth() const
Definition: vpImage.h:161
void open(vpImage< unsigned char > &I)
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:128
error that can be emited by ViSP classes.
Definition: vpException.h:73
static void flush(const vpImage< unsigned char > &I)
Definition: vpDisplay.cpp:2233
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)
Definition: vpDisplay.cpp:206
unsigned int getHeight() const
Definition: vpImage.h:152
virtual bool getClick(bool blocking=true)=0