/* * 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 EYEFINDER_H #define EYEFINDER_H #include "BlobFinder.h" #include "MarkerModel.h" #include "EyeCalib.h" #include "ConfigOptions.h" using namespace cv; using namespace std; class EyeFinder{ public: EyeFinder(ConfigOptions *c); void find_iris(Mat *image, int); void process_image(Mat *image, MarkerModel m); void overlay_blobs_on_image(Mat *image); void process_image_eyelids(MarkerModel m); Point2d calc_eyelid_angle(int e, Point2d marker); void remove_translation_and_rotation(Mat rt, imu_data_t head_euler); // void set_lookuptable(int *table); void show_debug_image(); //void start_calibration(); void set_eye_straight_position(Point2d nose_marker_lower); Point2d get_eye_pos_unfixated(int i){ return eye_pos[i]; } Point2d get_eye_pos_fixated(int i){ return eye_pos_fixated[i]; } Point2d get_eye_pos_straight_fixated(int i){ return eye_pos_straight_fixated[i]; } double get_eyelid_angle_lower(int i); double get_eyelid_angle_upper(int i); Point2d get_eye_angle(int i); void overlay_text_on_image(Mat *image); void build_lookuptable(int brightness, int brightness2); void process_image_eye(int i, Mat *image, Marker upper, Marker lower); // void store_calib_point(); // void start_calib(); private: ConfigOptions *cfg; void overlay_blobs(Mat *image); void init_kalman(int i, double x, double y); void store_eye_position(int i,double x, double y); Point2d last_detected_iris_pos[2]; // Mat *current_image; Mat eye_roi[2]; Mat eye_roi_hough[2]; // Mat eye_roi_value[2]; BlobFinder blobfinder[2]; int threshold_value; Point2d eyelid_upper[2]; Point2d eyelid_lower[2]; KalmanFilter *kalman_filter[2]; bool uninitialised[2]; Point2d eye_pos[2]; Point2d eye_pos_raw[2]; Point2d eye_pos_straight[2]; Point2d eye_pos_straight_fixated[2]; Point2d eye_pos_fixated[2]; EyeCalib *eye_calib[2]; int *color_lookup; double eyelid_offset; int hi, lo, hmin,hmax; }; #endif