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

Improved performance by using FrameArrived events to avoid busy waiting #57

Open
wants to merge 6 commits into
base: kinect2
Choose a base branch
from

Conversation

HenningJ
Copy link

Without this patch, the Kinect2 driver basically does busy waiting for new frames on three threads simultaneously, always taking all available CPU cycles.
With this patch, the three threads sleep until the Kinect SDK sends a FrameArrived event for the corresponding FrameReader, using up way less CPU cycles.

@HenningJ
Copy link
Author

I added another commit, with some speed improvements for the registration. It just avoids doing registration calculations on pixels with invalid depth. Those pixels are returned as (infinite, infinite) values from the coordinate mapper, and doing calculations on those seems to be quite slow

@mvm9289 interested? :-)

@mvm9289
Copy link

mvm9289 commented Jun 26, 2015

Hi @HenningJ, thanks for sharing your patch with the community :)! This change looks good to me! I'll merge it back into my own repo.

@HenningJ
Copy link
Author

HenningJ commented Jul 3, 2015

Some more stuff...mostly implemented mirroring (by just copying each line backwards instead of forwards) + some minor improvements.

90a41cc is because waiting 500 milliseconds before asking if the device is ready sometimes wasn't necessary, but sometimes wasn't enough. So rather than just increasing the 500 to 1000, I just ask every 100 ms, up to 1000 ms, and stopping as soon as the device is ready.

@mvm9289
Copy link

mvm9289 commented Jul 3, 2015

Yeah! That was one of the entries of my TODO list :)) Thanks for fixing it!!

Miguel.


  • Email: [email protected]
  • Phone number (Germany): +49 1764-7-314957
  • Phone number (Spain): +34 617-873-608
  • Phone number (US): +1 (408) 646-4533

On Fri, Jul 3, 2015 at 3:46 PM, Henning Jungkurth [email protected]
wrote:

Some more stuff...mostly implemented mirroring (by just copying each line
backwards instead of forwards) + some minor improvements.

90a41cc
90a41cc
is because waiting 500 milliseconds before asking if the device is ready
sometimes wasn't necessary, but sometimes wasn't enough. So rather than
just increasing the 500 to 1000, I just ask every 100 ms, up to 1000 ms,
and stopping as soon as the device is ready.


Reply to this email directly or view it on GitHub
#57 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants