Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
tutorial-grabber-CMU1394.cpp
1 
2 #include <visp3/core/vpConfig.h>
3 #include <visp3/core/vpImage.h>
4 #include <visp3/gui/vpDisplayGDI.h>
5 #include <visp3/sensor/vp1394CMUGrabber.h>
6 
7 int main()
8 {
9 #ifdef VISP_HAVE_CMU1394
10 #ifdef ENABLE_VISP_NAMESPACE
11  using namespace VISP_NAMESPACE_NAME;
12 #endif
13  try {
15 
17  g.setVideoMode(0, 1); // 640x480 MONO8
18  g.setAutoShutter();
19  g.setAutoGain();
20  g.setFramerate(4); // 30 fps
21  g.open(I);
22 
23  std::cout << "Image size: " << I.getWidth() << " " << I.getHeight() << std::endl;
24 
25 #ifdef VISP_HAVE_GDI
26  vpDisplayGDI d(I);
27 #else
28  std::cout << "No image viewer is available..." << std::endl;
29 #endif
30 
31  while (1) {
32  g.acquire(I);
35  if (vpDisplay::getClick(I, false)) // A click to exit
36  break;
37  }
38  }
39  catch (const vpException &e) {
40  std::cout << "Catch an exception: " << e << std::endl;
41  }
42 #else
43  std::cout << "Install CMU1394 SDK, configure and build ViSP again to use this example" << std::endl;
44 #endif
45 }
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:130
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:60
unsigned int getWidth() const
Definition: vpImage.h:242
unsigned int getHeight() const
Definition: vpImage.h:181