antoinelame / GazeTracking

👀 Eye Tracking library easily implementable to your projects
MIT License
1.85k stars 505 forks source link

[Question] Scaling/Shifting Calculations in Horizontal/Vertical Ratio? #58

Open devanshanker opened 3 years ago

devanshanker commented 3 years ago

Thank you very much for this helpful repo. In eye_tracker.py, what is the source/purpose of the (...) * 2 - 10 operations on each pupil?

# horizontal_ratio(self)
pupil_left = self.eye_left.pupil.x / (self.eye_left.center[0] * 2 - 10)
pupil_right = self.eye_right.pupil.x / (self.eye_right.center[0] * 2 - 10)
# vertical_ratio(self)
pupil_left = self.eye_left.pupil.y / (self.eye_left.center[1] * 2 - 10)
pupil_right = self.eye_right.pupil.y / (self.eye_right.center[1] * 2 - 10)