ViSP
manGrab1394-2.cpp
1 /****************************************************************************
2  *
3  * $Id: manGrab1394-2.cpp 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Images grabbing example.
36  *
37  * Authors:
38  * Anthony Saunier
39  * Fabien Spindler
40  *
41  *****************************************************************************/
57 #include <visp/vpImage.h>
58 #include <visp/vp1394TwoGrabber.h>
59 #include <stdlib.h>
60 #include <stdio.h>
61 
62 int main()
63 {
64 #ifdef VISP_HAVE_DC1394_2
65  try {
66  unsigned int ncameras; // Number of cameras on the bus
68  g.getNumCameras(ncameras);
70 
71  // If the first camera supports vpVIDEO_MODE_640x480_YUV422 video mode
72  g.setCamera(0);
74 
75  // If all cameras support 30 fps acquisition
76  for (unsigned int camera=0; camera < ncameras; camera ++) {
77  g.setCamera(camera);
79  }
80 
81  for ( ; ; ) {
82  for (unsigned int camera=0; camera < ncameras; camera ++) {
83  // Acquire successively images from the different cameras
84  g.setCamera(camera);
85  g.acquire(I[camera]);
86  }
87  }
88  delete [] I;
89  return 0;
90  }
91  catch(vpException e) {
92  std::cout << "Catch an exception: " << e << std::endl;
93  return 1;
94  }
95 
96 #endif
97 
98 }
error that can be emited by ViSP classes.
Definition: vpException.h:76
void getNumCameras(unsigned int &ncameras) const
void acquire(vpImage< unsigned char > &I)
void setCamera(uint64_t camera)
void setFramerate(vp1394TwoFramerateType fps)
void setVideoMode(vp1394TwoVideoModeType videomode)
Class for firewire ieee1394 video devices using libdc1394-2.x api.