Fawkes API  Fawkes Development Version
bumblebee2.cpp
1 
2 /***************************************************************************
3  * bumblebee2.cpp - Point Grey Bumblebee 2 camera
4  *
5  * Generated: Sat Apr 14 20:51:19 2007 (watching Ghostbusters)
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <fvcams/bumblebee2.h>
25 
26 #include <fvcams/cam_exceptions.h>
27 #include <core/exception.h>
28 #include <fvutils/system/camargp.h>
29 #include <fvutils/color/conversions.h>
30 // include <fvutils/writers/pnm.h>
31 
32 #include <stdlib.h>
33 #include <unistd.h>
34 #include <string>
35 #ifdef __FreeBSD__
36 # include <sys/endian.h>
37 #elif defined(__MACH__) && defined(__APPLE__)
38 # include <sys/_endian.h>
39 #else
40 # include <endian.h>
41 #endif
42 
43 #include <utils/math/angle.h>
44 
45 #include <cstdio>
46 
47 #include <dc1394/utils.h>
48 #include <dc1394/register.h>
49 #include <dc1394/conversions.h>
50 
51 using namespace fawkes;
52 
53 namespace firevision {
54 #if 0 /* just to make Emacs auto-indent happy */
55 }
56 #endif
57 
58 /** @class Bumblebee2Camera <fvcams/bumblebee2.h>
59  * Bumblebee2 camera.
60  * Camera implementation that allows fo access to the PointGrey Research Bumblebee2
61  * camera. It uses libdc1394 to access the camera for fast image transfers (as recommended
62  * by PTGrey) and can be used in conjunction with the TriclopsStereoProcessor in the
63  * stereo utilities library.
64  *
65  * and the Triclops SDK by PTGrey for calculation of the stereo image.
66  * This implementation is based on the Firewire implementation and extends it. The
67  * capture() method implicitly does all the stereo processing needed. This cannot
68  * be turned off. The video modes is appropriately configured for the camera. You can
69  * get access to the left and right images where necessary using the set_image_number()
70  * method and the constants LEFT_ORIGINAL and RIGHT_ORIGINAL. The disparity image buffer
71  * can be retrieved via buffer_disparity().
72  *
73  * Currently only the low resolution version (640x480) of the Bumblebee2 is supported,
74  * an extension for the hires version may follow if we get one of these cameras.
75  *
76  * This class also encapsulates a coordinate system transformation that you can use to
77  * transform the coordinates from the camera system to another right-handed system like
78  * the robot system.
79  *
80  * The camera coordinate system has the X-axis pointing to the right,
81  * Y-axis to the floor and Z-axis forward, if the camera is placed parallel to the ground
82  * and you look in the direction of the camera. The origin of the system is in the right
83  * lens system of the Bumblebee.
84  *
85  * @author Tim Niemueller
86  */
87 
88 
89 /** Original image in RAW16 */
90 const unsigned int Bumblebee2Camera::ORIGINAL = 0;
91 
92 /** Deinterlaced image */
93 const unsigned int Bumblebee2Camera::DEINTERLACED = 1;
94 
95 /** From bayer tile decoded RGB image */
96 const unsigned int Bumblebee2Camera::RGB_IMAGE = 2;
97 
98 
99 /// PGR specific registers
100 /** PTGrey proprietary register: Bayer tile mapping information */
101 #define PGR_BAYER_TILE_MAPPING_REGISTER (0x1040)
102 
103 #define PGR_SENSOR_BOARD_INFO_REGISTER (0x1f28)
104 
105 /** PTGrey proprietary: config data length */
106 #define PGR_REG_CONFIG_LENGTH (0x1FFC)
107 
108 /** PTGrey proprietary register: config register */
109 #define PGR_REG_CONFIG_DATA (0x2000)
110 
111 /** PTGrey proprietary register: unit directory offset */
112 #define PGR_REG_UNIT_DIRECTORY_OFFSET (0x0424)
113 
114 /** PTGrey proprietary register: image data format */
115 #define PGR_REG_IMAGE_DATA_FORMAT (0x1048)
116 /** PTGrey image data format: PGR-specific (little endian) mode */
117 #define PTG_Y16_Data_Format_PGR_specific (0xFFFFFFFE)
118 
119 /** PTGrey proprietary register: serial number */
120 #define PGR_REG_SERIAL_NUMBER (0x1F20)
121 
122 /** PTGrey image data format: PGR-specific (little endian) mode */
123 /** Constructor.
124  * Initialize and take parameters from camera argument parser. The following
125  * arguments are supported:
126  * - nbufs=NBUFS, number of DMA buffers, integer, 0 < n <= 32
127  * - width=WIDTH, width in pixels of Format7 ROI
128  * - height=HEIGHT, height in pixels of Format7 ROI
129  * - startx=STARTX, X start of Format7 ROI
130  * - starty=STARTY, Y start of Format7 ROI
131  * @param cap camera argument parser
132  */
133 Bumblebee2Camera::Bumblebee2Camera(const CameraArgumentParser *cap)
134  : FirewireCamera(DC1394_FRAMERATE_30,
135  DC1394_VIDEO_MODE_FORMAT7_3,
136  DC1394_ISO_SPEED_400,
137  /* num buffers */ 8)
138 {
139  // Defaults
140 
141  _supports_color = true;
142  _auto_acquire_sensor_info = false;
143 
144  _model = strdup(cap->cam_id().c_str());
145  // num_buffers set in constructor call
146  _format7_coding = DC1394_COLOR_CODING_RAW16;
147  _format7_width = 640;
148  _format7_height = 480;
150 
151  if ( cap->has("nbufs") ) {
152  _num_buffers = atoi(cap->get("nbufs").c_str());
153  }
154  if ( cap->has("width") ) {
155  _format7_width = atoi(cap->get("width").c_str());
156  }
157  if ( cap->has("height") ) {
158  _format7_height = atoi(cap->get("height").c_str());
159  }
160  if ( cap->has("startx") ) {
161  _format7_startx = atoi(cap->get("startx").c_str());
162  }
163  if ( cap->has("starty") ) {
164  _format7_starty = atoi(cap->get("starty").c_str());
165  }
166  if ( cap->has("focus") ) {
167  parse_set_focus(cap->get("focus").c_str());
168  }
169  if ( cap->has("white_balance") ) {
170  parse_set_white_balance(cap->get("white_balance").c_str());
171  }
172  if ( cap->has("shutter") ) {
173  parse_set_shutter(cap->get("shutter").c_str());
174  }
175 
176  __buffer_deinterlaced = NULL;
177  __buffer_rgb = NULL;
178 }
179 
180 /** Constructor.
181  * Initialize and use largest possible video mode suitable for stereo
182  * processing.
183  */
185  : FirewireCamera(DC1394_FRAMERATE_30,
186  DC1394_VIDEO_MODE_FORMAT7_3,
187  DC1394_ISO_SPEED_400,
188  /* num buffers */ 8)
189 {
190  _auto_acquire_sensor_info = true;
191 
192  _model = strdup("Bumblebee2");
193  // num_buffers set in constructor call
194  _format7_coding = DC1394_COLOR_CODING_RAW16;
195  _format7_width = 640;
196  _format7_height = 480;
198 }
199 
200 /** Destructor. */
202 {
203  if (__buffer_deinterlaced != NULL) free(__buffer_deinterlaced);
204  if (__buffer_rgb != NULL) free(__buffer_rgb);
205 }
206 
207 
208 /** Get BB2 serial no.
209  * @return BB2 serial number.
210  */
211 uint32_t
213 {
214  if ( ! _opened ) throw Exception("Camera not opened");
215 
216  uint32_t value = 0;
217  dc1394error_t err = dc1394_get_control_register( _camera, PGR_REG_SERIAL_NUMBER, &value );
218  if ( err != DC1394_SUCCESS ) {
219  throw Exception("Bumblebee2::serial_no: dc1394_get_control_register(PGR_REG_SERIAL_NUMBER) failed\n");
220  }
221  return value;
222 }
223 
224 
225 /** Verify GUID validity.
226  * Compares the given GUID with the GUID of the camera. The GUID may be of two
227  * forms. If the first four bytes are all 0xFF then it is assumed that the
228  * GUID was created from the BB2-specific serial number. For example if a
229  * rectification LUT was generated with the context file only but without
230  * access to the real camera. Otherwise the GUID is matched against the
231  * Firewire GUID.
232  * @param ver_guid GUID to verify
233  * @return true if the given GUID matches the current camera, false otherwise
234  */
235 bool
236 Bumblebee2Camera::verify_guid(uint64_t ver_guid) const
237 {
238  if ( ! _opened ) throw Exception("Camera not opened");
239 
240  uint64_t tguid = ver_guid;
241  tguid >>= 32;
242  tguid &= 0xFFFFFFFF;
243  if ( tguid == 0xFFFFFFFF ) {
244  // serial number!
245  ver_guid &= 0xFFFFFFFF;
246  return (serial_no() == ver_guid);
247  } else {
248  return (guid() == ver_guid);
249  }
250 }
251 
252 
253 void
254 Bumblebee2Camera::get_sensor_info()
255 {
256  uint32_t value;
257  dc1394error_t err;
258 
259  // This register is an advanced PGR register called SENSOR_BOARD_INFO
260  err = dc1394_get_control_register(_camera, PGR_SENSOR_BOARD_INFO_REGISTER, &value );
261  if ( err != DC1394_SUCCESS )
262  {
263  throw Exception("Failed to read sensor borad info register");
264  }
265 
266  unsigned char ucSensorInfo = 0xf & value;
267 
268  switch( ucSensorInfo )
269  {
270  default:
271  // unknown sensor!
272  throw Exception("Illegal sensor board info detected!");
273  case 0xA: // color 640x480
274  _supports_color = true;
275  _format7_height = 480;
276  _format7_width = 640;
277  break;
278  case 0xB: // mono 640x480
279  _supports_color = false;
280  _format7_height = 480;
281  _format7_width = 640;
282  break;
283  case 0xC: // color 1024x768
284  _supports_color = true;
285  _format7_height = 768;
286  _format7_width = 1024;
287  break;
288  case 0xD: // mono 1024x768
289  _supports_color = false;
290  _format7_height = 768;
291  _format7_width = 1024;
292  break;
293  case 0xE: // color 1280x960
294  _supports_color = true;
295  _format7_height = 960;
296  _format7_width = 1280;
297  break;
298  case 0xF: // mono 1280x960
299  _supports_color = false;
300  _format7_height = 960;
301  _format7_width = 1280;
302  break;
303  }
304 }
305 
306 void
308 {
310 
311  printf("Serial: %u\n", serial_no());
312 #if (defined(__WORDSIZE) && __WORDSIZE == 64) || (defined(LONG_BIT) && LONG_BIT == 64)
313  printf("GUID: 0x%016lx\n", (long unsigned int)guid());
314 #else
315  printf("GUID: 0x%016llx\n", guid());
316 #endif
317 }
318 
319 
320 void
322 {
323  _dc1394 = dc1394_new();
324  dc1394camera_list_t *list;
325 
326  if ( dc1394_camera_enumerate(_dc1394, &list) != DC1394_SUCCESS ) {
327  throw Exception("Could not enumerate cameras");
328  }
329 
330  if (list->num > 0) {
331  _camera = NULL;
332  for (unsigned int i = 0; i < list->num; ++i) {
333  dc1394camera_t *tmpcam = dc1394_camera_new(_dc1394, list->ids[i].guid);
334  if ( strncmp("Bumblebee2", tmpcam->model, strlen("Bumblebee2")) == 0) {
335  // found desired camera
336  _camera = tmpcam;
337  break;
338  } else {
339  dc1394_camera_free(tmpcam);
340  }
341  }
342  if ( _camera == NULL ) {
343  throw Exception("Could not find camera with model %s", _model);
344  }
345  } else {
346  throw Exception("No cameras connected");
347  }
348 
349  _device_opened = true;
350 }
351 
352 void
354 {
355  if (_auto_acquire_sensor_info) {
356  open_device();
357  get_sensor_info();
358  }
360 
361  if ( ! _opened ) {
362  throw Exception("Bumblebee2Camera::open: FirewireCamera::open dit not suceed");
363  }
364 
365  __buffer_deinterlaced = (unsigned char *)malloc(pixel_width() * pixel_height() * 2);
366  __buffer_rgb = malloc_buffer(RGB, pixel_width(), pixel_height() * 2);
367  __buffer = NULL;
368 
369 #if __BYTE_ORDER == __LITTLE_ENDIAN
370  dc1394error_t err;
371  typedef union {
372  uint32_t value;
373  struct {
374  uint32_t presence : 1;
375  uint32_t reserved1 : 21;
376  uint32_t mirror : 1;
377  uint32_t bayer_mono : 1;
378  uint32_t reserved2 : 7;
379  uint32_t data_format: 1;
380  } idf;
381  } idf_u;
382  idf_u value;
383  err = dc1394_get_control_register( _camera, PGR_REG_IMAGE_DATA_FORMAT, &(value.value) );
384  if ( err != DC1394_SUCCESS ) {
385  throw Exception("Bumblebee2::open: dc1394_get_control_register(PGR_REG_DATA_FORMAT) failed\n");
386  }
387  value.value &= PTG_Y16_Data_Format_PGR_specific;
388  value.idf.data_format = 0;
389  err = dc1394_set_control_register( _camera, PGR_REG_IMAGE_DATA_FORMAT, value.value );
390  if ( err != DC1394_SUCCESS ) {
391  throw Exception("Bumblebee2::open: Setting PGR-specific mode on little-endian system failed\n");
392  }
393 #endif
394 
395  get_bayer_tile();
396 }
397 
398 
399 void
401 {
402  if ( _opened ) {
404  if (__buffer_deinterlaced != NULL) {
405  free(__buffer_deinterlaced);
406  __buffer_deinterlaced = NULL;
407  }
408  if (__buffer_rgb != NULL) {
409  free(__buffer_rgb);
410  __buffer_rgb = NULL;
411  }
412  }
413 }
414 
415 void
417 {
418  try {
420  } catch (CaptureException &e) {
421  e.append("Bumblebee2Camera::capture: failed to retrieve image");
422  if ( ORIGINAL == __image_num ) __buffer = NULL;
423  throw;
424  }
425  if ( ORIGINAL == __image_num ) {
426  __buffer = _frame->image;
427  }
428 }
429 
430 
431 unsigned char *
433 {
434  return __buffer;
435 }
436 
437 
438 void
439 Bumblebee2Camera::set_image_number(unsigned int image_num)
440 {
441  __image_num = image_num;
442  switch ( image_num ) {
443  case DEINTERLACED: __buffer = __buffer_deinterlaced; break;
444  case RGB_IMAGE: __buffer = __buffer_rgb; break;
445  default: __buffer = NULL; break;
446  }
447 }
448 
449 
450 /** Check if connected camera is a Bumblebee2.
451  * @return true, if the connected camera is a Bumblebee2, false otherwise
452  */
453 bool
455 {
456  if ( ! _opened ) throw CameraNotOpenedException();
457 
458  return( strncmp( _camera->model, "Bumblebee2", strlen("Bumblebee2") ) == 0);
459 }
460 
461 
462 /** De-interlace the 16 bit data into 2 bayer tile pattern images. */
463 void
465 {
466  dc1394_deinterlace_stereo( _frame->image, __buffer_deinterlaced,
467  pixel_width(), 2 * pixel_height() );
468 }
469 
470 
471 /** Extract RGB color image from the bayer tile image.
472  * This will transform the bayer tile image to an RGB image using the
473  * nearest neighbour method.
474  * Note: this will alias colors on the top and bottom rows
475  */
476 void
478 {
479  dc1394_bayer_decoding_8bit( __buffer_deinterlaced, __buffer_rgb,
480  pixel_width(), 2 * pixel_height(),
481  __bayer_pattern, DC1394_BAYER_METHOD_NEAREST );
482 }
483 
484 
485 
486 
487 
488 /** De-interlace the 16 bit data into 2 bayer tile pattern images.
489  * Can be used for offline de-interlacing.
490  * @param raw16 In-buffer RAW16-encoded
491  * @param deinterlaced upon return contains the deinterlaced image
492  * @param width width of image in pixels
493  * @param height height of image in pixels
494  */
495 void
496 Bumblebee2Camera::deinterlace_stereo(unsigned char *raw16, unsigned char *deinterlaced,
497  unsigned int width, unsigned int height)
498 {
499  dc1394_deinterlace_stereo( raw16, deinterlaced, width, 2 * height );
500 }
501 
502 
503 /** Extract RGB color image from the bayer tile image.
504  * This will transform the bayer tile image to an RGB image using the
505  * nearest neighbour method.
506  * Note: this will alias colors on the top and bottom rows
507  * @param deinterlaced in-buffer with deinterlaced image
508  * @param rgb upon return contains RGB image
509  * @param width width of image in pixels
510  * @param height height of image in pixels
511  * @param bayer_pattern bayer pattern, one of
512  * - 0x59595959 (YYYY, no pattern)
513  * - 0x52474742 (RGGB)
514  * - 0x47524247 (GRBG)
515  * - 0x42474752 (BGGR)
516  * This depends on the used camera.
517  */
518 void
519 Bumblebee2Camera::decode_bayer(unsigned char *deinterlaced, unsigned char *rgb,
520  unsigned int width, unsigned int height,
521  bayer_pattern_t bayer_pattern)
522 {
523  dc1394color_filter_t dc_bayer_pattern;
524 
525  switch (bayer_pattern) {
526  default:
527  case BAYER_PATTERN_YYYY:
528  dc_bayer_pattern = (dc1394color_filter_t) 0;
529  break;
530  case BAYER_PATTERN_RGGB:
531  dc_bayer_pattern = DC1394_COLOR_FILTER_RGGB;
532  break;
533  case BAYER_PATTERN_GBRG:
534  dc_bayer_pattern = DC1394_COLOR_FILTER_GBRG;
535  break;
536  case BAYER_PATTERN_GRBG:
537  dc_bayer_pattern = DC1394_COLOR_FILTER_GRBG;
538  break;
539  case BAYER_PATTERN_BGGR:
540  dc_bayer_pattern = DC1394_COLOR_FILTER_BGGR;
541  break;
542  }
543 
544  dc1394_bayer_decoding_8bit( deinterlaced, rgb, width, 2 * height,
545  dc_bayer_pattern, DC1394_BAYER_METHOD_NEAREST );
546 }
547 
548 
549 /** Retrieve bayer tile.
550  * This is an internal method that access a special PTGrey register in the camera to
551  * determine the bayer tile mode.
552  */
553 void
554 Bumblebee2Camera::get_bayer_tile()
555 {
556  uint32_t value;
557  if (dc1394_get_control_register( _camera, PGR_BAYER_TILE_MAPPING_REGISTER, &value) != DC1394_SUCCESS ) {
558  throw Exception("Could not query bayer tile register");
559  }
560 
561  // Magic numbers are specific to PTGrey cameras
562  switch (value) {
563  default:
564  case 0x59595959: // YYYY
565  // no bayer
566  __bayer_pattern = (dc1394color_filter_t) 0;
567  break;
568  case 0x52474742: // RGGB
569  __bayer_pattern = DC1394_COLOR_FILTER_RGGB;
570  break;
571  case 0x47425247: // GBRG
572  __bayer_pattern = DC1394_COLOR_FILTER_GBRG;
573  break;
574  case 0x47524247: // GRBG
575  __bayer_pattern = DC1394_COLOR_FILTER_GRBG;
576  break;
577  case 0x42474752: // BGGR
578  __bayer_pattern = DC1394_COLOR_FILTER_BGGR;
579  break;
580  }
581 }
582 
583 
584 /** Retrieve config from camera.
585  * This method retrieves the config from the camera and writes it to a file such that
586  * the Triclops SDK can use it for context initialization.
587  * @param filename filename to write the config to
588  * @exception Exception thrown if there is an error when trying to retrieve the config
589  * or writing it to a file.
590  */
591 void
593 {
594  dc1394error_t err;
595  uint32_t value;
596 
597  err = dc1394_get_control_register( _camera, PGR_REG_CONFIG_LENGTH, &value );
598  if ( err != DC1394_SUCCESS ) {
599  throw Exception("dc1394_get_control_register(PGR_REG_CONFIG_LENGTH) failed\n");
600  }
601 
602  // the length of the config file
603  unsigned long file_size_bytes = value;
604  if( file_size_bytes == 0 ) {
605  throw Exception("File size == 0!\n" );
606  }
607 
608  FILE* file = fopen( filename, "w" );
609  if ( !file ) {
610  throw Exception("Can't open temporary file\n" );
611  }
612 
613  // Read the config file, and save it to the output file,
614  // while fixing endianness.
615  for( unsigned long offset = 0 ; offset < file_size_bytes; offset += 4 ) {
616  err = dc1394_get_control_register( _camera,
617  PGR_REG_CONFIG_DATA + offset,
618  &value );
619 
620  if( err != DC1394_SUCCESS ) {
621  Exception e("Failed to get control register");
622  e.append("Can't get control register 0x%x\n",
623  (int) (PGR_REG_CONFIG_DATA+offset) );
624  fclose( file );
625  throw e;
626  }
627 
628  for( int i = 24; i >= 0; i -= 8 ) {
629  fputc( ( (value>>i) & 0xFF ), file );
630  }
631  }
632  fclose( file );
633 }
634 
635 } // end namespace firevision
virtual ~Bumblebee2Camera()
Destructor.
Definition: bumblebee2.cpp:201
bool _opened
true if camera has been opened, false otherwise
Definition: firewire.h:129
virtual void open()
Open the camera.
Definition: bumblebee2.cpp:353
int _format7_width
Format7 width.
Definition: firewire.h:166
virtual unsigned int pixel_width()
Width of image in pixels.
Definition: firewire.cpp:411
virtual void parse_set_focus(const char *focus)
Parse focus and set value.
Definition: firewire.cpp:739
virtual void set_image_number(unsigned int image_num)
Set image number to retrieve.
Definition: bumblebee2.cpp:439
static const unsigned int RGB_IMAGE
From bayer tile decoded RGB image.
Definition: bumblebee2.h:43
virtual void print_info()
Print out camera information.
Definition: firewire.cpp:282
virtual unsigned int pixel_height()
Height of image in pixels.
Definition: firewire.cpp:432
static const unsigned int DEINTERLACED
Deinterlaced image.
Definition: bumblebee2.h:42
void write_triclops_config_from_camera_to_file(const char *filename)
Retrieve config from camera.
Definition: bumblebee2.cpp:592
Fawkes library namespace.
Capturing a frame failed.
void decode_bayer()
Extract RGB color image from the bayer tile image.
Definition: bumblebee2.cpp:477
virtual void close()
Close camera.
Definition: firewire.cpp:388
virtual uint32_t serial_no() const
Get BB2 serial no.
Definition: bumblebee2.cpp:212
Camera argument parser.
Definition: camargp.h:38
std::string cam_id() const
Get camera ID.
Definition: camargp.cpp:139
dc1394video_frame_t * _frame
Last captured DC1394 video frame.
Definition: firewire.h:160
Camera not opened exception.
static const unsigned int ORIGINAL
Original image in RAW16.
Definition: bumblebee2.h:41
virtual uint64_t guid() const
Get Firewire GUID of camera.
Definition: firewire.cpp:306
virtual void parse_set_white_balance(const char *white_balance)
Parse white balance and set value.
Definition: firewire.cpp:766
bool _device_opened
true if device has been opened, false otherwise
Definition: firewire.h:127
bool is_bumblebee2()
Check if connected camera is a Bumblebee2.
Definition: bumblebee2.cpp:454
virtual void capture()
Capture an image.
Definition: bumblebee2.cpp:416
bool has(std::string s) const
Check if an parameter was given.
Definition: camargp.cpp:152
virtual void parse_set_shutter(const char *shutter)
Parse shutter and set value.
Definition: firewire.cpp:808
Base class for exceptions in Fawkes.
Definition: exception.h:36
virtual void print_info()
Print out camera information.
Definition: bumblebee2.cpp:307
virtual void close()
Close camera.
Definition: bumblebee2.cpp:400
char * _model
Camera model, used in open to identify the camera, if empty first found camera is used...
Definition: firewire.h:191
int _format7_height
Format7 height.
Definition: firewire.h:168
void deinterlace_stereo()
De-interlace the 16 bit data into 2 bayer tile pattern images.
Definition: bumblebee2.cpp:464
dc1394color_coding_t _format7_coding
Format7 color coding.
Definition: firewire.h:162
virtual void open()
Open the camera.
Definition: firewire.cpp:153
dc1394camera_t * _camera
DC1394 camera handle.
Definition: firewire.h:158
virtual void capture()
Capture an image.
Definition: firewire.cpp:331
Bumblebee2Camera()
Constructor.
Definition: bumblebee2.cpp:184
int _format7_startx
Format7 ROI Start X coordinate.
Definition: firewire.h:170
int _num_buffers
Number of DMA buffers.
Definition: firewire.h:125
std::string get(std::string s) const
Get the value of the given parameter.
Definition: camargp.cpp:164
virtual bool verify_guid(uint64_t ver_guid) const
Verify GUID validity.
Definition: bumblebee2.cpp:236
Firewire camera.
Definition: firewire.h:44
dc1394_t * _dc1394
DC1394 main context.
Definition: firewire.h:148
void append(const char *format,...)
Append messages to the message list.
Definition: exception.cpp:341
virtual void open_device()
Open the desired device.
Definition: bumblebee2.cpp:321
virtual unsigned char * buffer()
Get access to current image buffer.
Definition: bumblebee2.cpp:432
int _format7_starty
Format7 ROI Start Y coordinate.
Definition: firewire.h:172