/* * This file is part of robotreality * * Copyright(c) sschulz techfak.uni-bielefeld.de * http://opensource.cit-ec.de/projects/robotreality * * This file may be licensed under the terms of the * GNU General Public License Version 3 (the ``GPL''), * or (at your option) any later version. * * Software distributed under the License is distributed * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either * express or implied. See the GPL for the specific language * governing rights and limitations. * * You should have received a copy of the GPL along with this * program. If not, go to http://www.gnu.org/licenses/gpl.html * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The development of this software was supported by the * Excellence Cluster EXC 277 Cognitive Interaction Technology. * The Excellence Cluster EXC 277 is a grant of the Deutsche * Forschungsgemeinschaft (DFG) in the context of the German * Excellence Initiative. * */ #ifndef UnitConverter_H #define UnitConverter_H #include #include #include "MarkerModel.h" #include "EyeFinder.h" class UnitConverter{ public: UnitConverter(); ~UnitConverter(); void process_data(MarkerModel *m, EyeFinder *e, int f); void set_eye_zero(Point2d left, Point2d right); private: void convert_eye_angles(Point2d left, Point2d right); double convert_px_to_cm_x(double pixel); double convert_px_to_cm_y(double pixel); double calc_deg_from_cm(double radius, double cm); double calc_eye_deg_from_px_x(double pixel); double calc_eye_deg_from_px_y(double pixel); double conversion_factor_pxx2cm; //pixel -> cm (x) double conversion_factor_pxy2cm; //pixel -> cm (Y) double const_eyeball_radius; Point2d eye_zero_position[2]; bool zero_uninitialized; //processed data: Point2d translated_angle_eye[2]; }; #endif