MRPT  1.9.9
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 185 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

voidm_camera
 Opaque pointer to the FlyCapture2::Camera object. More...
 
voidm_camera_info
 Opaque pointer to the FlyCapture2::CameraInfo object. 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. 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 262 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 274 of file CImageGrabber_FlyCapture2.cpp.

References m_img_buffer, and open().

◆ ~CImageGrabber_FlyCapture2()

CImageGrabber_FlyCapture2::~CImageGrabber_FlyCapture2 ( )
virtual

Destructor.

Definition at line 288 of file CImageGrabber_FlyCapture2.cpp.

References close(), FC2_BUF_IMG, and m_img_buffer.

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

◆ getCameraOptions()

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

Returns the current settings of the camera.

Definition at line 228 of file CImageGrabber_FlyCapture2.h.

References m_options.

◆ getFC2version()

std::string CImageGrabber_FlyCapture2::getFC2version ( )
static

Returns the PGR FlyCapture2 library version.

Definition at line 707 of file CImageGrabber_FlyCapture2.cpp.

References mrpt::format(), and THROW_EXCEPTION.

Referenced by open().

◆ getObservation() [1/2]

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

◆ getObservation() [2/2]

◆ isStereo()

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

Returns if current configuration is stereo or not.

Definition at line 280 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 299 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().

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

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

Referenced by open().

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

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

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

◆ stopCapture()

void CImageGrabber_FlyCapture2::stopCapture ( )

Stop capture.

Definition at line 635 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

◆ m_baseline

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

Camera baseline (only for stereo cameras)

Definition at line 203 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_camera

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

Opaque pointer to the FlyCapture2::Camera object.

nullptr if no camera is grabbing.

Definition at line 190 of file CImageGrabber_FlyCapture2.h.

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

◆ m_camera_info

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

Opaque pointer to the FlyCapture2::CameraInfo object.

nullptr if no camera is grabbing.

Definition at line 193 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 207 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_centerRow

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

Definition at line 207 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 205 of file CImageGrabber_FlyCapture2.h.

Referenced by getObservation(), and open().

◆ m_img_buffer

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 196 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 210 of file CImageGrabber_FlyCapture2.h.

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

◆ m_triclops

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

Opaque pointer to the TriclopsContext objetc.

nullptr if no context is active.

Definition at line 199 of file CImageGrabber_FlyCapture2.h.

Referenced by close(), and open().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020