Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * mirrormodel.cpp - Abstract class defining a mirror model 00004 * 00005 * Created: Wed Mar 21 16:32:32 2007 00006 * Copyright 2005-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 <models/mirror/mirrormodel.h> 00025 00026 namespace firevision { 00027 #if 0 /* just to make Emacs auto-indent happy */ 00028 } 00029 #endif 00030 00031 /** @class MirrorModel <models/mirror/mirrormodel.h> 00032 * Mirror model interface. 00033 * This interface defines the API for a mirror model. 00034 * 00035 * @fn void MirrorModel::warp2unwarp(unsigned int warp_x, unsigned int warp_y, unsigned int *unwarp_x, unsigned int *unwarp_y) 00036 * Transform warped to unwarped point. 00037 * Given a point in the warped image it returns the coordinates of 00038 * the corresponding pixel in the unwarped image 00039 * Useful for: You found the ball center in the image and want to get 00040 * the position this pixel would have in an unwarped image 00041 * @param warp_x warped x coordinate 00042 * @param warp_y warped y coordinate 00043 * @param unwarp_x contains unwarped x coordinate upon return 00044 * @param unwarp_y contains unwarped y coordinate upon return 00045 * 00046 * @fn void MirrorModel::unwarp2warp(unsigned int unwarp_x, unsigned int unwarp_y, unsigned int *warp_x, unsigned int *warp_y) 00047 * Transform unwarped to warped point. 00048 * Given a point in the unwarped image it returns the coordinates of 00049 * the corresponding pixel in the warped image 00050 * Useful for: You want to generate the unwarped image and ask the model 00051 * for every point of the unwarped image which warped pixel to copy 00052 * @param unwarp_x unwarped x coordinate 00053 * @param unwarp_y unwarped y coordinate 00054 * @param warp_x contains the warped x coordinate upon return 00055 * @param warp_y contains the warped y coordinate upon return 00056 * 00057 * @fn const char * MirrorModel::getName() 00058 * Get name of model. 00059 * @return name of model 00060 * 00061 * @fn polar_coord_t MirrorModel::getWorldPointRelative(unsigned int image_x, unsigned int image_y ) const 00062 * Get relative coordinate based on image coordinates. 00063 * @param image_x x coordinate in image in pixels 00064 * @param image_y y coordinate in image in pixels 00065 * @return polar coordinates relative to the base system in metric local system 00066 * 00067 * @fn f_point_t MirrorModel::getWorldPointGlobal(unsigned int image_x, unsigned int image_y, float pose_x, float pose_y, float pose_ori) const 00068 * Get global coordinate based on image coordinates. 00069 * @param image_x x coordinate in image in pixels 00070 * @param image_y y coordinate in image in pixels 00071 * @param pose_x robot pose global x coordinate 00072 * @param pose_y robot pose global y coordinate 00073 * @param pose_ori robot pose global orientation 00074 * @return cartesian coordinates relative to the base system in metric global system 00075 * 00076 * @fn void MirrorModel::reset() 00077 * Reset model. This will reset mirror model. 00078 * 00079 * @fn cart_coord_t MirrorModel::getCenter() const 00080 * Get the image pixel that is the center of the omni-camera. 00081 * @return pixel coordinates of mirror center in image. 00082 * 00083 * @fn void MirrorModel::setCenter(unsigned int image_x, unsigned int image_y) 00084 * Set center of omni-camera to given image pixel 00085 * @param image_x x coordinate in image in pixels 00086 * @param image_y y coordinate in image in pixels 00087 * 00088 * @fn void MirrorModel::setOrientation(float angle) 00089 * Set orientation of the omni-camera device. 00090 * @param angle angle to the forward direction. 00091 * 00092 * @fn float MirrorModel::getOrientation() const 00093 * Get orientation of the omni-camera. 00094 * @return angle to forward direction. 00095 * 00096 * @fn bool MirrorModel::isValidPoint(unsigned int image_x, unsigned int image_y ) const 00097 * Check if the given point is valid. 00098 * @param image_x x coordinate of queried pixel in image 00099 * @param image_y y coordinate of queried pixel in image 00100 * @return true, if pixel is valid, false otherwise. 00101 */ 00102 00103 /** Virtual empty destructor. */ 00104 MirrorModel::~MirrorModel() 00105 { 00106 } 00107 00108 } // end namespace firevision