views:

763

answers:

3

I have two images. In one of the images, my eye is in the center position and in the other image, it is in the left. How do I find out whether my eye is in the left or the right?

I am using MATLAB. Are there any functions for this?

+2  A: 

This sounds like Eye tracking implemented in MATLAB which is a fairly popular research topic.

If you want a more detailed answer, please answer the following questions:

  1. Do you know the coordinates of your eye in the first image?
  2. What kind of motion is there between the two images? Rotation/translation/scaling/...?
  3. Do you want this to be real-time?
  4. What is the resolution of the images?
  5. Are there going to be more eyes in the image apart from yours?
Jacob
i dunno the co-ordinates. i want to find tat out only. the images are captured from the webcam and the only movement is the movement of the eyes. the resolution of the image is 320*240. there will be only one person.
Nave
I see you've already discussed the eye detection problem here: http://stackoverflow.com/questions/1526672/matlab-eye-recognition - didn't this work for you?
Jacob
well ya.. the problem is getting more specific now..
Nave
What **didn't** work with the previous method?
Jacob
+2  A: 

A simple solution is to try to detect the iris using circular Hough Transform.

You can find a lot materials out there. To name a few, these two fileexchange submissions:

Amro
+1  A: 

If you are willing to select the eye in one image you can use template matching to find it in others (for example you can mark it in the first frame of a video and then find it in all other frames).

Look at the normxcor2 function in matlab: http://www.nd.edu/~hpcc/solaris8%5Fusr%5Flocal/src/matlab6.1/help/toolbox/images/normxcorr2.html

This technique is robust to constant illumination change, but will fail if the appearance of the eye changes significantly between the image you took the template from and the image you are searching in.

If you are going to search for the eye in a lot of frames (for example, eye tracking from a webcam) then you should look at stronger techniques such as the Kalman Filter or the Particle Filter (aka Condensation Filter in computer vision)

Yair