Page 1 of 1

smoothed gaze coordinates in pix

PostPosted: 26 Feb 2014, 21:23
by mingxinbit
I have run this code (provided in the website) and captured the gaze data.

I encounter a problem.

Code: Select all
gtl::Point2D const & smoothedCoordinates = gaze_data.avg;


return values of x and y coordinates always are -107374176.

Others lefteye, righteye, raw, etc are normal.

How to handle?

The smoothed gaze coordinate value is calculated from center value between lefteye.avg and righteye.avg?
gaze_data.avg=(lefteye.avg+righteye.avg)/2??

Thank you.

Re: smoothed gaze coordinates in pix

PostPosted: 05 Mar 2014, 15:07
by MastaLomaster
The same for me.

In debugger (MSVS 10) I have the gaze_data.avg values constantly the same ( -1.0737418e+008), while the other members of gaze_data are changing.

Re: smoothed gaze coordinates in pix

PostPosted: 05 Mar 2014, 17:36
by Martin
We're looking into this right now. Will get back to you once we've located the bug and have a solution. Won't take long.

Re: smoothed gaze coordinates in pix

PostPosted: 05 Mar 2014, 18:04
by Martin
Turns out there is a small typo in the C++ client parsing.

Row 125 in gazeapi_parser.cpp should be:

Code: Select all
parse_point2d(gaze_data.avg, frame->get_child("avg"));


Github repository to be updated with changes soon.

Re: smoothed gaze coordinates in pix

PostPosted: 18 Dec 2014, 04:57
by ryklin
A small discrepancy has come to my attention regarding smoothed versus raw gaze data:

if averaging you have two variables:
gazedata_avg.x
gazedata_avg.y

But with raw data:

gazedata.lefteye.raw.x
gazedata.lefteye.raw.y
gazedata.rifghteye.raw.x
gazedata.rifghteye.raw.y

So, when averaging, we can not distinguished between left and right eye data. It might be useful to update the SDK to give us:
gazedata.lefteye.avg.x
gazedata.lefteye.avg.y
gazedata.rifghteye.avg.x
gazedata.rifghteye.avg.y

This would be useful for application that need to use just one eye.

Re: smoothed gaze coordinates in pix

PostPosted: 18 Dec 2014, 13:15
by Martin
You have the average for each eye inside the left/right JSON object. Will check the C++ SDK.

Code: Select all
"frame":
{   
   "timestamp": "2014-12-18 11:58:53.730" 
   "state": 7,   
   "fix": false,
   "time": 487384226, 
   "raw": {"x": 584.057,"y": 440.2673 },
   "avg": {"x": 584.057,"y": 440.2673 },   
   "lefteye":
   {
      "avg": {  "x": 583.9083,  "y": 458.1152},
      "pcenter": {  "x": 0.3541,  "y": 0.532},
      "psize": 22.211,
      "raw": {"x": 583.9083, "y": 458.1152}
   },
      "righteye":
   {
      "avg": {  "x": 584.2057,  "y": 422.4195},
      "pcenter": {  "x": 0.5084,  "y": 0.504},
      "psize": 22.7543,"raw": {  "x": 584.2057,  "y": 422.4195}   
      },     
}