benoit-bossavit / U2Eyes

Other
6 stars 1 forks source link

How to calculate the real gaze vector? #2

Open zkx-sust opened 1 year ago

zkx-sust commented 1 year ago

Hi, I am a new guy in this domain and very interet in this work. Now I have produced lots of pictures for my model, but realized that I need gaze vector in camera-space coordinate, while only found look-at-point vector in left-hand world-space coordinate. Could you kindly give me some cue on how to calculate real gaze vector? Lots of appreciation!

benoit-bossavit commented 1 year ago

Hi, indeed headpose position and orientation are in camera view in order to place the face in a determined place. However, look at point is defined in headpose reference, which is easier to set for human mind. I am sorry but i won't be able to work on this until the second half of September to update the app in order to export as well gaze vector. In the meantime, if you are familiar with programing in the faceManager.cs there is a function that transform lookatpoint in camera view that you can use with unity. Please, come back to me mid September if you could not do it by yourself. Best wishes, Benoît

zkx-sust commented 1 year ago

Thank you for the answer! I am trying to do this by myself and just one last question please😭😭😭

In camera.xml, lookatpoint is in world space coordinate(lefthand), I used lookatpoint2camera function in facemanager.cs to transfer globecenter and lookatpoint into camera space(right hand). Then I substract them to get origin gaze vector. Since kappa angle is taken into consideration in this paper, I also do two rotations by multiply kappa rotation matrices(one for x axis and the other for y axis). Last step is normalization. Is these something wrong above? Thanks tons!

---Original--- From: @.> Date: Mon, Aug 21, 2023 22:44 PM To: @.>; Cc: @.**@.>; Subject: Re: [benoit-bossavit/U2Eyes] How to calculate the real gaze vector?(Issue #2)

Hi, indeed headpose position and orientation are in camera view in order to place the face in a determined place. However, look at point is defined in headpose reference, which is easier to set for human mind. I am sorry but i won't be able to work on this until the second half of September to update the app in order to export as well gaze vector. In the meantime, if you are familiar with programing in the faceManager.cs there is a function that transform lookatpoint in camera view that you can use with unity. Please, come back to me mid September if you could not do it by yourself. Best wishes, Benoît

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

benoit-bossavit commented 1 year ago

I assume that you are trying to calculate the two gaze vector (left and right eye), right? I don't think you need kappa since this is used for the eyeglobe rotation. The kappa angle does not really influence gaze vector (which is lookatpoint-eyeglobe position). Thus, this difference and normalisation should be enough. Does it help you?

zkx-sust commented 1 year ago

Oh, got it. This really helps me a lot! Thanks!

---Original--- From: @.> Date: Mon, Aug 21, 2023 23:22 PM To: @.>; Cc: @.**@.>; Subject: Re: [benoit-bossavit/U2Eyes] How to calculate the real gaze vector?(Issue #2)

I assume that you are trying to calculate the two gaze vector (left and right eye), right? I don't think you need kappa since this is used for the eyeglobe rotation. The kappa angle does not really influence gaze vector (which is lookatpoint-eyeglobe position). Thus, this difference and normalisation should be enough. Does it help you?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zkx-sust commented 1 year ago

Hi, I work this out still think they are not right enough... Could you please give the code to produce the correct gaze vector when you are free? Thank you very much!

benoit-bossavit commented 1 year ago

Hi, I am not sure what kind of code you want, code from Unity directly or from an external script? For instance, I have a script in matlab to extract this information from the xml files. Could you contact me by email? benoit.bossavit@uma.es Best wishes Benoît