Fawkes API  Fawkes Development Version
firevision::StereoProcessor Class Referenceabstract

Stereo processor interface. More...

#include <>>

Inheritance diagram for firevision::StereoProcessor:

Public Member Functions

virtual ~StereoProcessor ()
 Virtual empty destructor. More...
 
virtual bool get_xyz (unsigned int px, unsigned int py, float *x, float *y, float *z)=0
 Get coordinates for pixel in camera coordinate system. More...
 
virtual bool get_world_xyz (unsigned int px, unsigned int py, float *x, float *y, float *z)=0
 Get coordinates for pixel in robot coordinate system. More...
 
virtual void preprocess_stereo ()=0
 Do any pre-processing needed. More...
 
virtual void calculate_disparity (ROI *roi=0)=0
 Caculate disparity images. More...
 
virtual void calculate_yuv (bool both=false)=0
 Caculate yuv images. More...
 
virtual unsigned char * disparity_buffer ()=0
 Get the disparity image buffer. More...
 
virtual size_t disparity_buffer_size () const =0
 Get disparity buffer size. More...
 
virtual unsigned char * yuv_buffer_right ()=0
 Get YUV-formatted buffer of reference camera. More...
 
virtual unsigned char * yuv_buffer_left ()=0
 Get YUV-formatted buffer of left camera. More...
 

Detailed Description

Stereo processor interface.

This interface provides access to different stereo processing implementations.

Author
Tim Niemueller

Definition at line 36 of file stereo_processor.h.

Constructor & Destructor Documentation

◆ ~StereoProcessor()

firevision::StereoProcessor::~StereoProcessor ( )
virtual

Virtual empty destructor.

Definition at line 113 of file stereo_processor.cpp.

Member Function Documentation

◆ calculate_disparity()

void firevision::StereoProcessor::calculate_disparity ( ROI roi = 0)
pure virtual

Caculate disparity images.

Depending on the data the specific stereo processor needs the disparity image is calculated. If a region of interest (ROI) is supplied then only this region is processed.

Parameters
roiregion of interest to process

Implemented in firevision::TriclopsStereoProcessor.

◆ calculate_yuv()

void firevision::StereoProcessor::calculate_yuv ( bool  both = false)
pure virtual

Caculate yuv images.

This will calculate YUV images of the cameras. By default only the reference image is converted to YUV, as this is sufficient in most cases. If you need both images specify so as argument. A call to this method is valid only after calling calculate_disparity() as this may rely on data produced there.

Parameters
bothif true, both YUV images are calculated for the left and right camera, if false only the YUV image of the reference camera is calculated (dependant on camera)

Implemented in firevision::TriclopsStereoProcessor.

◆ disparity_buffer()

unsigned char * firevision::StereoProcessor::disparity_buffer ( )
pure virtual

Get the disparity image buffer.

This returns a buffer containing the disparity image. The buffer is not copied so do not change anything in the buffer or subsequent calls to get_xyz() and get_world_xyz() will return invalid results.

Returns
disparity buffer

Implemented in firevision::TriclopsStereoProcessor.

◆ disparity_buffer_size()

size_t firevision::StereoProcessor::disparity_buffer_size ( ) const
pure virtual

Get disparity buffer size.

Returns
size in bytes of the disparity image buffer

Implemented in firevision::TriclopsStereoProcessor.

◆ get_world_xyz()

void firevision::StereoProcessor::get_world_xyz ( unsigned int  px,
unsigned int  py,
float *  x,
float *  y,
float *  z 
)
pure virtual

Get coordinates for pixel in robot coordinate system.

This retrieves coordinates in the coordinate system of the robot holding the stereo camera. The robot coordinate system is a right-handed cardanic coordinate system with the X axis pointing forward, the Y axis pointing right and the Z axis pointing downwards. Retrieving new positions may fail if no valid disparity information could be calculated for the given point. This is indicated with the return value.

Parameters
pxx position of pixel in image
pyy position of pixel in image
xupon successful return contains the x coordinate of the point in the robot coordinate sytem
yupon successful return contains the y coordinate of the point in the robot coordinate sytem
zupon successful return contains the z coordinate of the point in the robot coordinate sytem
Returns
true, if valid information could be retrieved and was written to (x,y,z), false otherwise

Implemented in firevision::TriclopsStereoProcessor.

◆ get_xyz()

void firevision::StereoProcessor::get_xyz ( unsigned int  px,
unsigned int  py,
float *  x,
float *  y,
float *  z 
)
pure virtual

Get coordinates for pixel in camera coordinate system.

This retrieves coordinates in the coordinate system of the stereo camera. Retrieving new positions may fail if no valid disparity information could be calculated for the given point. This is indicated with the return value.

Parameters
pxx position of pixel in image
pyy position of pixel in image
xupon successful return contains the x coordinate of the point in the camera coordinate sytem
yupon successful return contains the y coordinate of the point in the camera coordinate sytem
zupon successful return contains the z coordinate of the point in the camera coordinate sytem
Returns
true, if valid information could be retrieved and was written to (x,y,z), false otherwise

Implemented in firevision::TriclopsStereoProcessor.

◆ preprocess_stereo()

void firevision::StereoProcessor::preprocess_stereo ( )
pure virtual

Do any pre-processing needed.

Do all the preprocessing needed to calculate the disparity or the YUV images. This has been split out to be able to do only one thing.

Implemented in firevision::TriclopsStereoProcessor.

◆ yuv_buffer_left()

unsigned char * firevision::StereoProcessor::yuv_buffer_left ( )
pure virtual

Get YUV-formatted buffer of left camera.

This will return the YUV buffer of the auxiliary image. This is only available after calling calculate_yuv().

Returns
YUV buffer of the auxiliary image

Implemented in firevision::TriclopsStereoProcessor.

◆ yuv_buffer_right()

unsigned char * firevision::StereoProcessor::yuv_buffer_right ( )
pure virtual

Get YUV-formatted buffer of reference camera.

This will return the YUV buffer of the reference image. This is only available after calling calculate_yuv().

Returns
YUV buffer of the reference image

Implemented in firevision::TriclopsStereoProcessor.


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