pupil-labs / pupil

Open source eye tracking
https://pupil-labs.com
GNU Lesser General Public License v3.0
1.42k stars 669 forks source link

Live video output #2296

Closed lizha0yan closed 1 year ago

lizha0yan commented 1 year ago

Hi, I'm trying to get live stream output from Pupil Core, just the video frames in three cameras. Is that possible?

mikelgg93 commented 1 year ago

Yes, you can use zmq to stream them.

Do you plan to open it in Pupil Capture on another device? Here you have an implementation Kindly note this implementation does not stream the full intrinsics and is less accurate than connecting the device directly.

lizha0yan commented 1 year ago

Thanks for replying. Actually, I only need the original eyes and the world's video output so that I can try on my own model.

lizha0yan commented 1 year ago

Yes, you can use zmq to stream them.

Do you plan to open it in Pupil Capture on another device? Here you have an implementation Kindly note this implementation does not stream the full intrinsics and is less accurate than connecting the device directly.

Is there any way to use Pupil Core as a webcam? I want to do something like:

import cv2
vid = cv2.VideoCapture(0)
while(True):
    ret, frame = vid.read()
    cv2.imshow('frame', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

Instead of using "0" for the laptop webcam, I want to use pupil core.

papr commented 1 year ago

Hi, Pupil Capture installs the libusbk driver to gain full access the cameras' capabilities. To use OpenCV to read frames from the camera, you will need to deinstall this driver (steps 1-5 from here).

Alternatively, you can use pyuvc to get frames from the camera.

Note: With the approaches above, you would not be able to access the camera via Pupil Capture in parallel to your own script. To do that, you can either receive the camera images via Pupil Capture's realtime API or build a custom Pupil Detector plugin that runs within Pupil Capture.