MRPT
1.9.9
|
A class for grabing images from a IEEE1394 (Firewire) camera using the libdc1394-2 library.
See the constructor for the options when opening the camera. Notice that you may have to carefully set the resolution, framerate and color_mode. See the verbose parameter of the constructor, which can display a list of supported modes in your camera.
This class is able to manage any Firewire cameras, including Stereo or multi-cameras in general, so this can be used to open the Bumblebee camera (not tested yet).
A static method (CImageGrabber_dc1394::enumerateCameras) is provided to enumerate all existing cameras and their properties. It can be used to find the GUID of the desired camera, then open it at the constructor.
Definition at line 125 of file CImageGrabber_dc1394.h.
#include <mrpt/hwdrivers/CImageGrabber_dc1394.h>
Classes | |
struct | TCameraInfo |
Used in enumerateCameras. More... | |
Public Types | |
using | TCameraInfoList = std::list< TCameraInfo > |
Public Member Functions | |
CImageGrabber_dc1394 (uint64_t cameraGUID=0, uint16_t cameraUnit=0, const TCaptureOptions_dc1394 &options=TCaptureOptions_dc1394(), bool verbose=false) | |
Constructor: open an ieee1394 camera. More... | |
virtual | ~CImageGrabber_dc1394 () |
Destructor. More... | |
bool | isOpen () const |
Check whether the camera has been open successfully. More... | |
bool | changeCaptureOptions (const TCaptureOptions_dc1394 &options) |
Changes the capture properties (brightness, gain, shutter, etc) The frame size, framerate, and color_coding fields in options are ignored since they can be only set at construction time. More... | |
bool | getObservation (mrpt::obs::CObservationImage &out_observation) |
Grab an image from the opened camera (for monocular cameras). More... | |
bool | getObservation (mrpt::obs::CObservationStereoImages &out_observation) |
Grab an image from the opened camera (for stereo cameras). More... | |
bool | setSoftwareTriggerLevel (bool level) |
Changes the boolean level associated to Software Trigger (ON/OFF) Can be used to control camera triggering trough software. More... | |
Static Public Member Functions | |
static void | enumerateCameras (TCameraInfoList &out_list) |
Generates a list with the information on all the existing (Firewire) cameras in the system. More... | |
Protected Attributes | |
bool | m_bInitialized {false} |
Set to false if we could not initialize the camera. More... | |
void * | m_dc1394_lib_context {nullptr} |
Internal use: More... | |
void * | m_dc1394camera {nullptr} |
int | m_desired_mode |
TCaptureOptions_dc1394 | m_options |
using mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfoList = std::list<TCameraInfo> |
Definition at line 221 of file CImageGrabber_dc1394.h.
CImageGrabber_dc1394::CImageGrabber_dc1394 | ( | uint64_t | cameraGUID = 0 , |
uint16_t | cameraUnit = 0 , |
||
const TCaptureOptions_dc1394 & | options = TCaptureOptions_dc1394() , |
||
bool | verbose = false |
||
) |
Constructor: open an ieee1394 camera.
cameraGUID | Set the camera GUID to open, or 0 to open the first found camera. |
cameraUnit | (Ignored if cameraGUID=0). The number of camera to open within the device with the given GUID: In a stereo camera this may be 0 or 1. Normally this is 0. |
options | Capture options, defined in mrpt::hwdrivers::TCaptureOptions_dc1394. |
verbose | Displays a lot of information about the camera to be open and its valid video modes. |
Definition at line 33 of file CImageGrabber_dc1394.cpp.
References ASSERT_, changeCaptureOptions(), mrpt::hwdrivers::TCaptureOptions_dc1394::color_coding, mrpt::format(), mrpt::hwdrivers::TCaptureOptions_dc1394::frame_height, mrpt::hwdrivers::TCaptureOptions_dc1394::frame_width, mrpt::hwdrivers::TCaptureOptions_dc1394::framerate, mrpt::hwdrivers::FRAMERATE_120, mrpt::hwdrivers::FRAMERATE_15, mrpt::hwdrivers::FRAMERATE_1_875, mrpt::hwdrivers::FRAMERATE_240, mrpt::hwdrivers::FRAMERATE_30, mrpt::hwdrivers::FRAMERATE_3_75, mrpt::hwdrivers::FRAMERATE_60, mrpt::hwdrivers::FRAMERATE_7_5, m_bInitialized, m_dc1394_lib_context, m_dc1394camera, m_desired_mode, m_options, mrpt::hwdrivers::TCaptureOptions_dc1394::mode7, MRPT_END, MRPT_START, mrpt::hwdrivers::TCaptureOptions_dc1394::ring_buffer_size, THE_CAMERA, THE_CONTEXT, THROW_EXCEPTION, mrpt::hwdrivers::TCaptureOptions_dc1394::trigger_power, and verbose.
|
virtual |
Destructor.
Definition at line 460 of file CImageGrabber_dc1394.cpp.
References m_bInitialized, THE_CAMERA, and THE_CONTEXT.
bool CImageGrabber_dc1394::changeCaptureOptions | ( | const TCaptureOptions_dc1394 & | options | ) |
Changes the capture properties (brightness, gain, shutter, etc) The frame size, framerate, and color_coding fields in options are ignored since they can be only set at construction time.
Definition at line 689 of file CImageGrabber_dc1394.cpp.
References m_bInitialized, MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by CImageGrabber_dc1394().
|
static |
Generates a list with the information on all the existing (Firewire) cameras in the system.
std::runtime_error | On any error calling libdc1394. |
Definition at line 775 of file CImageGrabber_dc1394.cpp.
References mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::advanced_features_csr, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::bmode_capable, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::can_switch_on_off, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::command_registers_base, mrpt::format(), mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::format7_csr, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::guid, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::has_feature_error_status, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::has_vmode_error_status, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::iidc_version, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::max_mem_channel, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::model, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::model_id, MRPT_END, MRPT_START, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::multi_shot_capable, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::one_shot_capable, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::PIO_control_csr, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::SIO_control_csr, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::strobe_control_csr, THROW_EXCEPTION, THROW_STACKED_EXCEPTION, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::unit, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::unit_dependent_directory, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::unit_directory, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::unit_spec_ID, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::unit_sub_sw_version, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::unit_sw_version, mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::vendor, and mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfo::vendor_id.
bool CImageGrabber_dc1394::getObservation | ( | mrpt::obs::CObservationImage & | out_observation | ) |
Grab an image from the opened camera (for monocular cameras).
out_observation | The object to be filled with sensed data. |
Definition at line 490 of file CImageGrabber_dc1394.cpp.
References mrpt::hwdrivers::TCaptureOptions_dc1394::deinterlace_stereo, mrpt::obs::CObservationImage::image, mrpt::img::CImage::loadFromMemoryBuffer(), m_bInitialized, m_options, MRPT_END, MRPT_START, mrpt::system::now(), THE_CAMERA, THROW_EXCEPTION, and mrpt::obs::CObservation::timestamp.
Referenced by mrpt::hwdrivers::CStereoGrabber_Bumblebee_libdc1394::getStereoObservation().
bool CImageGrabber_dc1394::getObservation | ( | mrpt::obs::CObservationStereoImages & | out_observation | ) |
Grab an image from the opened camera (for stereo cameras).
out_observation | The object to be filled with sensed data. |
Definition at line 606 of file CImageGrabber_dc1394.cpp.
References mrpt::hwdrivers::TCaptureOptions_dc1394::deinterlace_stereo, mrpt::obs::CObservationStereoImages::imageLeft, mrpt::obs::CObservationStereoImages::imageRight, mrpt::img::CImage::loadFromMemoryBuffer(), m_bInitialized, m_options, MRPT_END, MRPT_START, mrpt::system::now(), THE_CAMERA, THROW_EXCEPTION, and mrpt::obs::CObservation::timestamp.
|
inline |
Check whether the camera has been open successfully.
Definition at line 161 of file CImageGrabber_dc1394.h.
References m_bInitialized.
Referenced by mrpt::hwdrivers::CStereoGrabber_Bumblebee_libdc1394::CStereoGrabber_Bumblebee_libdc1394(), and mrpt::hwdrivers::CStereoGrabber_Bumblebee_libdc1394::getStereoObservation().
bool CImageGrabber_dc1394::setSoftwareTriggerLevel | ( | bool | level | ) |
Changes the boolean level associated to Software Trigger (ON/OFF) Can be used to control camera triggering trough software.
Definition at line 750 of file CImageGrabber_dc1394.cpp.
References m_bInitialized, MRPT_END, MRPT_START, THE_CAMERA, and THROW_EXCEPTION.
|
protected |
Set to false if we could not initialize the camera.
Definition at line 130 of file CImageGrabber_dc1394.h.
Referenced by changeCaptureOptions(), CImageGrabber_dc1394(), getObservation(), isOpen(), setSoftwareTriggerLevel(), and ~CImageGrabber_dc1394().
|
protected |
Internal use:
Definition at line 133 of file CImageGrabber_dc1394.h.
Referenced by CImageGrabber_dc1394().
|
protected |
Definition at line 134 of file CImageGrabber_dc1394.h.
Referenced by CImageGrabber_dc1394().
|
protected |
Definition at line 135 of file CImageGrabber_dc1394.h.
Referenced by CImageGrabber_dc1394().
|
protected |
Definition at line 137 of file CImageGrabber_dc1394.h.
Referenced by CImageGrabber_dc1394(), and getObservation().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020 |