Visual Servoing Platform  version 3.6.1 under development (2024-03-29)
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 }
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void setVideoMode(unsigned long format, unsigned long mode)
void acquire(vpImage< unsigned char > &I)
void setFramerate(unsigned long fps)
void open(vpImage< unsigned char > &I)
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:128
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
Definition: vpException.h:59
unsigned int getWidth() const
Definition: vpImage.h:245
unsigned int getHeight() const
Definition: vpImage.h:184