Eye level detection

Hi there, Anyone know of any code that you are able to use a standard webcam to detect eye level co-ordinates and adjust a variable accordingly? Any information would be much appreciated!

eye level co-ordinates

Eye-level? That defines a position relative to some particular viewer.

Yes so the co-ordinates of the eye level in respect to the camera.

If the camera were to take either a picture or a video could it possibly detect the eye level and allocate a co-ordinate to the centre point?

Yes, if you had a detailed model for the scene.

Sorry could you describe what you mean by that?

And do you have any relevant coding I can base my project off of, or a webpage that may point me in the right direction as I have searched a lot and cannot find anything relevant.

Thank you for your help!

If you have a mathematical model for the scene and for the lens, it is relatively easy to predict what the camera sees (the image). Do that for various camera elevations ("eye levels") until you get a match.

Ray tracing is one approach.

How would I be able to incorporate ray tracing with the arduino? Surely that all depends on the camera functionality?

Google "head tracking opencv" - OpenCV is an open source library for machine/computer vision tasks. Note that it isn't the only one, but it is free, and very robust.

Once you can locate and track the user's head, you can then use the library to find the person's eyes, and from there the center points - with a line plotted between, that's your "level".

With the camera calibrated (height above floor plus a few other variables) - you can gain an idea (it will not likely be super-accurate) of the level of the eyes.

Perfect this is the exact sort of thing I was looking for thank you!

Do you possibly know whether or not it is possible to have this running purely on the arduino after coding without depending on the computer?

Do you possibly know whether or not it is possible to have this running purely on the arduino after coding without depending on the computer?

Yes. No.

Sorry I don't fully understand what you mean by that? would it not be possible to have this running independently on the arduino?

jake912: Sorry I don't fully understand what you mean by that? would it not be possible to have this running independently on the arduino?

I'll elaborate.

Yes, I know the answer. It is no. Try compiling OpenCV (the name contains open for a reason) for the Arduino to understand why.

Yes, I know the answer. It is no.

Is there another method that I can use in that case that will allow me to detect eye level without depending on the computer?

You could use an ultrasonic sensor to measure the distance to the floor.

You could use an ultrasonic sensor to measure the distance to the floor.

Is there a way that I would be able to incorporate that into my work to be able to detect a persons eye level? I have previously worked with ultrasonic sensors and cannot see how I could use it in this project?

Is there a way that I would be able to incorporate that into my work to be able to detect a persons eye level?

If you want something looking at the person, to see where the persons eyes are, your only choice is a camera and a PC.

If you want the user to wear something that can determine where his/her eyes are, relative to some known location (like the floor), there are options.

What you haven't done is to explain why you need to know where someone's eyes are.

What you haven't done is to explain why you need to know where someone's eyes are.

I am currently undertaking a project where i am trying to detect the users eye level, this eye level will be given a co-ordinate which i will use to change a certain variable in my coding.

I would prefer for the arduino to be running independently but if not it is not a major issue.

The user cannot be wearing anything that will assist as it will not work with my project unfortunately :/

jake912: I am currently undertaking a project where i am trying to detect the users eye level, this eye level will be given a co-ordinate which i will use to change a certain variable in my coding.

I would prefer for the arduino to be running independently but if not it is not a major issue.

The user cannot be wearing anything that will assist as it will not work with my project unfortunately :/

Oh, well, that clears everything up. NOT.

Good luck.

Due to security issues I am unable to disclose any more information that I already have so if you can provide any more assistance that would be great. THANKS.

Rather than an Arduino for OpenCV - you might use a Raspberry Pi - in fact, the RPi Zero should be smaller than an Arduino, if size or portability is a concern. Even a standard RPi is pretty small. Also - have you thought about using an Android smartphone (and it's built in camera), building an app to run on it (using Java - which I believe OpenCV or a wrapper or something is available for - or at least a work-a-like library), then (if you need external control) connecting up an Arduino to the USB port (or via bluetooth) and using the Android ADK for the Arduino.