Fawkes API  Fawkes Development Version
stereo_processor.cpp
00001 
00002 /***************************************************************************
00003  *  stereo_processor.cpp - Stereo processor interface
00004  *
00005  *  Created: Fri May 18 16:02:08 2007
00006  *  Copyright  2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <fvstereo/stereo_processor.h>
00025 
00026 namespace firevision {
00027 #if 0 /* just to make Emacs auto-indent happy */
00028 }
00029 #endif
00030 
00031 /** @class StereoProcessor <fvstereo/stereo_processor.h>
00032  * Stereo processor interface.
00033  * This interface provides access to different stereo processing
00034  * implementations.
00035  *
00036  * @author Tim Niemueller
00037  *
00038  * @fn virtual void StereoProcessor::get_xyz(unsigned int px, unsigned int py, float *x, float *y, float *z) = 0
00039  * Get coordinates for pixel in camera coordinate system.
00040  * This retrieves coordinates in the coordinate system of the stereo camera.
00041  * Retrieving new positions may fail if no valid disparity information could
00042  * be calculated for the given point. This is indicated with the return value.
00043  * @param px x position of pixel in image
00044  * @param py y position of pixel in image
00045  * @param x upon successful return contains the x coordinate of the point in the camera coordinate sytem
00046  * @param y upon successful return contains the y coordinate of the point in the camera coordinate sytem
00047  * @param z upon successful return contains the z coordinate of the point in the camera coordinate sytem
00048  * @return true, if valid information could be retrieved and was written to (x,y,z), false otherwise
00049  *
00050  * @fn virtual void StereoProcessor::get_world_xyz(unsigned int px, unsigned int py, float *x, float *y, float *z) = 0
00051  * Get coordinates for pixel in robot coordinate system.
00052  * This retrieves coordinates in the coordinate system of the robot holding
00053  * the stereo camera. The robot coordinate system is a right-handed cardanic
00054  * coordinate system with the X axis pointing forward, the Y axis pointing
00055  * right and the Z axis pointing downwards.
00056  * Retrieving new positions may fail if no valid disparity information could
00057  * be calculated for the given point. This is indicated with the return value.
00058  * @param px x position of pixel in image
00059  * @param py y position of pixel in image
00060  * @param x upon successful return contains the x coordinate of the point in the robot coordinate sytem
00061  * @param y upon successful return contains the y coordinate of the point in the robot coordinate sytem
00062  * @param z upon successful return contains the z coordinate of the point in the robot coordinate sytem
00063  * @return true, if valid information could be retrieved and was written to (x,y,z), false otherwise
00064  *
00065  * @fn virtual void StereoProcessor::preprocess_stereo() = 0
00066  * Do any pre-processing needed.
00067  * Do all the preprocessing needed to calculate the disparity or the YUV images.
00068  * This has been split out to be able to do only one thing.
00069  *
00070  * @fn virtual void StereoProcessor::calculate_disparity(ROI *roi = 0) = 0
00071  * Caculate disparity images.
00072  * Depending on the data the specific stereo processor needs the disparity image
00073  * is calculated.
00074  * If a region of interest (ROI) is supplied then only this region is processed.
00075  * @param roi region of interest to process
00076  *
00077  * @fn virtual void StereoProcessor::calculate_yuv(bool both = false) = 0
00078  * Caculate yuv images.
00079  * This will calculate YUV images of the cameras. By default only the reference
00080  * image is converted to YUV, as this is sufficient in most cases. If you need both
00081  * images specify so as argument. A call to this method is valid only after calling
00082  * calculate_disparity() as this may rely on data produced there.
00083  * @param both if true, both YUV images are calculated for the left and right camera,
00084  * if false only the YUV image of the reference camera is calculated (dependant on
00085  * camera)
00086  *
00087  * @fn virtual unsigned char *  StereoProcessor::disparity_buffer() = 0
00088  * Get the disparity image buffer.
00089  * This returns a buffer containing the disparity image. The buffer is not copied
00090  * so do not change anything in the buffer or subsequent calls to get_xyz() and
00091  * get_world_xyz() will return invalid results.
00092  * @return disparity buffer
00093  *
00094  * @fn virtual size_t           StereoProcessor::disparity_buffer_size() const = 0
00095  * Get disparity buffer size.
00096  * @return size in bytes of the disparity image buffer
00097  *
00098  * @fn virtual unsigned char *  StereoProcessor::yuv_buffer() = 0
00099  * Get YUV-formatted buffer of reference camera.
00100  * This will return the YUV buffer of the reference image. This is only available
00101  * after calling calculate_yuv().
00102  * @return YUV buffer of the reference image
00103  * 
00104  * @fn virtual unsigned char *  StereoProcessor::auxiliary_yuv_buffer() = 0
00105  * Get YUV-formatted buffer of auxiliary camera.
00106  * This will return the YUV buffer of the auxiliary image. This is only available
00107  * after calling calculate_yuv().
00108  * @return YUV buffer of the auxiliary image
00109  *
00110  */
00111 
00112 /** Virtual empty destructor. */
00113 StereoProcessor::~StereoProcessor()
00114 {
00115 }
00116 
00117 } // end namespace firevision