Class CImageGrabber_FlyCapture2

Class Documentation

class CImageGrabber_FlyCapture2

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 also

See example code in [samples]/captureVideoFlyCapture2 and [samples]/captureVideoFlyCapture2_stereo.

Public Functions

CImageGrabber_FlyCapture2()

Constructor that does not open a camera.

See also

open()

CImageGrabber_FlyCapture2(const CImageGrabber_FlyCapture2&) = delete
CImageGrabber_FlyCapture2 &operator=(const CImageGrabber_FlyCapture2&) = delete
CImageGrabber_FlyCapture2(const TCaptureOptions_FlyCapture2 &options)

Constructor: tries to open the camera with the given options. Raises an exception on error.

See also

open()

virtual ~CImageGrabber_FlyCapture2()

Destructor

inline const TCaptureOptions_FlyCapture2 &getCameraOptions() const

Returns the current settings of the camera

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

Tries to open the camera with the given options, and starts capture. Raises an exception on error.

Parameters:

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

void startCapture()

Start the actual image capture of the camera. Must be called after open(), only when “startCapture” was set to false.

See also

startSyncCapture

void stopCapture()

Stop capture.

void close()

Stop capture and closes the opened camera, if any. Called automatically on object destruction.

bool getObservation(mrpt::obs::CObservationImage &out_observation)

Grab mono image from the camera. This method blocks until the next frame is captured.

Returns:

false on any error.

bool getObservation(mrpt::obs::CObservationStereoImages &out_observation)

Grab stereo image from the camera. This method blocks until the next frame is captured.

Returns:

false on any error.

inline bool isStereo()

Returns if current configuration is stereo or not

Public Static Functions

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

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

static std::string getFC2version()

Returns the PGR FlyCapture2 library version

Protected Attributes

void *m_camera = {nullptr}

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

void *m_camera_info = {nullptr}

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

void *m_img_buffer = {nullptr}

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

void *m_triclops = {nullptr}

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

float m_baseline

Camera baseline (only for stereo cameras)

float m_focalLength

Camera focal length

float m_centerCol

Camera center coordinates

float m_centerRow
TCaptureOptions_FlyCapture2 m_options

Camera options