Reputation: 21
Can someone provide examples of how to run MS Kinect Color, Skeleton and Depth streams in different threads ? I have searched the internet but not able to find anything. Thanks in advance.
Upvotes: 2
Views: 475
Reputation: 10624
The KinectExplorer
example in the Microsoft Kinect Developer Toolkit provides a KinectDepthViewer
control that shows how to process the depth data in a different thread -- the DepthColorizer
class. The concepts can be adapted to process skeleton data as well.
You don't explain why you are wanting to run these on different threads, so it is unclear why you would need to do so. All the data is gathered off the UI thread, in their own process already. It is when you want to work with them on the UI thread that matters...
The color stream is just an RGB stream. There may be some processing you need to do to this image (e.g., skinning and face tracking), but generally it is not used as much as the others. The only processing generally required is to copy the bits from the stream into an Image for display, which has to be done on the UI thread anyway.
If you wish to color the depth stream for any reason, doing so on a non-UI thread is beneficial. If you're doing some special processing on it, that could be done on a non-UI thread too. The above example code could be easily adapted.
The skeleton stream already requires the most effort by the CPU, but all that effort is already done for you away from the UI. Once you have a chance to touch it, the data is just a series of objects and arrays. I can't really see what you would need to do on a separate thread at this point.
If you explain what you are trying to accomplish the need for separate processing threads may be more clear.
Upvotes: 2