Replies: 2 comments
-
very interesting technique; could you show me some examples of the code? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Unfortunately I don't do Java. If you do the steps a - d, in full or
partial, I can complete the other steps for you.
…On Sat, Jun 29, 2024 at 1:08 AM chamui9 ***@***.***> wrote:
very interesting technique; could you show me some examples of the code?
—
Reply to this email directly, view it on GitHub
<#465 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGG5ROQG23JSKOERKHPOPGLZJZTQFAVCNFSM6AAAAABH23WM36VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TSMJQHEYDM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is what I propose as an alternative to compute the gaze vector. The results are much better than the current technique. The current technique actually does not produces the right results (by a wide margin in the opposite direction for some samples.)
a. Select one of the eyes that is closer to the camera (same as the current technique)
b. Pick four points around the each eye
leftEyePoints = [33, 133, 159, 145]; //left, right, up, down, (we can replace 159, 145 with 27 and 23)
rightEyePoints = [362, 263, 374, 386]; //left, right, up, down, (we can replace 374, 386 with 257 and 253 )
compute the x and y coordinates of the centers of the eye by taking the averages of x and y coordinates of these four sets of points.
c. With the x, y, z coordinates of these four points build a linear system of equations as f = Ac, and solve for c (the center of the eyeball and the radius of the eyeball). The procedure is explained in (https://jekel.me/2015/Least-Squares-Sphere-Fit/)
d. Use the opencv linear solver or something similar to solve for c cv::solve(A, f, c, cv::DECOMP_SVD);
e. With x, y, z coordinates of center of the eyeball, the radius of the center of the eyeball, and x, y coordinates of c enter of the eye, compute the z component of the center of the eye. Change coordinates so that everything is with reference with the eyeball center (simple subtraction).
repeat the same procedure for iris. Note that for iris we might have to choose an offset. The offset I have chosen is (-5.0f, -10.0f) for the left eye, and (5.0f, -10.0f) for the right eye.
Note that we do sqrt to compute the z component of eye and iris center, we need to choose a right sign. For leftEyeCenter.z and leftIrisCenter.z, the sign is +ve and for the right eye righEyeCenter.z and rightrisCenter.z the sign is -ve.
f. convert from x, y, z for the eye center and the iris center to polar coordinate using the equation
leftEyeCenterHor = atan2(leftEyeCenter.x, - leftEyeCenter.z);
leftIrisCenterVer = asin(leftIrisCenter.y / leftEyeSphereRadious);
Finally
verAngle = leftEyeCenterVer - leftIrisCenterVer;
horAngle = leftIrisCenterHor - leftEyeCenterHor;
That is all!
Beta Was this translation helpful? Give feedback.
All reactions