156  LFATAL(
"Sorry this module needs to be updated to work again...");
 
  211  //starburst pupil contour detection
 
  212  starburst_pupil_contour_detection((UINT8*)eye_image->imageData, eye_image->width, eye_image->height,
 
  213                                    eyetracker::edgethresh::get(), eyetracker::numrays::get(),
 
  214                                    eyetracker::mincand::get(), start_point, edge_point);
 
  217  CvPoint pupil = { 0, 0 }; // coordinates of pupil in tracker coordinate system
 
  219  inliers_index = pupil_fitting_inliers((UINT8*)eye_image->imageData, eye_image->width, eye_image->height,
 
  220                                        inliers_num, pupil_param, edge_point);
 
  222  ellipse_axis.width = (int)pupil_param[0];
 
  223  ellipse_axis.height = (int)pupil_param[1];
 
  224  pupil.x = (int)pupil_param[2];
 
  225  pupil.y = (int)pupil_param[3];
 
  227  // JEVOIS only draw line if valid
 
  228  if (debugdraw && corneal_reflection.x > 3 && corneal_reflection.y > 3 && pupil.x > 3 && pupil.y > 3)
 
  229    cvLine(eye_image, pupil, corneal_reflection, 100, 4, 8);
 
  231    //printf("ellipse a:%lf; b:%lf, cx:%lf, cy:%lf, theta:%lf; inliers_num:%d\n\n", 
 
  232    //     pupil_param[0], pupil_param[1], pupil_param[2], pupil_param[3], pupil_param[4], inliers_num);
 
  233  for (int k = 0; k < 5; ++k) pupell[k] = pupil_param[k]; // send data to caller
 
  238    for (int i = 0; i < int(edge_point.size()); i++)
 
  241      for (int j = 0; j < inliers_num; j++) if (i == inliers_index[j]) is_inliers = 1;
 
  242      stuDPoint const & edge = edge_point.at(i);
 
  243      if (is_inliers) Draw_Cross(eye_image, (int)edge.x,(int)edge.y, 5, 5, 200);
 
  244      else Draw_Cross(eye_image, (int)edge.x, (int)edge.y, 3, 3, 100);
 
  249  if (ellipse_axis.width > 0 && ellipse_axis.height > 0)
 
  251    start_point.x = pupil.x;
 
  252    start_point.y = pupil.y;
 
  253    //printf("start_point: %d,%d\n", start_point.x, start_point.y);
 
  254    Draw_Cross(eye_image, pupil.x, pupil.y, 10, 10, 255);
 
  255    cvEllipse(eye_image, pupil, ellipse_axis, -pupil_param[4]*180/M_PI, 0, 360, 255, 2);
 
  261  if (lost_frame_num > 5) {
 
  262    start_point.x = eyeimg.cols / 2;
 
  263    start_point.y = eyeimg.rows / 2;
 
  266  Draw_Cross(eye_image, (int)start_point.x, (int)start_point.y, 7, 7, 128);
 
  269  cvReleaseImageHeader(&eye_image);
 
  270  cvReleaseImage(&threshold_image);