Main MRPT website > C++ reference for MRPT 1.5.6
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
mrpt::hwdrivers::CImageGrabber_FlyCapture2 Class Reference

Detailed Description

A wrapper for Point Gray Research (PGR) FlyCapture2 API for capturing images from Firewire, USB3 or GigaE cameras and stereo cameras.

This class is only available when compiling MRPT with "MRPT_HAS_PGR_FLYCAPTURE2".

See Also
See the most generic camera grabber in MRPT: mrpt::hwdrivers::CCameraSensor
See example code in [samples]/captureVideoFlyCapture2 and [samples]/captureVideoFlyCapture2_stereo.

Definition at line 131 of file CImageGrabber_FlyCapture2.h.

#include <mrpt/hwdrivers/CImageGrabber_FlyCapture2.h>

Inheritance diagram for mrpt::hwdrivers::CImageGrabber_FlyCapture2:
Inheritance graph

Public Member Functions

 CImageGrabber_FlyCapture2 ()
 Constructor that does not open a camera. More...
 
 CImageGrabber_FlyCapture2 (const TCaptureOptions_FlyCapture2 &options)
 Constructor: tries to open the camera with the given options. More...
 
virtual ~CImageGrabber_FlyCapture2 ()
 Destructor. More...
 
const TCaptureOptions_FlyCapture2getCameraOptions () const
 Returns the current settings of the camera. More...
 
void open (const TCaptureOptions_FlyCapture2 &options, const bool startCapture=true)
 Tries to open the camera with the given options, and starts capture. More...
 
void startCapture ()
 Start the actual image capture of the camera. More...
 
void stopCapture ()
 Stop capture. More...
 
void close ()
 Stop capture and closes the opened camera, if any. More...
 
bool getObservation (mrpt::obs::CObservationImage &out_observation)
 Grab mono image from the camera. More...
 
bool getObservation (mrpt::obs::CObservationStereoImages &out_observation)
 Grab stereo image from the camera. More...
 
bool isStereo ()
 Returns if current configuration is stereo or not. More...
 

Static Public Member Functions

static void startSyncCapture (int numCameras, const CImageGrabber_FlyCapture2 **cameras_array)
 Starts a synchronous capture of several cameras, which must have been already opened. More...
 
static std::string getFC2version ()
 Returns the PGR FlyCapture2 library version. More...
 

Protected Attributes

voidm_camera
 Opaque pointer to the FlyCapture2::Camera object. NULL if no camera is grabbing. More...
 
voidm_camera_info
 Opaque pointer to the FlyCapture2::CameraInfo object. NULL if no camera is grabbing. More...
 
voidm_img_buffer
 Opaque pointer to the FlyCapture2::Image, used as a temporary buffer and to avoid mem alloc/reallocs. More...
 
voidm_triclops
 Opaque pointer to the TriclopsContext objetc. NULL if no context is active. More...
 
float m_baseline
 Camera baseline (only for stereo cameras) More...
 
float m_focalLength
 Camera focal length. More...
 
float m_centerCol
 
float m_centerRow
 Camera center coordinates. More...
 
TCaptureOptions_FlyCapture2 m_options
 Camera options. More...
 

Constructor & Destructor Documentation

CImageGrabber_FlyCapture2::CImageGrabber_FlyCapture2 ( )

Constructor that does not open a camera.

Default constructor.

See Also
open()

Definition at line 227 of file CImageGrabber_FlyCapture2.cpp.

References m_img_buffer.

CImageGrabber_FlyCapture2::CImageGrabber_FlyCapture2 ( const TCaptureOptions_FlyCapture2 options)

Constructor: tries to open the camera with the given options.

Constructor + open.

Raises an exception on error.

See Also
open()

Definition at line 239 of file CImageGrabber_FlyCapture2.cpp.

References m_img_buffer, and open().

CImageGrabber_FlyCapture2::~CImageGrabber_FlyCapture2 ( )
virtual

Destructor.

Definition at line 252 of file CImageGrabber_FlyCapture2.cpp.

References close(), FC2_BUF_IMG, and m_img_buffer.

Member Function Documentation

void CImageGrabber_FlyCapture2::close ( )

Stop capture and closes the opened camera, if any.

Closes the opened camera, if any.

Called automatically on object destruction.

Definition at line 588 of file CImageGrabber_FlyCapture2.cpp.

References FC2_CAM, FC2_CAM_INFO, m_camera, m_camera_info, m_triclops, stopCapture(), THROW_EXCEPTION, and TRI_CONTEXT.

Referenced by open(), and ~CImageGrabber_FlyCapture2().

const TCaptureOptions_FlyCapture2& mrpt::hwdrivers::CImageGrabber_FlyCapture2::getCameraOptions ( ) const
inline

Returns the current settings of the camera.

Definition at line 157 of file CImageGrabber_FlyCapture2.h.

std::string CImageGrabber_FlyCapture2::getFC2version ( )
static

Returns the PGR FlyCapture2 library version.

Definition at line 619 of file CImageGrabber_FlyCapture2.cpp.

References mrpt::mrpt::format(), and THROW_EXCEPTION.

Referenced by open().

