# Is it possible to detect eyes and nose tip using JAI

Hi. I am doing my academic project based on HCI, thts nothing bt controlling mouse using face organs (eyes and nose tip). so i accessed my webcam into frame using JMF concept, but now i hanged out that whats next. I read some forums , and i decided to go for JAI to detect eye and nose tip. So my doubt is "Is it possible to detect eyes and nose in a video or in a picture using JAI ?" If no, which concepts should i practice regarding this? i heard that we can compare pixel by pixel in 2 diff images, is it true? plz help me out from this.
• ###### 1. Re: Is it possible to detect eyes and nose tip using JAI
BhuvanRAM wrote:
So my doubt is "Is it possible to detect eyes and nose in a video or in a picture using JAI ?"
I've been working on this for a while and I've found a few things.

1st: [this thread|http://forums.sun.com/thread.jspa?threadID=5270630&tstart=0] (now locked), looked like it had some good ideas for starting points (namely Haar-Cascade which came up often in my research as the "best" solution for recognizing anything in images)

2nd: I came across a program over at sourceforge called [LEA (Light-weight Eye-tracking Algorithm)|http://sourceforge.net/projects/lea-eyetracking/]. It scans an input and locates 1 eye and focuses on it (and has basic implementation whether or not the "looker" is looking up/down/left/right). I think the author also used a Haar-Cascade as he included an xml file for face data.

3rd: Hough Circular Transformation. This is used for detecting circles in an image given a particular radius. I had originally planned on modifying the LEA program to recognize 2 eyes. Alternatively, recognize 1 eye and give the coordinate of the center of it, then scan an area 3-4x larger than the diameter of the 1st eye that was found (since usually eyes aren't much further apart than the width of 2-3 eyes), and scanning that area for a circle of the same radius as the 1st eye. To adapt to your situation, you'd then have 2 coordinates indicating the center of each eye, find the perpendicular bisector and the ridge of the nose should be somewhere along that line. How you'd find it though, I'm not sure.

However, I'm guessing you'd want to be able to use the viewer's eyes to control the mouse? I've found that just detecting the eyes isn't enough, you'd have to detect eye movement. To do that, you'd either need an HD webcam, or enlarge the picture of the eye to be able to detect fine movements without the resulting image being too pixelated. From there, you can either look for the reflected ambient light in the eye and use that as a reference to where the viewer is looking (as the reflected light will always be in the same place relative to the iris/pupil, regardless of the orientation of the head), or you could (less-accurately) track where the iris/pupil is, relative to the rest of the eye. However that method doesn't take into account head rotation (i.e. If you're focusing on a single point on the screen, but turn your head to the right, this method will perceive you as having looked to the left).

This thread may be a month old, but hopefully it reaches you in time, or serves as a decent starting point for others.