/* * 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 EYECALIB_H #define EYECALIB_H #include #include #include #include #include #include "ConfigOptions.h" using namespace std; using namespace cv; #define POS_HISTORY_SIZE 60*5 #define EYE_POSITION_HISTORY_SIZE 5 enum CALIB_POS_ENUM { CALIB_POS_STRAIGHT=0, CALIB_POS_UPPER_LEFT, CALIB_POS_UPPER_RIGHT, CALIB_POS_LOWER_RIGHT, CALIB_POS_LOWER_LEFT, CALIB_POS_CAM }; class EyeCalib{ public: EyeCalib(ConfigOptions *c, int id); void set_name(string n); // void toggle_calibmode(); // void set_eyeposition(Point2d eyepos, imu_data_t euler); // void store_calib_point(); void init_calib(); Point2d calc_angle(Point2d input); void overlay_blobs(Mat *image); private: // double resolve_radius(int index_r, int index_l, double calib_full_angle, int xory); // void estimate_eye_radii(); int eye_id; ConfigOptions *cfg; int calibration_index; void clear_history(); bool calib_running; void update_smoothed_eyeposition(Point2d p); string eye_name; // Point2d calib_positions_unsorted[6]; // bool pos_calibrated[6]; int calib_index; Point2d calib_factor; Point2d calib_positions[POS_HISTORY_SIZE]; Point2d eye_position_straight; bool eye_position_history_filled; int eye_position_history_ptr; Point2d eye_position_history[EYE_POSITION_HISTORY_SIZE]; Point2d eye_position_history_average; Point2d eye_position_history_average_sum; int pos_history_ptr; int pos_history_ptr_max; Point2d pos_history[POS_HISTORY_SIZE]; Point2d pos_history_avg; }; #endif