bool CImageGrabber_FlyCapture2::getObservation ( mrpt::obs::CObservationImage out_observation)
bool CImageGrabber_FlyCapture2::getObservation ( mrpt::obs::CObservationStereoImages out_observation)
bool mrpt::hwdrivers::CImageGrabber_FlyCapture2::isStereo ( )
inline

Returns if current configuration is stereo or not.

Definition at line 194 of file CImageGrabber_FlyCapture2.h.

void CImageGrabber_FlyCapture2::open ( const TCaptureOptions_FlyCapture2 options,
const bool  startCapture = true 
)

Tries to open the camera with the given options, and starts capture.

Tries to open the camera with the given options.

Raises an exception on error.

Parameters
[in]startCaptureIf set to false, the camera is only opened and configured, but a posterior call to startCapture() is required to start grabbing images.
See Also
close(), startCapture()

Raises an exception on error.

See Also
close()

Definition at line 262 of file CImageGrabber_FlyCapture2.cpp.

References mrpt::hwdrivers::TCaptureOptions_FlyCapture2::autoexposure_abs, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::autoexposure_auto, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::autoexposure_EV, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::autoexposure_onOff, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::camera_guid, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::camera_index, CHECK_FC2_ERROR, CHECK_TRICLOPS_ERROR, close(), mrpt::obs::gnss::error, FC2_CAM, FC2_CAM_INFO, mrpt::mrpt::format(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::framerate, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::gain_abs, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::gain_auto, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::gain_dB, getFC2version(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::grabmode, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::grabTimeout, m_baseline, m_camera, m_camera_info, m_centerCol, m_centerRow, m_focalLength, m_options, m_triclops, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::numBuffers, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::open_by_guid, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::rect_height, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::rect_width, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::shutter_abs, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::shutter_auto, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::shutter_time_ms, startCapture(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::stereo_mode, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::strobe_delay, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::strobe_duration, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::strobe_enabled, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::strobe_polarity, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::strobe_source, THROW_EXCEPTION, TRI_CONTEXT, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::trigger_enabled, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::trigger_mode, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::trigger_polarity, mrpt::hwdrivers::TCaptureOptions_FlyCapture2::trigger_source, and mrpt::hwdrivers::TCaptureOptions_FlyCapture2::videomode.

Referenced by CImageGrabber_FlyCapture2().

void CImageGrabber_FlyCapture2::startCapture ( )

Start the actual image capture of the camera.

Must be called after open(), only when "startCapture" was set to false.

See Also
startSyncCapture

Must be called after open(), only when "startCapture" was set to false.

Definition at line 530 of file CImageGrabber_FlyCapture2.cpp.

References CHECK_FC2_ERROR, mrpt::obs::gnss::error, FC2_CAM, m_camera, and THROW_EXCEPTION.

Referenced by open().

void CImageGrabber_FlyCapture2::startSyncCapture ( int  numCameras,
const CImageGrabber_FlyCapture2 **  cameras_array 
)
static

Starts a synchronous capture of several cameras, which must have been already opened.

NOTE: This method only works with Firewire cameras, not with USB3 or GigaE ones (as confirmed by PGR support service).

See Also
startCapture

Definition at line 544 of file CImageGrabber_FlyCapture2.cpp.

References CHECK_FC2_ERROR, mrpt::obs::gnss::error, m_camera, THROW_EXCEPTION, and THROW_EXCEPTION_FMT.

Referenced by mrpt::hwdrivers::CCameraSensor::initialize().

void CImageGrabber_FlyCapture2::stopCapture ( )

Stop capture.

Definition at line 570 of file CImageGrabber_FlyCapture2.cpp.

References CHECK_FC2_ERROR, mrpt::obs::gnss::error, FC2_CAM, m_camera, and THROW_EXCEPTION.

Referenced by close().

Member Data Documentation

float mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_baseline
protected

Camera baseline (only for stereo cameras)

Definition at line 140 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_camera
protected

Opaque pointer to the FlyCapture2::Camera object. NULL if no camera is grabbing.

Definition at line 134 of file CImageGrabber_FlyCapture2.h.

Referenced by close(), getObservation(), open(), startCapture(), startSyncCapture(), and stopCapture().

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_camera_info
protected

Opaque pointer to the FlyCapture2::CameraInfo object. NULL if no camera is grabbing.

Definition at line 135 of file CImageGrabber_FlyCapture2.h.

Referenced by close(), and open().

float mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_centerCol
protected

Definition at line 142 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

float mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_centerRow
protected

Camera center coordinates.

Definition at line 142 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

float mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_focalLength
protected

Camera focal length.

Definition at line 141 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_img_buffer
protected

Opaque pointer to the FlyCapture2::Image, used as a temporary buffer and to avoid mem alloc/reallocs.

Definition at line 136 of file CImageGrabber_FlyCapture2.h.

Referenced by CImageGrabber_FlyCapture2(), and ~CImageGrabber_FlyCapture2().

TCaptureOptions_FlyCapture2 mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_options
protected

Camera options.

Definition at line 144 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_triclops
protected

Opaque pointer to the TriclopsContext objetc. NULL if no context is active.

Definition at line 137 of file CImageGrabber_FlyCapture2.h.

Referenced by close(), and open().




Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018