1

I'm trying to improve my pupil detection (I'm using Javacv). At the moment, I have this method below where I draw rectangle around the found pupil. I want to try to have something like a circle across the iris and a dot on the pupil to make it more accurate. Maybe by finding the iris using (hough circle) -> then find the largest blob within the iris. How do I go about that?

private void drawPupilRect(Graphics2D g2, CvRect eye) 
  // draw outline rectangle around the pupil+iris
  {
    CvRect pupil = pupilAvgRect.get();
    if (pupil == null)
      return;

    pupil.x(pupil.x() + eye.x());     // convert pupil to screen coords
    pupil.y(pupil.y() + eye.y());

    g2.setPaint(Color.YELLOW);
    g2.setStroke(new BasicStroke(4));
    g2.drawRect(pupil.x(), pupil.y(), pupil.width(), pupil.height());

  }  // end of drawPupilRect()
drifterOcean19
  • 372
  • 5
  • 24

0 Answers0