how to convert gaze vector to screen coordinates
utkarshvadar opened this issue · 11 comments
i am using pretrained model. But after getting the gaze vector/angles how to project then to screen or how to convert it to screen coordinates.
-
Check the issue on the following link
TadasBaltrusaitis/OpenFace#20 -
Its seems that you have 2 choices(at least):
a) LESS ACCURATE: Use the gaze angle and the distance between your head position and the screen in order to find the pixel that is pointed
b) MORE ACCURATE: Do a person-specific camera calibration(for example, check how calibration procedure is supported in Windows 10) -
I have tried NEITHER of these 2 solutions, however these solutions provided by Tadas seem absolutely logical to me
UPDATE: Now my code at "dlib/webcam_face_pose_ex.cpp" at line 398 includes trigonometrical
calculations in order to find the pixel in screen that we see.Check the multiple if-elses and also calculate
somehow how many milimeters is a pixel.I found that 1mm = 0.36pixels
@caxelos please check, 1mm = 0.36pixels should be 1mm = 3.6pixels and more accurately isn't it
1mm = 3.77? Because in angle thanslations, this 0.1 will matter. Please verify
- thank you for your comment
- check the new version here: https://github.com/caxelos/MPIIGaze/blob/hpc-code/webcam_face_pose_ex.cpp (line: #define FACTOR 0.3879)
- i include in my future plans to make the repo clearer but now I don't have much time the following days.
- i use 1mm=0.3879 in the new version. I haven't done any corrections so of course there is a possibility of faults in calculations.
- When I have time, I'll check this calculation again.
UPDATE: Now my code at "dlib/webcam_face_pose_ex.cpp" at line 398 includes trigonometrical
calculations in order to find the pixel in screen that we see.Check the multiple if-elses and also calculate
somehow how many milimeters is a pixel.I found that 1mm = 0.36pixels
you mean line 498? But I still cannot understand what is happening in those lines of code.
i am using pretrained model. But after getting the gaze vector/angles how to project then to screen or how to convert it to screen coordinates.
Hello, have you achieved the effect of projecting the gaze vector onto the 2D screen as a gaze point? Could you help me?Thank you very much.
i am using pretrained model. But after getting the gaze vector/angles how to project then to screen or how to convert it to screen coordinates.
Hello, have you achieved the effect of projecting the gaze vector onto the 2D screen as a gaze point? Could you help me?Thank you very much.
You will find the code that does that in this py script
https://github.com/Tobias-Fischer/rt_gene/blob/master/rt_gene_standalone/estimate_gaze_standalone.py
i use trigonometry to calculate the screen point of interest. You know gaze angles (vertical, horizontal) and you also know the distance of your head from camera in milimeters (opencv's function). These information are enough to find the point of interest.
i am using pretrained model. But after getting the gaze vector/angles how to project then to screen or how to convert it to screen coordinates.
Hello, have you achieved the effect of projecting the gaze vector onto the 2D screen as a gaze point? Could you help me?Thank you very much.
You will find the code that does that in this py script
https://github.com/Tobias-Fischer/rt_gene/blob/master/rt_gene_standalone/estimate_gaze_standalone.py
Thank you very much.
https://www.youtube.com/watch?v=H_9viDBiwOE&list=PLLB6WOMcarJgAyGKsLUgqYD9eTb0GgX04&index=5
I find this paper exactly solving the issue here. Please check
@utkarshvadar @Kelly-ZH if you are still at it, have you developed the method for getting screen co-ordinates?