Home › Forums › Software Development › EyeX sometimes gives "strange" gaze point in Unity
- This topic has 9 replies, 5 voices, and was last updated 6 years ago by Alex [Tobii].
- 08/12/2016 at 22:43 #6022
I’ve got a pretty simple script attached to a game object in Unity. The idea is as simple as it gets, wherever you’re staring the object should attach itself to that position. Below is the jist of what I’m doing.
GazePoint gazePoint = EyeTracking.GetGazePoint(); transform.localPosition = new Vector3(gazePoint.Screen.x, gazePoint.Screen.y, transform.localPosition.z);
My problem is that while this works exactly as I would expect, sometimes the game object will jump around. It’s fine that it moves slightly I understand that my eyes aren’t as perfectly still as I might think or the eye tracking isn’t laser guided accuracy or some combination of the two, but the giant jumps are what I don’t understand. Eye jitter in this gif I uploaded you can see that I’m trying to focus my gaze on the white circle and the black circle behind it is what the script is attached to.
Anyone got any pointers for me on this?12/12/2016 at 20:50 #6028Grant [Tobii]Keymaster
I suspect that this behaviour is indeed expected and as a result of biological factors rather than with the eye tracking technology. If you check out our video for a TX300 Eye Tracker (used for detailed scientific research) you will see that
even at 300Hz, eye jitter is in fact inherent to the working of the eye.
That being said, perhaps it would be an idea for you to test out the tracker on a few different people and report if there is any significant difference between the results.13/12/2016 at 01:03 #6030
Thanks for getting back to me!
I feel I wasn’t very clear with my explanation. Here’s another video in another example I put together that showcases the problem a bit more. Here I am trying to focus my gaze on the gravestone that is visible and I understand that my eye does move very slightly, however the large jumps above the gravestone are what I don’t understand.
I have the Tobii eyeX tool on my taskbar and when I enabled the “Gaze Trace” feature of that it works exactly as I am expecting. It does have a small amount of movement as you’ve explained, but it never does a large jump like the gif I linked to. For the sake of completeness, I’ve asked four different people to setup profiles on my machine and try the scene I setup, all experience the same issue as I have.
This problem also occurs in one of the demo’s that is provided with the unityPackage for the Tobii eyeX. Here is another video I took using the “02_SimpleGazeSelection” scene where I am trying to focus on my cursor and while it does a great job of that, sometimes it will give me gaze points very high above my cursor which I am not focusing on. I zoomed in on this video to show it much more clearly (because the dots are fairly small) but that was just for you to see, the same thing occurs when there is no zoom.
Thanks again for your time, Grant!
Edit : I forgot to mention, I have two eyeX cameras and this happens with both of them so it’s unlikely that it’s a faulty device. They also both work exactly as I’m expecting them to when I use the tool’s “Gaze Trace” feature.15/12/2016 at 13:37 #6038Jenny [Tobii]Participant
I recognize this problem as caused by a Unity bug. In certain situations the Unity Editor intermittently reports an incorrect value for Screen.height (height of the ‘Game’ window) making the calculations of the GazePoint way off intermittently. When I saw it, it happened only when one of the Unity Editor sub-windows (like ‘Game’, ‘Scene’, ‘Console’, ‘Inspector’) were detached from the main editor window, and maybe moved to a second monitor. Have you detached any of the sub-windows from the Unity Editor?
Also, I think the problem should not persist in standalone builds, but is a specific problem when playing the game from within the Unity Editor. I haven’t tested with a standalone game that creates two separate Unity windows though.
On a side note: the Gaze Trace feature is quite heavily filtered and is not really comparable to the behavior of the basic lightly filtered data you get from EyeTracking.GetGazePoint(). On the other hand, in scene 01 there is an option to use a filter which is very similar to the filter used by Gaze Trace. The movement of the filtered gaze visualization in scene 01 should be comparable to Gaze Trace to be able to conclude that the mysterious jumps are related to the Unity Editor and not the eye tracker data itself.15/12/2016 at 18:15 #6039
My game window has unfortunately always been attached to the same Unity window, I never pull the components apart. Just to be clear on the windows here’s a screenshot of my Unity layout. I don’t recall having tried standalone builds so that gives me something to test. Knowing that the Editor does have a known bug where its reported screen conflicts with the camera’s detection is very helpful though, this gives me something to investigate. I’ll be sure to return with my findings if I’ve figured out what’s happening or what I setup wrong.
That’s good to know that the Gaze Trace is not a 1:1 feature with the Unity scripts. I’ve tried the smoothing in the first demo scene before, it smoothed out the jitter around my gaze but the stray points were still happening.03/05/2017 at 16:07 #6785tiblopParticipant
hello did you manage to resolve this issue?03/05/2017 at 22:38 #6789Grant [Tobii]Keymaster
Hi @zack, may I ask how you got on following our last advice? Many thanks for the update!05/05/2017 at 01:52 #6802
Hey @tiblop, ( and thank you @grant-rogers for pinging me, I missed tiblop’s message! )
@jennytobii explained it but basically the game window while using the editor can sometimes report wrong window sizes that would cause the jittery effect. I tried this project as a standalone application and the jitters went away. It seems to be out of Tobii’s control as they’re just recipients of the Unity game window’s dimensions which seem to be intermittently wrong.
The best advice I can offer about dealing with this is don’t try to write any code to solve it because on a shipped game this problem won’t exist. It may be a nuisance, but the best way to test an eye tracking feature without those jitters would be to build the game and run it as a standalone application outside of the Unity editor. Hopefully you’re not working in an environment where this isn’t a possibility, but it’s been my solution for this.05/05/2017 at 17:26 #6806Alex [Tobii]Participant
We are soon releasing an update for our Unity SDK, where this part of code was reworked. So this bug might be fixed. If not, we will investigate it again to fix it for you!15/05/2017 at 14:38 #6865Alex [Tobii]Participant
Tobii Unity SDK for Desktop 3.0 Beta:
Please feel free to send us your feedback.
- You must be logged in to reply to this topic.