ocular-motor-lab / OpenIris

GNU Affero General Public License v3.0
6 stars 1 forks source link

Data from left and right eye doesn't completely synchronized #14

Closed RoksanaSadeghi closed 1 year ago

RoksanaSadeghi commented 1 year ago

To fix the sync issue, considering Spinnaker has its own buffer for each camera (does it?), the buffer needs to be flushed before start grabbing images.

This added to the CameraEyeSpinnaker/BeginSynchronizedAcquisition lines 97 - 113 (see below). However, the spinnaker doesn't recognize the buffer. It needs to be set using the cam.SetUserBuffers(IntPtr pMemBuffers, ulong totalSize).

My understanding is that the buffer is set after clicking the start tracking button, but not sure how to get access to the buffer and set up the cam.SetUserBuffers inputs. The buffer is originally defined in EyeTrackerImageGrabber.cameraBuffer, which is a private BlockingCollection variable.

image

RoksanaSadeghi commented 1 year ago

The two cameras do show different times (see seconds in the image below):

image

RoksanaSadeghi commented 1 year ago

The slave camera is lagging behind.

RoksanaSadeghi commented 1 year ago

Begin Acquisition of the slave first, and then the master helped with sync (up to 500Hz), but sometimes the slave is still one frame behind.