prisonerjohn / ofxAzureKinect

An openFrameworks addon for the Azure Kinect.
MIT License
73 stars 24 forks source link

Run capture in a separate thread. #2

Closed prisonerjohn closed 3 years ago

ofZach commented 5 years ago

just a note that I was able to add a thread around the capture and use a mutex to copy k4a::capture objects. My code is a little messy but happy to post it up if it's helpful to see.

also, for performance reasons there's a fair amount of k4a images being allocated and reset every frame -- I didn't dig into every function but the depth to color function, for example. it probably makes sense to allocate once, like the ofImages are.... I was able to get much better frame rates with that (and the threading)

prisonerjohn commented 5 years ago

Hey! Def would love to see it.

I have a working version with threads here: https://github.com/prisonerjohn/ofxAzureKinect/tree/feature/threads but was still testing it before merging into master.

I thought I did a sweep with re-allocating images every frame but guess I missed some :) If you can post that too it would be great.

Thanks!