Tom Kerkhove, Kinect MVP, is back, this comparing two different Frame Readers...
In a previous post I talked about how you can implement the basic data streams into your application. Next to that I also explained the new streaming model they introduced with the frame readers for each type of stream, f.e. ColorSourceFrameReader.
With the new model came an equivalent to the AllFramesReady event called a MultiSourceFrameReader that is capable of reading on several different data streams at once.
In this post I will go deeper in the differences between the MultiSourceFrameReader and the single SourceFrameReaders.
I am bound to the Kinect for Windows Developer Program and can not share the new SDK/DLL.
“This is preliminary software and/or hardware and APIs are preliminary and subject to change”.
MultiSourceFrameReader vs XSourceFrameReader
In my basics overview I visualized the camera with a Body overlay that showed a couple of joints by using code that is similar to the one below -
In the first generation each frame had a property FrameNumber that you could use to determine if both data frames are in sync. In the second generation this has been replaced with a RelativeTime that indicates the correlation between frames.
Kinect v1 offered a more efficient way that does this for use by using the AllFramesReady-event that includes all the enabled stream data, I’m glad to tell you that this concept is also available in the new source/reader concept by using a MultiSourceFrameReader.
We can easily replace our two XSourceFrameReader with one MultiSourceFrameReader where we specify the data streams by using the FrameSourceTypes-enumeration. The rest of the processing is pretty much the same – You listen to the MultiSourceFrameArrived-event, you retrieve the MultiSourceFrameReference and the MultiSourceFrame. Now with the MultiSourceFrame you are able to retrieve the corresponding frames for your selected FrameSourceTypes.
Here is an example on how you can use a MultiSourceFrameReader –
You should try to use the MultipleSourceFrameReader when your data should be synced or use the RelativeTime-property to check the correlation.
If this is not required you can still use the XSourceFrameReader for that specific data streams.
You can also use a combination of several MultiSourceFrameReader & XSourceFrameReaders depending on your requirements.
Other posts from Tom you might also find interesting;
- Kinect to a Quad... Kinecting AR Drone series start
- Kinecting AR Drone - Part 1
- "Exploring the Kinect Developer Toolkit Browser"
- Kinect for Windows – What’s new, a view from a Kinect for Windows MVP
- Build on the Kinect for Windows v2
- Kinect Television - Putting the You in the TV...
- Getting down and dirty coding with the Kinect for Windows v2