Fawkes API  Fawkes Development Version
firevision::Camera Class Referenceabstract

#include <>>

Inheritance diagram for firevision::Camera:

Public Member Functions

virtual ~Camera ()
 Virtual empty destructor. More...
 
virtual void open ()=0
 
virtual void start ()=0
 
virtual void stop ()=0
 
virtual void close ()=0
 
virtual void capture ()=0
 
virtual void flush ()=0
 
virtual bool ready ()=0
 
virtual void print_info ()=0
 
virtual unsigned char * buffer ()=0
 
virtual unsigned int buffer_size ()=0
 
virtual void dispose_buffer ()=0
 
virtual unsigned int pixel_width ()=0
 
virtual unsigned int pixel_height ()=0
 
virtual colorspace_t colorspace ()=0
 
virtual fawkes::Timecapture_time ()
 Get the Time of the last successfully captured image. More...
 
virtual void set_image_number (unsigned int n)=0
 

Detailed Description

Camera interface for image aquiring devices in FireVision.

In general cameras shall initiate a continuous flow of images and shall be optimized for real-time image processing (25 Hz).

Definition at line 36 of file camera.h.

Constructor & Destructor Documentation

◆ ~Camera()

firevision::Camera::~Camera ( )
virtual

Virtual empty destructor.

Definition at line 127 of file camera.cpp.

Member Function Documentation

◆ buffer()

unsigned char * firevision::Camera::buffer ( )
pure virtual

◆ buffer_size()

unsigned int firevision::Camera::buffer_size ( )
pure virtual

◆ capture()

void firevision::Camera::capture ( )
pure virtual

Capture an image. Although cameras shall operate with a continuous image flow where possible sometimes capturing an image means copying a buffer or advancing a buffer list pointer. This shall be done in this method. For a camera-using application it is mandatory to call capture() just before accessing the image buffer.

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::Bumblebee2Camera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

Referenced by SkelGuiImageDrawer::fill_texture(), SkelGuiDepthDrawer::fill_texture(), FvRetrieverThread::loop(), and FvAcquisitionThread::loop().

◆ capture_time()

fawkes::Time * firevision::Camera::capture_time ( )
virtual

Get the Time of the last successfully captured image.

Returns a Time representing the time when the last image was captured successfully. Note that calling this function is only valid after capture() and before dispose_buffer() has been called – it is only valid when an image is currently available.

Returns
Time of the currently processed image. The pointer shall be valid at least until the next call to dispose_buffer().
Exceptions
NotImplementedExceptionthrown if Camera does not support time stamping

Reimplemented in firevision::NetworkCamera, firevision::V4L2Camera, and firevision::SharedMemoryCamera.

Definition at line 141 of file camera.cpp.

Referenced by FvRetrieverThread::init(), FvRetrieverThread::loop(), FvAcquisitionThread::loop(), and firevision::ImageWidget::set_camera().

◆ close()

◆ colorspace()

◆ dispose_buffer()

void firevision::Camera::dispose_buffer ( )
pure virtual

Dispose current buffer. Some cameras need disposal of the current buffer (for example to free space in a queue to retrieve the next image). This is done with this method. It has to be called after all work has been done on the image as desired. After dispose_buffer() has been called no further access may happen to the image buffer or undesired behavior may happen.

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

Referenced by firevision::V4LCamera::buffer_size(), SkelGuiImageDrawer::fill_texture(), SkelGuiDepthDrawer::fill_texture(), FvRetrieverThread::loop(), and FvAcquisitionThread::loop().

◆ flush()

void firevision::Camera::flush ( )
pure virtual

Flush image queue. Some cameras may have an image buffer queue. With this it can happen that if the processing of an image took longer than desired it is needed to flush this buffer queue.

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

◆ open()

void firevision::Camera::open ( )
pure virtual

Open the camera. The camera is opened, but image transfer not yet started. This can be used to detect general problems with the camera while delaying the real transfer startup until it is needed.

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::Bumblebee2Camera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::PikeCamera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

Referenced by FvBaseThread::register_for_camera().

◆ pixel_height()

◆ pixel_width()

◆ print_info()

void firevision::Camera::print_info ( )
pure virtual

◆ ready()

bool firevision::Camera::ready ( )
pure virtual

Camera is ready for taking pictures. The camera has been opened and started correctly and may now provide images.

Returns
true, if the camera is ready, false otherwise

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

◆ set_image_number()

void firevision::Camera::set_image_number ( unsigned int  n)
pure virtual

Set image number to retrieve. If a camera is able to retrieve several images this method can be used to select the image to be retrieved with the next call to capture().

Parameters
nimage number to set

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::SharedMemoryCamera, firevision::V4L1Camera, firevision::V4LCamera, firevision::BufferCamera, firevision::LeutronCamera, and firevision::Bumblebee2Camera.

Referenced by firevision::V4LCamera::colorspace().

◆ start()

void firevision::Camera::start ( )
pure virtual

Start image transfer from the camera. For many cameras opening the camera and starting transmission of images are two tasks. This method will simply initiate the transfer after the camera as been opened. And exception shall be thrown if the camera has not been opened.

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

Referenced by FvAcquisitionThread::set_enabled().

◆ stop()

void firevision::Camera::stop ( )
pure virtual

Stop image transfer from the camera. This will stop the image transfer initiated with start(). This can be used to start and stop the image transfer at will without opening and closing operations inbetween.

Implemented in firevision::KinectCamera, firevision::FileLoader, firevision::NetworkCamera, firevision::FirewireCamera, firevision::V4L2Camera, firevision::V4L1Camera, firevision::SharedMemoryCamera, firevision::V4LCamera, firevision::BufferCamera, and firevision::LeutronCamera.

Referenced by FvAcquisitionThread::set_enabled().


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