Giter VIP home page Giter VIP logo

Comments (7)

AndreNicolai avatar AndreNicolai commented on July 3, 2024

Have a look at Pupil - Data Format for other information you can get from Pupil (e.g. pupil size). Let me highlight, though, that the "diameter" unit for 2D calibration is pixels, while "diameter_3d" will give you the values in mm.

As for getting the eye camera images:
You were popinting to the correct FramePublishing class, but with today's commit to the master branch, we implemented a quick-to-read example on how to access the image streams. Please download the newest version and have a look at FramePublishing.unity respectively FramePublishingDemoManager.cs

Hope this help!

from hmd-eyes.

loolsasy avatar loolsasy commented on July 3, 2024

I'm still grateful for your help.
The image succeeded in obtaining the desired texture in FramePublishing.unity.
However, there is no way to determine the pupil size.
I checked the value of Diameter () or _3D.Circle.Radius () in PupilData.cs, ​​but it only returns 0. I tried CalibrationMode in 3D, but the result seems to be the same.
PupilCapture It looks like the size of the pupil and the size of the iris are found on the screen. I would like to use it in the Unity Plugin.
I need your help. :-)

from hmd-eyes.

AndreNicolai avatar AndreNicolai commented on July 3, 2024

The PupilData methods you mentioned are left-overs from the past (which should maybe be removed). PupilData currently only exemplifies how to handle gaze information. If you want to get information such as 'diameter', you have to subscribe to "pupil.". The dictionary you receive will include values for 'diameter' and you can access it by e.g. adapting the following method from PupilTools:
public static float ConfidenceForDictionary(Dictionary<string,object> dictionary)
{
object conf0;
dictionary.TryGetValue ("confidence", out conf0);
return (float)(double)conf0;
}
Just replace "confidence" with "diameter"

from hmd-eyes.

loolsasy avatar loolsasy commented on July 3, 2024

I wrote the following code in PupilTools.cs,
public static float DiameterForDictionary(Dictionary<string, object> dictionary) { object conf0; dictionary.TryGetValue("diameter", out conf0); return (float)(double)conf0; } public static float Diameter(int eyeID) { if (eyeID == PupilData.rightEyeID && pupil0Dictionary != null) return DiameterForDictionary(pupil0Dictionary); else if (eyeID == PupilData.leftEyeID && pupil1Dictionary != null) return DiameterForDictionary(pupil1Dictionary); else return 0; }
The desired result could be obtained.
It appears that only the result measured at the time of calibration appears.
But what I really want is to find the size of the pupil that changes in real time.

For example, if the background changes from black to white, the size of the pupil will decrease.
I want to measure changes in pupil size in real time.

And, if possible, I wonder if the size of the pupil can be measured by dividing it into a horizontal value and a vertical

from hmd-eyes.

AndreNicolai avatar AndreNicolai commented on July 3, 2024

We actually have no implementation in the Unity plugin to record value changes. So this would be something you have to implement on your own. But the code you posted is a good start.
What you can also get from the dictionary is a timestamp, which might be helpful for this, as well.

As for the question about values for horizontal and vertical extend:
It would have been too complicated to post a solution, here, so I just commit an additional Unity scene and script for subscribing to "pupil.". Have a look at it:
The dictionaries you receive also contain an object named "ellipse" that offers the information you need. The axes define the length of the major and minor axis of that ellipse (with "diameter" representing the major axis value). As the axes do not correspond to horizontal and vertical extend, you will also need to use "angle", which indicates how much the ellipse is turned away from the horizontal axis. ( This visualization might help )

Hope this helps!

from hmd-eyes.

AndreNicolai avatar AndreNicolai commented on July 3, 2024

@loolsasy I have not heard back from you in a while. Did my last comment and the new Unity scene help you with your endeavor?

Can we close this issue?

from hmd-eyes.

loolsasy avatar loolsasy commented on July 3, 2024

Oh, I'm sorry for the delay.
I was delayed to apply the new plug-in.
Thanks to your help, I was able to implement the functionality I wanted.
You can close this post.

from hmd-eyes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.