class mrpt::hwdrivers::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 example code in [samples]/captureVideoFlyCapture2 and [samples]/captureVideoFlyCapture2_stereo.

#include <mrpt/hwdrivers/CImageGrabber_FlyCapture2.h>

class CImageGrabber_FlyCapture2
{
public:
    // construction

    CImageGrabber_FlyCapture2();
    CImageGrabber_FlyCapture2(const CImageGrabber_FlyCapture2&);
    CImageGrabber_FlyCapture2(const TCaptureOptions_FlyCapture2& options);

    //
methods

    CImageGrabber_FlyCapture2& operator = (const CImageGrabber_FlyCapture2&);
    const TCaptureOptions_FlyCapture2& getCameraOptions() const;
    void open(const TCaptureOptions_FlyCapture2& options, const bool startCapture = true);
    void startCapture();
    void stopCapture();
    void close();
    bool getObservation(mrpt::obs::CObservationImage& out_observation);
    bool getObservation(mrpt::obs::CObservationStereoImages& out_observation);
    bool isStereo();
    static void startSyncCapture(int numCameras, const CImageGrabber_FlyCapture2** cameras_array);
    static std::string getFC2version();
};

Construction

CImageGrabber_FlyCapture2()

Constructor that does not open a camera.

Default constructor.

See also:

open()

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()

Methods

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.

Tries to open the camera with the given options.

Raises an exception on error. Raises an exception on error.

Parameters:

startCapture

If 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()

close()

void startCapture()

Start the actual image capture of the camera.

Must be called after open(), only when “startCapture” was set to false. 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.

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.

bool isStereo()

Returns if current configuration is stereo or not.

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.