Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame counter on Basler cameras cannot be used to detect frame drops #121

Open
glopesdev opened this issue Jun 2, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@glopesdev
Copy link
Contributor

glopesdev commented Jun 2, 2023

We have noticed while debugging alignment issues on Aeon arenas that the Basler cameras do not report gaps in frame counter values when frames are dropped. This seems to be an implementation decision at the driver level, i.e. the counter is possibly a "software" counter rather than a hardware counter.

This means the call to FillGaps in PylonCapture cannot be relied upon to align the frame stream to the trigger timestamp stream in conditions where there may be dropped frames:

.FillGaps(frame => frame.ChunkData.FrameID, (previous, current) => (int)(current - previous - 1))

To resolve this we would need to instead use the hardware timestamp and compare the delta between subsequent frames and compare it to the expected frame interval, which requires extracting the target FPS from the camera (possibly in the Configure method override). For example:

var frameInterval = 1e9 / Fps; // In nanoseconds. Fps needs to be determined online from camera configuration.

.FillGaps(frame => frame.ChunkData.Timestamp, (previous, current) => (int)Math.Round((current - previous - frameInterval) / frameInterval))

This is currently low-priority since we are not using nor recommending Basler hardware for current and future arenas.

@glopesdev glopesdev added the bug Something isn't working label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant