Home Forums Software Development gaze coordinate

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8126
    Mina
    Participant

    Hi, I am using tobii eyetracker for creating an interactive book, but I can not get the gaze coordinate, I tried the minimal samples but I didnt have any success,
    I am using c#

    I appriciate so much if you can help me,

    I have two methods, one drawMehtod() which draw a rectangle at the given points
    and a gazePos() method that pass the X,Y coordinations to the drawMethod
    then I call the gazePos() by clicking the button1

    I dont get any errors but also no respons

    private void gazePos()
    {

    var eyeXHost = new EyeXHost();
    eyeXHost.Start();
    var lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
    lightlyFilteredGazeDataStream.Next += (s, e) =>drawMethod(e.X, e.Y);

    var eyePositionDataStream = eyeXHost.CreateEyePositionDataStream();
    Console.In.Read();
    lightlyFilteredGazeDataStream.Dispose();
    eyePositionDataStream.Dispose();
    eyeXHost.Dispose();

    }

    public void drawMethod(double w, double h)
    {
    g = CreateGraphics();
    p = new Pen(Brushes.DarkBlue);
    r = new Rectangle(Convert.ToInt32(w+button1.Width), Convert.ToInt32(h), 20, 20);
    g.DrawRectangle(p, r);

    }

    private void button1_Click(object sender, EventArgs e)
    {

    gazePos();
    }
    }

    please send me your suggestions,
    Thank you

    #8136
    Grant [Tobii]
    Keymaster

    Hi @minoo, thanks for getting in touch. You initially mentioned you had no success with the minimal samples?
    Perhaps you are unaware we have produced a separate suite of sample programs dedicated especially for Interaction purposes which contain all the necessary code and steps required to implement your project (based upon your initial description)

    You can check them out for free @ https://github.com/Tobii/interaction-samples

    I believe the ‘forms samples’ should be exactly what you are looking for and thus save you the hassle of starting your own application from scratch. Please check it out and kindly let us know if you are still experiencing difficulty in getting started.

    #8141
    Mina
    Participant

    Hi, Thank you for the response,
    Im using these samples already,
    The problem is that the eyegaze position minimal sample has been written for console,and it works well there,
    But Im creating my program of interactive book on windows forms,
    I need to know where the reader is looking, and I should have gaze position information,
    But I m not able to write it in a method it,
    Thank you again for your kind attention

    #8144
    Grant [Tobii]
    Keymaster

    Hi @minoo, yes indeed the *minimal* samples are written for the console output, but we have included in the aforementioned
    links several WPF examples for Windows Forms that include interactive buttons, menus, etc….

    https://github.com/Tobii/interaction-samples/tree/master/WpfSamples

    Did you get a chance to try running these? I think it should be greatly helpful for you in this regard.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.