RobWorkProject  20.10.1-
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVCamera Class Reference

This class implements the Camera interface using the CMU 1394 windows drivers. Check out http://www.cs.cmu.edu/~iwan/1394/. More...

#include <OpenCVCamera.hpp>

Inherits Camera.

Public Member Functions

virtual ~OpenCVCamera ()
 destructor
 
bool initialize ()
 initializes the camera to the current settings (CaptureMode,ColorMode,etc.) More...
 
void stop ()
 stops this camera. When the camera is stopped it can be reinitialized using initialize() More...
 
bool start ()
 starts this camera, if the camera has not been initialized the initialize function will be called. More...
 
void acquire ()
 aquires an image from the camera. This method is not blocking. Use isImageReady to poll for completion of acquire. More...
 
bool isImageReady ()
 tests whether a image has been acquired More...
 
const rw::sensor::ImagegetImage ()
 returns the last image acquired from the camera. This method is not blocking, if no image has been acquired yet an empty image is returned. The image returned can for some specific drivers be read only. More...
 
double getFrameRate ()
 returns the framerate that this camera is setup with More...
 
void setFrameRate (double framerate)
 sets the framerate of this camera. If the framerate is not supported the closest supported framerate is choosen. More...
 
unsigned int getWidth ()
 get width of the captured images More...
 
unsigned int getHeight ()
 get width of the captured images More...
 
- Public Member Functions inherited from Camera
virtual ~Camera ()
 destructor
 
virtual std::string getModelInfo () const
 returns the camera model information (version, type, size, etc.) More...
 
bool isInitialized () const
 returns whether this camera is initialized or not. More...
 
bool isStarted () const
 returns whether this camera is started or not. More...
 
virtual bool addListener (CameraListener &listener)
 adds a CameraListener to this camera More...
 
virtual bool removeListener (CameraListener &listener)
 removes a CameraListener from this cameras listener list. More...
 
virtual bool isShutterAvailable () const
 
virtual double getShutter () const
 
virtual void setShutter (double Value)
 
virtual std::pair< double, double > getShutterBounds () const
 
virtual bool isGainAvailable () const
 
virtual double getGain () const
 
virtual double setGain (double Value)
 
- Public Member Functions inherited from Sensor
virtual ~Sensor ()
 destructor
 
const std::string & getName () const
 returns the name of this sensor More...
 
const std::string & getDescription () const
 returns a description of this sensor More...
 
SensorModel::Ptr getSensorModel () const
 The frame to which the sensor is attached. More...
 
virtual void setSensorModel (SensorModel::Ptr smodel)
 Sets the frame to which the sensor should be attached. More...
 
rw::core::PropertyMapgetPropertyMap ()
 gets the propertymap of this sensor
 
const rw::core::PropertyMapgetPropertyMap () const
 gets the propertymap of this sensor
 

Static Public Member Functions

static const std::vector< OpenCVCamera * > getCameraHandles ()
 return handles (Camera objects) to all connected firewire cameras. More...
 

Protected Member Functions

 OpenCVCamera (CvCapture *cam)
 constructor More...
 
CvCapture * getCamera ()
 returns the C1394Camera object that is bound to this WinCamera More...
 
bool isConnected ()
 if a C1394Camera class is connected to this Camera class then true is returned, false otherwise
 
void setConnected (bool connected)
 sets the connected state of this WinCamera More...
 
- Protected Member Functions inherited from Camera
 Camera (const std::string &name, const std::string &modelInfo)
 constructor More...
 
void setModelInfo (const std::string info)
 sets the camera model information More...
 
- Protected Member Functions inherited from Sensor
 Sensor (const std::string &name)
 constructor More...
 
 Sensor (const std::string &name, const std::string &description)
 constructor More...
 
void setName (const std::string &name)
 sets the name of this sensor More...
 
void setDescription (const std::string &description)
 sets the description of this sensor More...
 

Additional Inherited Members

- Public Types inherited from Camera
typedef rw::core::Ptr< CameraPtr
 smart pointer type to this class
 
- Public Types inherited from Sensor
typedef rw::core::Ptr< SensorPtr
 smart pointer type
 
- Protected Attributes inherited from Camera
std::vector< CameraListener * > _listeners
 the list of CameraListeners
 
std::string _modelInfo
 name of camera model information
 
bool _initialized
 state variable - true if camera is initialized
 
bool _started
 state variable - true if camera is started
 

Detailed Description

This class implements the Camera interface using the CMU 1394 windows drivers. Check out http://www.cs.cmu.edu/~iwan/1394/.

Constructor & Destructor Documentation

◆ OpenCVCamera()

OpenCVCamera ( CvCapture *  cam)
protected

constructor

Parameters
cam[in] handle to camera

Member Function Documentation

◆ acquire()

void acquire ( )
virtual

aquires an image from the camera. This method is not blocking. Use isImageReady to poll for completion of acquire.

Implements Camera.

◆ getCamera()

CvCapture* getCamera ( )
protected

returns the C1394Camera object that is bound to this WinCamera

Returns
C1394Camera object that is bound to this WinCamera

◆ getCameraHandles()

static const std::vector< OpenCVCamera* > getCameraHandles ( )
static

return handles (Camera objects) to all connected firewire cameras.

Returns
a list of available cameras

◆ getFrameRate()

double getFrameRate ( )
virtual

returns the framerate that this camera is setup with

Returns
the framerate in frames per second

Implements Camera.

◆ getHeight()

unsigned int getHeight ( )
inlinevirtual

get width of the captured images

Returns
width

Implements Camera.

◆ getImage()

const rw::sensor::Image* getImage ( )
virtual

returns the last image acquired from the camera. This method is not blocking, if no image has been acquired yet an empty image is returned. The image returned can for some specific drivers be read only.

Returns
last image captured from camera.

Implements Camera.

◆ getWidth()

unsigned int getWidth ( )
inlinevirtual

get width of the captured images

Returns
width

Implements Camera.

◆ initialize()

bool initialize ( )
virtual

initializes the camera to the current settings (CaptureMode,ColorMode,etc.)

Returns
true if initialization is succesfully, false otherwise.

Implements Camera.

◆ isImageReady()

bool isImageReady ( )
virtual

tests whether a image has been acquired

Returns
true if an image has been acquired, false otherwise.

Implements Camera.

◆ setConnected()

void setConnected ( bool  connected)
inlineprotected

sets the connected state of this WinCamera

Parameters
connected[in] true to set the state of WinCamera to connected, false otherwise

◆ setFrameRate()

void setFrameRate ( double  framerate)
virtual

sets the framerate of this camera. If the framerate is not supported the closest supported framerate is choosen.

Parameters
framerate[in] the framerate

Implements Camera.

◆ start()

bool start ( )
virtual

starts this camera, if the camera has not been initialized the initialize function will be called.

Returns
true if camera was successfully started, false otherwise

Implements Camera.

◆ stop()

void stop ( )
virtual

stops this camera. When the camera is stopped it can be reinitialized using initialize()

Implements Camera.


The documentation for this class was generated from the following file: