Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Protected Attributes

mrpt::hwdrivers::CImageGrabber_OpenCV Class Reference


Detailed Description

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.

Note:
This class is only available when compiling MRPT with the flag "MRPT_HAS_OPENCV" defined.
Some code is based on the class CaptureCamera from the Orocos project.
See also:
mrpt::hwdrivers::CCameraSensor, CImageGrabber_dc1394
The most generic camera grabber in MRPT: mrpt::hwdrivers::CCameraSensor

Definition at line 83 of file CImageGrabber_OpenCV.h.

#include <mrpt/hwdrivers/CImageGrabber_OpenCV.h>

List of all members.

Public Member Functions

 CImageGrabber_OpenCV (int cameraIndex=-1, TCameraType cameraType=CAMERA_CV_AUTODETECT, const TCaptureCVOptions &options=TCaptureCVOptions())
 Constructor for cameras:
 CImageGrabber_OpenCV (const std::string &AVI_fileName)
 Constructor for AVI files:
virtual ~CImageGrabber_OpenCV ()
 Destructor.
bool isOpen () const
 Check whether the camera has been open successfully.
bool getObservation (mrpt::slam::CObservationImage &out_observation)
 Grab an image from the opened camera.

Protected Attributes

bool m_bInitialized
 Set to false if we could not initialize the camera.
mrpt::utils::void_ptr_noncopy m_capture
 Internal use:

Constructor & Destructor Documentation

mrpt::hwdrivers::CImageGrabber_OpenCV::CImageGrabber_OpenCV ( int  cameraIndex = -1,
TCameraType  cameraType = CAMERA_CV_AUTODETECT,
const TCaptureCVOptions options = TCaptureCVOptions() 
)

Constructor for cameras:

Parameters:
cameraIndexSet the camera index, or -1 if it does not matter and you select AUTODETECT as cameraType.
cameraTypeCan be any value of TCameraType, or CAMERA_CV_AUTODETECT if there is only one camera.
optionsCapture options, defined in mrpt::hwdrivers::TCaptureCVOptions. If not provided, all the default options will be used.
mrpt::hwdrivers::CImageGrabber_OpenCV::CImageGrabber_OpenCV ( const std::string &  AVI_fileName)

Constructor for AVI files:

virtual mrpt::hwdrivers::CImageGrabber_OpenCV::~CImageGrabber_OpenCV ( ) [virtual]

Destructor.


Member Function Documentation

bool mrpt::hwdrivers::CImageGrabber_OpenCV::getObservation ( mrpt::slam::CObservationImage out_observation)

Grab an image from the opened camera.

Parameters:
out_observationThe object to be filled with sensed data.
Returns:
false on any error, true if all go fine.
bool mrpt::hwdrivers::CImageGrabber_OpenCV::isOpen ( ) const [inline]

Check whether the camera has been open successfully.

Definition at line 115 of file CImageGrabber_OpenCV.h.


Member Data Documentation

Set to false if we could not initialize the camera.

Definition at line 88 of file CImageGrabber_OpenCV.h.

Internal use:

Definition at line 92 of file CImageGrabber_OpenCV.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011