MRPT  2.0.4
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 181 of file CImageGrabber_FlyCapture2.h.

#include <mrpt/hwdrivers/CImageGrabber_FlyCapture2.h>

Public Member Functions

 CImageGrabber_FlyCapture2 ()
 Constructor that does not open a camera. More...
 
 CImageGrabber_FlyCapture2 (const CImageGrabber_FlyCapture2 &)=delete
 
CImageGrabber_FlyCapture2operator= (const CImageGrabber_FlyCapture2 &)=delete
 
 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

void * m_camera {nullptr}
 Opaque pointer to the FlyCapture2::Camera object. More...
 
void * m_camera_info {nullptr}
 Opaque pointer to the FlyCapture2::CameraInfo object. More...
 
void * m_img_buffer {nullptr}
 Opaque pointer to the FlyCapture2::Image, used as a temporary buffer and to avoid mem alloc/reallocs. More...
 
void * m_triclops {nullptr}
 Opaque pointer to the TriclopsContext objetc. More...
 
float m_baseline
 Camera baseline (only for stereo cameras) More...
 
float m_focalLength
 Camera focal length. More...
 
float m_centerCol
 Camera center coordinates. More...
 
float m_centerRow
 
TCaptureOptions_FlyCapture2 m_options
 Camera options. More...
 

Constructor & Destructor Documentation

◆ CImageGrabber_FlyCapture2() [1/3]

CImageGrabber_FlyCapture2::CImageGrabber_FlyCapture2 ( )

Constructor that does not open a camera.

Default constructor.

See also
open()

Definition at line 234 of file CImageGrabber_FlyCapture2.cpp.

References m_img_buffer.

◆ CImageGrabber_FlyCapture2() [2/3]

mrpt::hwdrivers::CImageGrabber_FlyCapture2::CImageGrabber_FlyCapture2 ( const CImageGrabber_FlyCapture2 )
delete

◆ CImageGrabber_FlyCapture2() [3/3]

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 242 of file CImageGrabber_FlyCapture2.cpp.

References m_img_buffer, and open().

Here is the call graph for this function:

◆ ~CImageGrabber_FlyCapture2()

CImageGrabber_FlyCapture2::~CImageGrabber_FlyCapture2 ( )
virtual

Destructor.

Definition at line 256 of file CImageGrabber_FlyCapture2.cpp.

References close(), FC2_BUF_IMG, and m_img_buffer.

Here is the call graph for this function:

Member Function Documentation

◆ close()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCameraOptions()

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

Returns the current settings of the camera.

Definition at line 224 of file CImageGrabber_FlyCapture2.h.

References m_options.

◆ getFC2version()

std::string CImageGrabber_FlyCapture2::getFC2version ( )
static

Returns the PGR FlyCapture2 library version.

Definition at line 672 of file CImageGrabber_FlyCapture2.cpp.

References mrpt::format(), and THROW_EXCEPTION.

Referenced by open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObservation() [1/2]

bool CImageGrabber_FlyCapture2::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.

Definition at line 691 of file CImageGrabber_FlyCapture2.cpp.

References CHECK_FC2_ERROR, mrpt::obs::gnss::error, FC2_BUF_IMG, FC2_CAM, mrpt::obs::CObservationImage::image, mrpt::img::CImage::loadFromMemoryBuffer(), m_camera, mrpt::system::now(), THROW_EXCEPTION, mrpt::system::time_tToTimestamp(), and mrpt::obs::CObservation::timestamp.

Here is the call graph for this function:

◆ getObservation() [2/2]

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

◆ isStereo()

bool mrpt::hwdrivers::CImageGrabber_FlyCapture2::isStereo ( )
inline

Returns if current configuration is stereo or not.

Definition at line 276 of file CImageGrabber_FlyCapture2.h.

References m_options, and mrpt::hwdrivers::TCaptureOptions_FlyCapture2::stereo_mode.

◆ open()

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 267 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::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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

CImageGrabber_FlyCapture2& mrpt::hwdrivers::CImageGrabber_FlyCapture2::operator= ( const CImageGrabber_FlyCapture2 )
delete

◆ startCapture()

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 549 of file CImageGrabber_FlyCapture2.cpp.

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

Referenced by open().

Here is the caller graph for this function:

◆ startSyncCapture()

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

Here is the caller graph for this function:

◆ stopCapture()

void CImageGrabber_FlyCapture2::stopCapture ( )

Stop capture.

Definition at line 600 of file CImageGrabber_FlyCapture2.cpp.

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

Referenced by close().

Here is the caller graph for this function:

Member Data Documentation

◆ m_baseline

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

Camera baseline (only for stereo cameras)

Definition at line 199 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_camera

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_camera {nullptr}
protected

Opaque pointer to the FlyCapture2::Camera object.

nullptr if no camera is grabbing.

Definition at line 186 of file CImageGrabber_FlyCapture2.h.

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

◆ m_camera_info

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_camera_info {nullptr}
protected

Opaque pointer to the FlyCapture2::CameraInfo object.

nullptr if no camera is grabbing.

Definition at line 189 of file CImageGrabber_FlyCapture2.h.

Referenced by close(), and open().

◆ m_centerCol

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

Camera center coordinates.

Definition at line 203 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_centerRow

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

Definition at line 203 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_focalLength

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

Camera focal length.

Definition at line 201 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_img_buffer

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_img_buffer {nullptr}
protected

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

Definition at line 192 of file CImageGrabber_FlyCapture2.h.

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

◆ m_options

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

Camera options.

Definition at line 206 of file CImageGrabber_FlyCapture2.h.

Referenced by getCameraOptions(), isStereo(), and open().

◆ m_triclops

void* mrpt::hwdrivers::CImageGrabber_FlyCapture2::m_triclops {nullptr}
protected

Opaque pointer to the TriclopsContext objetc.

nullptr if no context is active.

Definition at line 195 of file CImageGrabber_FlyCapture2.h.

Referenced by close(), and open().




Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020