Main MRPT website > C++ reference for MRPT 1.3.2
CStereoGrabber_Bumblebee.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2015, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef CStereoGrabber_Bumblebee_H
10 #define CStereoGrabber_Bumblebee_H
11 
14 #include <mrpt/utils/CUncopiable.h>
15 
16 #ifndef MRPT_OS_WINDOWS
18 #endif
19 
20 #include <mrpt/config.h>
21 
22 namespace mrpt
23 {
24  namespace hwdrivers
25  {
26  /** Options used when creating a bumblebee camera capture object
27  * \ingroup mrpt_hwdrivers_grp
28  */
30  {
32 
33  int frame_width, frame_height; //!< Capture resolution (Default: 640x480)
34  bool color; //!< Indicates if the Bumblebee camera must capture color images (Default: false -> grayscale)
35  bool getRectified; //!< Indicates if the Bumblebee camera must capture rectified images (Default: true -> rectified)
36  double framerate; //!< Bumblebee camera frame rate (Default: 15 fps)
37  };
38 
39  /** A class for grabing stereo images from a "Bumblebee" or "Bumblebee2" camera
40  * NOTE:
41  * - Windows:
42  * - This class is only available when compiling MRPT with "MRPT_HAS_BUMBLEBEE".
43  * - You will need the "include" and "lib" directories of the vendor's proprietary software to be included in VC++ includes path.
44  * - Linux:
45  * - This class is only available when compiling MRPT with "MRPT_HAS_LIBDC1394_2".
46  * - Capture will be made in color, full resolution and "raw" (not rectified) only.
47  *
48  * Once connected to a camera, you can call "getStereoObservation" to retrieve the stereo images.
49  *
50  * \sa You'll probably want to use instead the most generic camera grabber in MRPT: mrpt::hwdrivers::CCameraSensor
51  * \ingroup mrpt_hwdrivers_grp
52  */
54  {
55  protected:
56 #ifdef MRPT_OS_WINDOWS
57  void *m_triclops; //!< The Triclops context (TriclopsContext)
58  void *m_flycapture; //!< The Flycapture context (FlyCaptureContext).
59  vector_byte m_imgBuff; //!< A buffer to store an image
60 #else
61  mrpt::hwdrivers::CImageGrabber_dc1394 *m_firewire_capture; //!< The actual capture object used in Linux / Mac.
62 #endif
63 
64  bool m_bInitialized; //!< If this has been correctly initiated
65  unsigned int m_resolutionX, m_resolutionY; //!< The desired resolution
66 
67  float m_baseline; //!< Camera baseline
68  float m_focalLength; //!< Camera focal length
69  float m_centerCol, m_centerRow; //!< Camera center coordinates
70 
71 
72  private:
73 
74 #ifdef MRPT_OS_WINDOWS
75  void scaleImage( void* image, unsigned char ucMinOut, unsigned char ucMaxOut );
76  void convertTriclopsImageTo8BitsIplImage( void *src, void* dst );
77 
78  /** Splits a TriclopsImage (grayscale) into two separate IplImages (from the left and right cameras) (for internal use only)
79  * triclopsImage [input]. The Triclops image to split
80  * dstL [output]. The Left CImage.
81  * dstR [output]. The Right CImage.
82  */
83  static void convertTriclopsImagesToIplImages(
84  void* triclopsImage,
85  void* dstL,
86  void* dstR );
87 
88 #endif
89  /** Splits a Flycapture image into two separate IplImages (from the left and right cameras) (for internal use only)
90  * triclopsImage [input]. The FlyCapture image to split
91  * dstL [output]. The Left CImage.
92  * dstR [output]. The Right CImage.
93  */
94  static void convertFlyCaptureImagesToIplImages( void* flycapImage, void* dstL, void* dstR );
95 
96  public:
97 
98  TCaptureOptions_bumblebee m_options; //!< Bumblebee camera frame rate (Default: 15 fps)
99 
100  /** Constructor: */
101  CStereoGrabber_Bumblebee( int cameraIndex = 0, const TCaptureOptions_bumblebee &options = TCaptureOptions_bumblebee() );
102 
103  /** Destructor */
104  virtual ~CStereoGrabber_Bumblebee(void);
105 
106  /** Grab stereo images, and return the pair of rectified images.
107  * \param out_observation The object to be filled with sensed data.
108  *
109  * NOTICE: (1) That the member "CObservationStereoImages::refCameraPose" must be
110  * set on the return of this method, since we don't know here the robot physical structure.
111  * (2) The images are already rectified.
112  *
113  * \return false on any error, true if all go fine.
114  */
115  bool getStereoObservation( mrpt::obs::CObservationStereoImages &out_observation );
116 
117 
118  }; // End of class
119 
120  } // End of NS
121 } // End of NS
122 
123 
124 #endif
double framerate
Bumblebee camera frame rate (Default: 15 fps)
std::vector< uint8_t > vector_byte
Definition: types_simple.h:26
bool m_bInitialized
If this has been correctly initiated.
A class for grabing images from a IEEE1394 (Firewire) camera using the libdc1394-2 library...
Options used when creating a bumblebee camera capture object.
float m_centerRow
Camera center coordinates.
Observation class for either a pair of left+right or left+disparity images from a stereo camera...
mrpt::hwdrivers::CImageGrabber_dc1394 * m_firewire_capture
The actual capture object used in Linux / Mac.
The base class of classes that cannot be copied: compile-time errors will be issued on any copy opera...
Definition: CUncopiable.h:30
A class for grabing stereo images from a "Bumblebee" or "Bumblebee2" camera NOTE: ...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool getRectified
Indicates if the Bumblebee camera must capture rectified images (Default: true -> rectified) ...
unsigned int m_resolutionY
The desired resolution.
TCaptureOptions_bumblebee m_options
Bumblebee camera frame rate (Default: 15 fps)
bool color
Indicates if the Bumblebee camera must capture color images (Default: false -> grayscale) ...
#define HWDRIVERS_IMPEXP



Page generated by Doxygen 1.8.11 for MRPT 1.3.2 SVN: at Mon May 9 06:50:38 UTC 2016