Reputation: 43
I am working on Kinect project for Blob detection using Kinect sdk 2.0.
After doing so much efforts to find reference tutorial for it, I found out following tutorial.
http://blogs.claritycon.com/blog/2012/11/blob-tracking-kinect-opencv-wpf/
The issue is that this example is built on Kinect sdk 1.8 . Because of that, some events and methods which are not supported in kinect sdk 2.0.
for eg. private void sensor_AllFramesReady(object sender, AllFramesReadyEventArgs e)
(Error:The type or namespace name AllFramesReadyEventArgs could not be found(are you missing a using directive or an assembley reference?))
I tried to find out those events and methods new name for kinect sdk 2.0 but I didn't get anything.
Upvotes: 1
Views: 95
Reputation: 176
You can use a different frame callback that listens to MultiSourceFrameReader
. This can receive BodyFrameType
, DepthFrameType
, ColorFrameType
, etc. simultaneously.
For example:
private void Reader_FrameArrived(object sender, MultiSourceFrameArrivedEventArgs e) {
using (BodyFrame bodyFrame = e.FrameReference.AcquireFrame().BodyFrameReference.AcquireFrame()) {
// do something
}
using (DepthFrame depthFrame = e.FrameReference.AcquireFrame().DepthFrameReference.AcquireFrame()) {
// do something
}
}
To add a frame to this callback, instantiate a MultiSourceFrameReader reader
object and do this:
this.reader.MultiSourceFrameArrived += Reader_FrameArrived;
Upvotes: 0