Fawkes API  Fawkes Development Version
stereo_processor.cpp
1 
2 /***************************************************************************
3  * stereo_processor.cpp - Stereo processor interface
4  *
5  * Created: Fri May 18 16:02:08 2007
6  * Copyright 2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <fvstereo/stereo_processor.h>
25 
26 namespace firevision {
27 
28 /** @class StereoProcessor <fvstereo/stereo_processor.h>
29  * Stereo processor interface.
30  * This interface provides access to different stereo processing
31  * implementations.
32  *
33  * @author Tim Niemueller
34  *
35  * @fn virtual void StereoProcessor::get_xyz(unsigned int px, unsigned int py, float *x, float *y, float *z) = 0
36  * Get coordinates for pixel in camera coordinate system.
37  * This retrieves coordinates in the coordinate system of the stereo camera.
38  * Retrieving new positions may fail if no valid disparity information could
39  * be calculated for the given point. This is indicated with the return value.
40  * @param px x position of pixel in image
41  * @param py y position of pixel in image
42  * @param x upon successful return contains the x coordinate of the point in the camera coordinate sytem
43  * @param y upon successful return contains the y coordinate of the point in the camera coordinate sytem
44  * @param z upon successful return contains the z coordinate of the point in the camera coordinate sytem
45  * @return true, if valid information could be retrieved and was written to (x,y,z), false otherwise
46  *
47  * @fn virtual void StereoProcessor::get_world_xyz(unsigned int px, unsigned int py, float *x, float *y, float *z) = 0
48  * Get coordinates for pixel in robot coordinate system.
49  * This retrieves coordinates in the coordinate system of the robot holding
50  * the stereo camera. The robot coordinate system is a right-handed cardanic
51  * coordinate system with the X axis pointing forward, the Y axis pointing
52  * right and the Z axis pointing downwards.
53  * Retrieving new positions may fail if no valid disparity information could
54  * be calculated for the given point. This is indicated with the return value.
55  * @param px x position of pixel in image
56  * @param py y position of pixel in image
57  * @param x upon successful return contains the x coordinate of the point in the robot coordinate sytem
58  * @param y upon successful return contains the y coordinate of the point in the robot coordinate sytem
59  * @param z upon successful return contains the z coordinate of the point in the robot coordinate sytem
60  * @return true, if valid information could be retrieved and was written to (x,y,z), false otherwise
61  *
62  * @fn virtual void StereoProcessor::preprocess_stereo() = 0
63  * Do any pre-processing needed.
64  * Do all the preprocessing needed to calculate the disparity or the YUV images.
65  * This has been split out to be able to do only one thing.
66  *
67  * @fn virtual void StereoProcessor::calculate_disparity(ROI *roi = 0) = 0
68  * Caculate disparity images.
69  * Depending on the data the specific stereo processor needs the disparity image
70  * is calculated.
71  * If a region of interest (ROI) is supplied then only this region is processed.
72  * @param roi region of interest to process
73  *
74  * @fn virtual void StereoProcessor::calculate_yuv(bool both = false) = 0
75  * Caculate yuv images.
76  * This will calculate YUV images of the cameras. By default only the reference
77  * image is converted to YUV, as this is sufficient in most cases. If you need both
78  * images specify so as argument. A call to this method is valid only after calling
79  * calculate_disparity() as this may rely on data produced there.
80  * @param both if true, both YUV images are calculated for the left and right camera,
81  * if false only the YUV image of the reference camera is calculated (dependant on
82  * camera)
83  *
84  * @fn virtual unsigned char * StereoProcessor::disparity_buffer() = 0
85  * Get the disparity image buffer.
86  * This returns a buffer containing the disparity image. The buffer is not copied
87  * so do not change anything in the buffer or subsequent calls to get_xyz() and
88  * get_world_xyz() will return invalid results.
89  * @return disparity buffer
90  *
91  * @fn virtual size_t StereoProcessor::disparity_buffer_size() const = 0
92  * Get disparity buffer size.
93  * @return size in bytes of the disparity image buffer
94  *
95  * @fn virtual unsigned char * StereoProcessor::yuv_buffer_right() = 0
96  * Get YUV-formatted buffer of reference camera.
97  * This will return the YUV buffer of the reference image. This is only available
98  * after calling calculate_yuv().
99  * @return YUV buffer of the reference image
100  *
101  * @fn virtual unsigned char * StereoProcessor::yuv_buffer_left() = 0
102  * Get YUV-formatted buffer of left camera.
103  * This will return the YUV buffer of the auxiliary image. This is only available
104  * after calling calculate_yuv().
105  * @return YUV buffer of the auxiliary image
106  *
107  */
108 
109 /** Virtual empty destructor. */
111 {
112 }
113 
114 } // end namespace firevision
virtual ~StereoProcessor()
Virtual empty destructor.