MRPT
2.0.1
|
A class for grabing images from a "OpenCV"-compatible camera, or from an AVI video file.
See the constructor for the options when opening the camera.
Unless input from AVI files is required, it is recommended to use the more generic class mrpt::hwdrivers::CCameraSensor.
Definition at line 65 of file CImageGrabber_OpenCV.h.
#include <mrpt/hwdrivers/CImageGrabber_OpenCV.h>
Classes | |
struct | Impl |
Public Member Functions | |
CImageGrabber_OpenCV (int cameraIndex=-1, TCameraType cameraType=CAMERA_CV_AUTODETECT, const TCaptureCVOptions &options=TCaptureCVOptions()) | |
Constructor for cameras: More... | |
CImageGrabber_OpenCV (const std::string &AVI_fileName) | |
Constructor for AVI files: More... | |
virtual | ~CImageGrabber_OpenCV () |
Destructor. More... | |
bool | isOpen () const |
Check whether the camera has been open successfully. More... | |
bool | getObservation (mrpt::obs::CObservationImage &out_observation) |
Grab an image from the opened camera. More... | |
Protected Attributes | |
bool | m_bInitialized |
Set to false if we could not initialize the camera. More... | |
mrpt::pimpl< Impl > | m_capture |
CImageGrabber_OpenCV::CImageGrabber_OpenCV | ( | int | cameraIndex = -1 , |
TCameraType | cameraType = CAMERA_CV_AUTODETECT , |
||
const TCaptureCVOptions & | options = TCaptureCVOptions() |
||
) |
Constructor for cameras:
cameraIndex | Set the camera index, or -1 if it does not matter and you select AUTODETECT as cameraType. |
cameraType | Can be any value of TCameraType, or CAMERA_CV_AUTODETECT if there is only one camera. |
options | Capture options, defined in mrpt::hwdrivers::TCaptureCVOptions. If not provided, all the default options will be used. |
Definition at line 35 of file CImageGrabber_OpenCV.cpp.
References mrpt::hwdrivers::CAMERA_CV_AUTODETECT, mrpt::hwdrivers::CAMERA_CV_DC1394, mrpt::hwdrivers::CAMERA_CV_DSHOW, mrpt::hwdrivers::CAMERA_CV_MIL, mrpt::hwdrivers::CAMERA_CV_VFL, mrpt::hwdrivers::CAMERA_CV_VFW, mrpt::format(), mrpt::hwdrivers::TCaptureCVOptions::frame_height, mrpt::hwdrivers::TCaptureCVOptions::frame_width, mrpt::hwdrivers::TCaptureCVOptions::gain, mrpt::hwdrivers::TCaptureCVOptions::ieee1394_fps, mrpt::hwdrivers::TCaptureCVOptions::ieee1394_grayscale, m_bInitialized, m_capture, MRPT_END, MRPT_START, THROW_EXCEPTION, and THROW_EXCEPTION_FMT.
CImageGrabber_OpenCV::CImageGrabber_OpenCV | ( | const std::string & | AVI_fileName | ) |
Constructor for AVI files:
Definition at line 171 of file CImageGrabber_OpenCV.cpp.
References m_bInitialized, m_capture, MRPT_END, MRPT_START, and THROW_EXCEPTION.
|
virtual |
Destructor.
Definition at line 197 of file CImageGrabber_OpenCV.cpp.
References m_bInitialized, and m_capture.
bool CImageGrabber_OpenCV::getObservation | ( | mrpt::obs::CObservationImage & | out_observation | ) |
Grab an image from the opened camera.
out_observation | The object to be filled with sensed data. |
Definition at line 210 of file CImageGrabber_OpenCV.cpp.
References mrpt::obs::CObservationImage::image, m_bInitialized, m_capture, MRPT_END, MRPT_START, mrpt::system::now(), mrpt::img::SHALLOW_COPY, THROW_EXCEPTION, and mrpt::obs::CObservation::timestamp.
|
inline |
Check whether the camera has been open successfully.
Definition at line 98 of file CImageGrabber_OpenCV.h.
References m_bInitialized.
|
protected |
Set to false if we could not initialize the camera.
Definition at line 70 of file CImageGrabber_OpenCV.h.
Referenced by CImageGrabber_OpenCV(), getObservation(), isOpen(), and ~CImageGrabber_OpenCV().
|
protected |
Definition at line 72 of file CImageGrabber_OpenCV.h.
Referenced by CImageGrabber_OpenCV(), getObservation(), and ~CImageGrabber_OpenCV().
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |