chrishoste / eye-tracking

Eye Tracking on iPhone (iOS)
67 stars 12 forks source link

Misplaces the crosshair #2

Open rimlin opened 3 years ago

rimlin commented 3 years ago

I try to run this project on my phone and found that crosshair is placed in not place where i am look. I see that coordinates for crosshair calculated by interpolating eye coordinates to screen size. But i am not understand this magic numbers:

static let screenSize = CGSize(width: 0.0623908297, height: 0.135096943231532)

Could you please explain where you take it? Thank you.

ericksantillanp commented 2 years ago

I know it's been over a year, but I stumbled upon this nice project and had the exact same question. After googling around I found another project with a similar set-up and similar magic numbers. As you can see here :

let iPhoneXMeterSize = simd_float2(0.0623908297, 0.135096943231532)

Those magic numbers seem to be size of the iPhone X screen in meters. He uses them then to transform the local coordinates into a point in screen as seen here. Hope it helps! 👍