Author |
Topic: Convert on-screen pixel distance to degrees (Read 4260 times) |
|
allbread
YaBB Newbie

 I love YaBB 1G - SP1!
Posts: 1
|
 |
Convert on-screen pixel distance to degrees
« on: 11/14/09 at 10:39:33 » |
Quote Modify
|
I'm not sure where to post this... I've been looking online for forums about or relating to eye tracking applications programming... I'm trying to determine how to convert pixel distance to viewing angle degrees; i.e. given the [x,y] coordinates on a desktop how do I convert the distance between two points on screen to degrees traveled in terms of a subjects viewing angle. I'm guessing there is a basic trig equation given a set distance from the monitor that I can use to figure this out however I'm worried that this might be an oversimplification. Not sure if I'll get any responses here... it seems this forum is quite dead, however I guess it can't hurt to ask
|
|
Logged |
|
|
|
JB
YaBB Newbie

 I love YaBB 1G - SP1!
Gender: 
Posts: 3
|
 |
Re: Convert on-screen pixel distance to degrees
« Reply #1 on: 04/10/10 at 20:17:20 » |
Quote Modify
|
Hi, This is not an answer for your question. But you and I are one the same page. I am also struggling to answer that question. Did you find anything? If I figure out something, I will let you know. Go for it!
|
|
Logged |
|
|
|
Laurent Itti
YaBB Moderator YaBB God
    

iLab rocks!
Gender: 
Posts: 550
|
 |
Re: Convert on-screen pixel distance to degrees
« Reply #2 on: 04/10/10 at 23:23:58 » |
Quote Modify
|
Hi guys - yes, it's very simple if you are willing to be approximate. Consider that the eye is at a distance L from the screen. Now assume that your screen has a width of W pixels, and when you measure it with a ruler, you find that the physical width is D. you can draw a triangle from the eye of the subject shooting straight to the center of the screen and then complete the triangle by adding the rightmost point on the screen. Let's call T the viewing angle for the entire screen width. So we have tan(T/2) = (D/2) / L that is T = 2 * arctan(D / 2L) in radians you can convert that to degrees and that's your total horizontal field of view. Now since you have W pixels in that field of view, it comes down to PPD = W / T when T is in degrees you can repeat for the vertical dimension. Given PPD you can simply convert from pixels to degrees by dividing your distance in pixels by PPD. Again this is a coarse approximation but it will give you a ballpark figure. best -- laurent
|
|
Logged |
|
|
|
|