private void Test_Calc_Click(object sender, EventArgs e) { write_to_msg_box("TESTING CALCULATIONS!"); Gaze_Comp G = new Gaze_Comp(); Point_Obj P = G.get_gaze_pt(new Point_Obj(379, 165), new Point_Obj(439, 171), 45, 30, 60); P.set_coord(10, 10, 10); plot_gaze_point(P); }
private Point_Obj process_float_data(float[] input_array) { float frame_num = input_array[0]; float success_flag = input_array[1]; Point_Obj left_eye = new Point_Obj(input_array[2], input_array[3], input_array[4]); Point_Obj right_eye = new Point_Obj(input_array[5], input_array[6], input_array[7]); float alpha = input_array[8]*180; float beta = input_array[9]*180; float gamma = input_array[10]*180; if (success_flag == 0.0) { Console.WriteLine("{0}: Tracking Failure", Convert.ToInt32(frame_num)); //Point_Obj Gaze_Pt = new Point_Obj(Single.PositiveInfinity, Single.PositiveInfinity); Point_Obj disp_pt_f = new Point_Obj(-1000, -1000); plot_gaze_point(disp_pt_f); disp_pt_f.set_coord(Single.PositiveInfinity, Single.PositiveInfinity, 0); return disp_pt_f; } Gaze_Comp G = new Gaze_Comp(); Point_Obj p = G.get_gaze_pt(right_eye, left_eye, alpha, beta, gamma); Console.WriteLine("GAZE POINT (X, Y): ({0}, {1})", p.get_x(), p.get_y()); Point_Obj disp_pt = new Point_Obj(-p.get_x(), p.get_y()+ MONITOR_DIM_Y/2); plot_gaze_point(disp_pt); Console.WriteLine("TRANSF GAZE POINT (X, Y): ({0}, {1})", disp_pt.get_x(), disp_pt.get_y()); // Plot Rotation Angles plot_point("Pitch", Convert.ToDouble(alpha)); plot_point("Yaw", Convert.ToDouble(beta)); plot_point("Roll", Convert.ToDouble(gamma)); set_axis(); return p; }