thaytan / OpenHMD

Free and Open Source API and drivers for immersive technology.
Boost Software License 1.0
137 stars 12 forks source link

Split camera processing across threads #2

Closed thaytan closed 3 years ago

thaytan commented 4 years ago

Doing all the video processing directly in the UVC callback leads to frame misses when performing the expensive RansacPnP processing on tracked LED blobs.

It would be better to split capture and processing into separate threads.

In general, scanning a frame and reading out the blobs seems do-able in the callback, so it might be OK to keep the blob tracking in the new-frame callback, but to defer any RansacPnP operations to a separate thread.

thaytan commented 4 years ago

I have started doing this split locally but it's not finished yet.

thaytan commented 3 years ago

This is partially implemented now - capture is done in 1 thread (shared for all sensors), and analysis in another (1 per sensor) thread. I want to add a 2nd per-sensor thread to do brute force matching.

thaytan commented 3 years ago

Complete in fddc6dbe8707c35bc18e11033026252c242c424b for now