Skip to content

Kinect for Windows – Details of API Changes from Beta2 to v1.0 (C#/VB)

February 1, 2012

[This article covers the details of changes of C#/VB accessible
APIs. Please ensure you read the code
migration post
as well.]

Namespace and Assembly Name Changes

Since our Beta 1 (June 2011) release of the Kinect for
Windows SDK , our C#/VB  accessible APIs have been provided via
Microsoft.Research.Kinect.dll. The public Types all were organized into 2 namespaces:
Microsoft.Research.Kinect.Nui and Microsoft.Research.Kinect.Audio.
Our team made the decision back in early 2011 that we would mark our beta
releases of APIs as “Research” to indicate the fact that this was an early
version of our APIs, created in concert with Microsoft Research.

On February 1, 2012, we released our final v1.0 SDK. In that
release, our DLL is now called Microsoft.Kinect.dll. All of our public APIs are
in the Microsoft.Kinect namespace.

Release

Assembly Names

Namespaces

Beta 2 (November 2011)

Microsoft.Research.Kinect.dll

Microsoft.Research.Kinect.Nui

Microsoft.Research.Kinect.Audio

V1.0 (Feb 2012)

Microsoft.Kinect.dll

Microsoft.Kinect

Runtime type (Rename to KinectSensor, refactoring)

Significant changes:

KINECTSENSOR API – SUMMARY OF API
CHANGES/REMOVALS/ADDITIONS

<NamespaceOldName=Microsoft.Research.Kinect.NuiName=Microsoft.Kinect>

    <TypeOldName=RuntimeName=KinectSensor>

        <MemberOldName=KinectsName=KinectSensors />

        <MemberOldName=InitializeName=Start />

        <MemberOldName=UninitializeName=Stop />

        <MemberName=DisposeAdded=True />

 

        <MemberOldName=VideoStreamName=ColorStream />

        <MemberOldName=VideoFrameReadyName=ColorFrameReady />

 

        <MemberOldName=SkeletonEngine
Name=SkeletonStream />

 

        <MemberName=AllFramesReady
Added=True />

 

        <MemberName=InstanceIndex
Removed=True />

        <MemberOldName=InstanceNameName=DeviceConnectionId />

        <MemberName=UniqueKinectId
Added=True />

 

        <MemberName=NuiCameraRemoved=True/>

        <MemberOldName=ElevationMaximumName=MaxElevationAngleMovedFrom=Camera />

        <MemberOldName=ElevationMinimumName=MinElevationAngleMovedFrom=Camera />

        <MemberName=ElevationAngle
MovedFrom=Camera />

 

        <MemberName=MapDepthFrameToColorFrameAdded=True />

        <MemberName=MapDepthToColorImagePointAdded=True />

        <MemberName=MapDepthToSkeletonPointAdded=True />

        <MemberName=MapSkeletonPointToDepthAdded=True />

        <MemberName=MapSkeletonPointToColorAdded=True />

    </Type>

    <TypeName=RuntimeOptionsRemoved=TrueMessage=Enable the streams from
the KinectSensor class.
/>

    <TypeOldName=KinectDeviceCollectionName=KinectSensorCollection>

        <MemberName=DisposeAdded=True />

    </Type>

    <TypeName=StatusChangedEventArgs>

        <MemberOldName=KinectRuntime
Name=Sensor />

    </Type>

    <TypeName=CameraRemoved=True>

        <MemberOldName=GetColorPixelCoordinatesFromDepthPixelName=MapToColorPixelMovedTo=DepthImageFrame />

        <MemberOldName=ElevationMaximumName=MaxElevationAngleMovedTo=KinectSensor />

        <MemberOldName=ElevationMinimumName=MinElevationAngleMovedTo=KinectSensor />

        <MemberName=ElevationAngle
MovedTo=KinectSensor />

    </Type>

    <TypeName=KinectStatus>

        <MemberName=UndefinedAdded=True />

        <MemberName=InitializingAdded=True />

        <MemberName=DeviceNotGenuineAdded=True />

        <MemberName=DeviceNotSupportedAdded=True />

        <MemberName=InsufficientBandwidthAdded=True />

    </Type>

</Namespace>

KinectSensor discovery

In beta2 (November 2011), we introduced a KinectSensors property on the Runtime object. We also
introduced a StatusChanged event.

In v1 (Feb 2012), those continue to be the key concepts to
understand when your program needs to work with 1 or more sensors.

It is critical that Kinect-enabled applications can deal
appropriately with the situations that users will hit with their application
(no Kinect sensor connected to computer, Kinect sensor is not powered by A/C
power, insufficient USB bandwidth, etc…)

Please read the documentation under “Programming
Guide/Kinect Sensor/Kinect-Enabled Application”:

Relevant samples (installed with SDK):

  • ShapeGame (C#/WPF) – KinectSensorChooser component
  • KinectAudioDemo (C#/WPF) – KinectSensorChooser component
  • KinectExplorer (C#/WPF)
  • SkeletonViewer (C++/Direct2D+GDI)

KinectSensor
initialization

Our beta APIs had a set of hard to understand and discover
API calls to configure the services you needed to get from the sensor. We
worked to make this part of our API more approachable. Our design goals were:

  • Enable a developer to ask once, not several
    times for a feature.
  • Valid settings are determinable via intellisense/compiling, not just runtime errors
  • Good default behavior.
  • Dynamic changing of any setting over time.

OLD CODE

EQUIVALENT NEW CODE

runtime.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);

runtime.VideoStream.Open(ImageStreamType.Video, 2,
ImageResolution.Resolution640x480, ImageType.Color);

runtime.DepthStream.Open(ImageStreamType.Depth, 2,
ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex);

kinectSensor.ColorStream.Enable();

kinectSensor.DepthStream.Enable();

kinectSensor.SkeletonStream.Enable();

kinectSensor.Start();

The old way doesn’t meet
many of our design goals for Initialization:

You needed to ask twice – once in Init() and once in Open().

  • Runtime errors were often are raised.
  • We had poor defaults; you had to ask for every setting.
  • We didn’t expose r/w properties for most of those settings, so you
    needed to re-init() and/or re-open() to set them to different values.
     

The ColorImageStream, DepthImageStream,
and SkeletonStream types also have ways to tweak
their behavior. Enable has some optional parameters, and those stream types
have several r/w properties as well.

Types/APIs to explore: KinectSensor, ColorImageStream, DepthImageStream,
SkeletonStream.

KinectSensor uninitialize

OLD CODE

NEW CODE

runtime.Uninitialize();

kinectSensor.Stop();

ColorImage API changes

Significant changes:

  • Reorganization of colorImage
    data. There is no longer a PlanarImage class.
  • Developer is now responsible for own allocations
    of pixelData variables and copying pixelData to that storage. (Color pixelData
    is still a byte array with same layout as beta2.)
  • This enables the Kinect Runtime to better reuse
    resources if an application’s data processing falls behind.
  • Availability of colorImage
    data during ColorFrameReady or AllFramesReady
    events. (AllFramesReady gives matching color, depth
    and/or skeleton frames.)

Relevant samples (installed with SDK):

  • KinectExplorer (C#/WPF) – KinectColorViewer component
  • SkeletonViewer (C++/Direct2D+GDI)
  • ShapeGame (C#/WPF) – KinectColorViewer component

COLORIMAGE API – SUMMARY OF
API CHANGES/REMOVALS/ADDITIONS

<TypeName=ColorImageStreamAdded=True>

    <MemberOldName=GetNextFrameName=OpenNextFrame />

    <MemberName=DisableAdded=True />

    <MemberOldName=OpenName=Enable />

    <MemberName=StreamTypeRemoved=True />

    <MemberName=ResolutionRemoved=True />

    <MemberName=TypeRemoved=True />

    <MemberOldName=HeightName=FrameHeight />

    <MemberOldName=WidthName=FrameWidth />

    <MemberName=CreateCompatibleImageFrameRemoved=True />

</Type>

<TypeName=ImageFrameReadyEventArgsRemoved=TrueMessage=Use ColorImageFrameReadyEventArgs or DepthImageFrameReadyEventArgs
instead of the now removed ImageFrameReadyEventArgs
>

</Type>

<TypeName=ColorImageFrameReadyEventArgsAdded=True>

    <MemberOldName=ImageFrameName=OpenColorImageFrame />

</Type>

<TypeName=ColorImageFrameAdded=True>

    <MemberName=TypeRemoved=True />

    <MemberName=ResolutionRemoved=True />

    <MemberName=ImageRemoved=True />

    <MemberName=ViewAreaRemoved=True />

    <MemberName=ImageFrameRemoved=True />

    <MemberName=BytesPerPixelMovedFrom=PlanarImage />

    <MemberName=HeightMovedFrom=PlanarImage />

    <MemberName=WidthMovedFrom=PlanarImage />

    <MemberOldName=BitsName=PixelDataMovedFrom=PlanarImage />

    <MemberName=CopyPixelDataTo />

    <MemberName=SourceStreamRemoved=True />

    <MemberName=PixelDataRemoved=TrueMessage=use CopyPixelDataTo(…)/>

    <MemberName=DisposeAdded=True />

</Type>

<TypeName=PlanarImageRemoved=TrueMessage=Data moved to ColorImageFrame/DepthImageFrame
/>

OLD CODE

runtime.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

 

runtime.VideoFrameReady += new
EventHandler<ImageFrameReadyEventArgs>(ColorImageReady);

 

void ColorImageReady(object sender, ImageFrameReadyEventArgs e)

{

    PlanarImage planarImage
= e.ImageFrame.Image;

 

    // DISPLAY OR PROCESS IMAGE DATA IN planarImage HERE

}

 

NEW CODE

kinectSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);

 

kinectSensor.ColorFrameReady += new
EventHandler<ColorImageFrameReadyEventArgs>(ColorImageReady);

byte[] pixelData;

 

void ColorImageReady(object sender, ColorImageFrameReadyEventArgs e)

{

    bool receivedData
= false;

    using (ColorImageFrame colorImageFrame = e.OpenColorImageFrame())

    {

        if (colorImageFrame != null)

        {

            if
(pixelData == null)
//allocate the first time

            {

                pixelData
= new byte[colorImageFrame.PixelDataLength];

            }

            colorImageFrame.CopyPixelDataTo(pixelData);

            receivedData
= true;

        }

        else

        {

            // apps
processing of image data is taking too long, it got
more than 2 frames behind.

            // the
data is no longer avabilable.

        }

    }

    if (receivedData)

    {

        // DISPLAY
OR PROCESS IMAGE DATA IN pixelData HERE

    }

}

 

DepthImage API changes

Significant changes:

  • Reorganization of depthImage data. There is no longer a PlanarImage class.
  • DepthPixel data is now a short[], instead of a byte[]. (Still 2 bytes of data representing each pixel.)
  • DepthPixel bit layout is now consistent, regardless if you have opted for Depth+Player or just Depth.
  • There is no longer a need to ask for Depth+Player or Depth. If the SkeletonStream is enabled, you get Depth+Player.
  • Developer is now responsible for own allocations of pixelData variables and copying pixelData to that storage.

This enables the Kinect Runtime to better reuse resources if an application’s data processing falls behind.

  • Availability of depthImage data during DepthFrameReady or AllFramesReady
    events. (AllFramesReady gives matching color, depth and/or skeleton frames.)

Relevant samples (installed with SDK):

    • KinectExplorer (C#/WPF) – KinectDepthViewer component
    • SkeletonViewer (C++/Direct2D+GDI)

DEPTHIMAGE API – SUMMARY OF
API CHANGES/REMOVALS/ADDITIONS

<TypeName=ImageFrameReadyEventArgsRemoved=TrueMessage=Use ColorImageFrameReadyEventArgs or DepthImageFrameReadyEventArgs
instead of the now removed ImageFrameReadyEventArgs
>

</Type>

<TypeName=DepthImageStreamAdded=True>

    <MemberOldName=GetNextFrameName=OpenNextFrame />

    <MemberName=IsTooFarRangeEnabled  Added=True/>

    <MemberName=DisableAdded=True />

    <MemberOldName=OpenName=Enable />

    <MemberName=StreamTypeRemoved=True />

    <MemberName=ResolutionRemoved=True />

    <MemberName=TypeRemoved=True />

    <MemberOldName=HeightName=FrameHeight />

    <MemberOldName=WidthName=FrameWidth />

    <MemberName=CreateCompatibleImageFrameRemoved=True />

</Type>

<TypeName=DepthImageFrameReadyEventArgsAdded=True>

    <MemberOldName=ImageFrameName=OpenDepthImageFrame />

</Type>

<TypeName=DepthImageFrameAdded=True>

    <MemberOldName=GetColorPixelCoordinatesFromDepthPixelName=MapToColorImagePointMovedFrom=DepthImageFrame />

    <MemberOldName=SkeletonToDepthImageName=MapFromSkeletonPointMovedFrom=SkeletonStream />

    <MemberOldName=DepthImageToSkeletonName=MapToSkeletonPointMovedFrom=SkeletonStream />

    <MemberName=PlayerIndexBitmaskAdded=True />

    <MemberName=PlayerIndexBitmaskWidthAdded=True />

</Type>

<TypeName=PlanarImageRemoved=TrueMessage=Data moved to ColorImageFrame/DepthImageFrame
/>

<TypeName=ImageDigitalZoomRemoved=True />

<TypeName=ImageStreamTypeRemoved=True />

<TypeName=ImageTypeRemoved=True />

<TypeName=ImageResolutionRemoved=True />

<TypeName=PlanarImageRemoved=TrueMessage=Data moved to ColorImageFrame/DepthImageFrame
/>

<TypeName=ImageViewArea
Removed=True />

<TypeName=DepthImageFormat  Added=True/>

<TypeName=DepthRange  Added=True/>

<TypeName=DepthImagePointAdded=True />

<TypeName=DepthImagePointFloatAdded=True />

OLD CODE

runtime.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240,

                     ImageType.DepthAndPlayerIndex);

 

runtime.DepthFrameReady += new
EventHandler<ImageFrameReadyEventArgs>(DepthImageReady);

 

private void
DepthImageReady(object
sender, ImageFrameReadyEventArgs
e)

{

    PlanarImage planarImage
= e.ImageFrame.Image;

 

    // DISPLAY OR
PROCESS IMAGE DATA IN pixelData HERE

}

NEW CODE

kinectSensor.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);

 

kinectSensor.DepthFrameReady += new
EventHandler<DepthImageFrameReadyEventArgs>(DepthImageReady);

short[] pixelData;

 

private void
DepthImageReady(object
sender, DepthImageFrameReadyEventArgs
e)

{

    bool receivedData
= false;

    using (DepthImageFrame depthImageFrame = e.OpenDepthImageFrame())

    {

        if (depthImageFrame != null)

        {

            if (pixelData == null) //allocate the first time

            {

                pixelData
= new short[depthImageFrame.PixelDataLength];

            }

            depthImageFrame.CopyPixelDataTo(pixelData);

            receivedData
= true;

        }

        else

        {

            // apps
processing of image data took too long; it got more than 2 frames behind.

            // the
data is no longer avabilable.

        }

    }

    if (receivedData)

    {

        // DISPLAY
OR PROCESS IMAGE DATA IN pixelData HERE

    }

}

 

Skeleton API improvements

Significant changes:

  • Renamed SkeletonEngine -> SkeletonStream
  • Renamed SkeletonData -> Skeleton
  • Renamed JointID -> Joint
  • Renamed JointsCollection -> JointCollection
  • Renamed Vector -> SkeletonPoint
  • Renamed SkeletonQuality -> FrameEdges
  • Developer is now responsible for own allocations of skeleton array variables and copying skeletons to that storage.

This enables the Kinect Runtime to better reuse
resources if an application’s data processing falls behind.

  • Availability of skeleton data during SkeletonFrameReady or AllFramesReady
    events. (AllFramesReady gives matching color, depth
    and/or skeleton frames.)
  • New SkeletonStream.AppChoosesSkeletons  property + ChooseSkeletons() methods.

Relevant samples (installed with SDK):

  • KinectExplorer (C#/WPF) – KinectSkeletalViewer component
  • SkeletonViewer (C++/Direct2D+GDI)
  • ShapeGame (C#/WPF)

SKELETON API – SUMMARY OF API
CHANGES/REMOVALS/ADDITIONS

<TypeOldName=SkeletonEngine
Name=SkeletonStream>

    <MemberName=DisableAdded=True />

    <MemberName=EnableAdded=True />

    <MemberName=ChooseSkeletonsAdded=True />

    <MemberOldName=GetNextFrameName=OpenNextFrame />

    <MemberName=DepthImageToSkeletonMovedTo=DepthImageFrame />

    <MemberName=SkeletonToDepthImageMovedTo=DepthImageFrame />

</Type>

<TypeName=SkeletonFrameReadyEventArgs>

    <MemberOldName=SkeletonFrame
Name=OpenSkeletonFrame />

</Type>

<TypeName=SkeletonFrame>

    <MemberOldName=TimeStampName=Timestamp />

    <MemberOldName=SkeletonsName=CopySkeletonDataTo />

    <MemberName=DisposeAdded=True />

    <MemberName=QualityRemoved=True />

</Type>

<TypeOldName=SkeletonDataName=Skeleton >

    <MemberOldName=TrackingIDName=TrackingId />


<
MemberName=CountRemoved=True />

</Type>

<TypeName=JointTypeAdded=True/>

<TypeOldName=JointIDName=Joint>

    <MemberOldName=IDName=JointType />

    <MemberOldName=VectorName=Position />

    <MemberName=ParentRemoved=True />

</Type>

<TypeOldName=JointsCollectionName=JointCollection />

<TypeOldName=VectorName=SkeletonPoint>

    <MemberName=WRemoved=True />

</Type>

<TypeOldName=SkeletonQualityName=FrameEdges>

    <MemberOldName=ClippedLeftName=Left />

    <MemberOldName=ClippedTopName=Top />

    <MemberOldName=ClippedRightName=Right />

    <MemberOldName=ClippedBottom
Name=Bottom />

    <MemberName=NoneAdded=True />

</Type>

<TypeName=SkeletonFrameQualityRemoved=True />

OLD CODE

runtime.SkeletonFrameReady += new
EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

 

private void
nui_SkeletonFrameReady(object
sender, SkeletonFrameReadyEventArgs
e)

{

    SkeletonFrame skeletonFrame
= e.SkeletonFrame;

 

}

 

NEW CODE

kinectSensor.SkeletonFrameReady += new
EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

 

Skeleton[] skeletons;

 

private void
nui_SkeletonFrameReady(object
sender, SkeletonFrameReadyEventArgs
e)

{

    bool receivedData
= false;

    using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())

    {

        if (skeletonFrame != null)

        {

            if
(skeletons == null) //allocate
the first time

            {

                skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];

            }

            receivedData
= true;

        }

        else

        {

            // apps
processing of skeleton data took too long; it got more than 2 frames behind.

            // the
data is no longer avabilable.

        }

    }

    if (receivedData)

    {

        // DISPLAY
OR PROCESS IMAGE DATA IN skeletons HERE

    }

}

 

Mapping API improvements (Skeleton
-> Depth, Depth -> Color)

Significant changes:

  • Moved these members to DepthImageFrame and KinectSensor
  • Added a new “entire frame” instead of per pixel function. (KinectSensor.MapDepthFrameToColorFrame)
  • Added a new Skeleton to Color method, which is similar to calling SkeletonToDepth and then DepthToColor.
  • The DepthImageFrame versions of these methods take fewer parameter, since
    it has the appropriate depthImage.
  • New return types: SkeletonPoint (replacing Vector) and DepthImagePoint (replacing 2 “out” parameters).

Relevant samples (installed with SDK):

  • KinectExplorer (C#/WPF) –KinectSkeletalViewer component
  • SkeletonViewer (C++/Direct2D+GDI)

OLD APIs

public class Camera
{
    public void GetColorPixelCoordinatesFromDepthPixel(ImageResolution

colorResolution, ImageViewArea
viewArea, int
depthX, int
depthY, short depthValue,
out int
colorX,
out int
colorY);

}
 
publicclass SkeletonEngine
{
    public Vector DepthImageToSkeleton(float depthX, float depthY, short depthValue);
    public void SkeletonToDepthImage(Vector point, out float depthX, out float depthY);
    public void SkeletonToDepthImage(Vector point, out float depthX, out float depthY, out short depthValue);
}

 

NEW APIs

publicsealedclass DepthImageFrame : ImageFrame
{
    public DepthImagePoint MapFromSkeletonPoint(SkeletonPoint

skeletonPoint);

    public ColorImagePoint MapToColorImagePoint(int depthX, int depthY, ColorImageFormat colorImageFormat);
    public SkeletonPoint MapToSkeletonPoint(int depthX, int depthY);
}
publicsealedclass KinectSensor : IDisposable
{
    public void MapDepthFrameToColorFrame(DepthImageFormat depthImageFormat, short[] depthPixelData, ColorImageFormat colorImageFormat, ColorImagePoint[] colorCoordinates);
    public ColorImagePoint MapDepthToColorImagePoint(DepthImageFormat depthImageFormat, int depthX, int depthY, short depthPixelValue, ColorImageFormat colorImageFormat);
    public SkeletonPoint MapDepthToSkeletonPoint(DepthImageFormat depthImageFormat, int depthX, int depthY, short depthPixelValue);
    public ColorImagePoint MapSkeletonPointToColor(SkeletonPoint skeletonPoint, ColorImageFormat colorImageFormat);
    public DepthImagePoint MapSkeletonPointToDepth(SkeletonPoint skeletonPoint, DepthImageFormat depthImageFormat);
}

Audio API improvements

Significant changes:

Relevant samples (installed with SDK):

AUDIO API – SUMMARY OF API CHANGES/REMOVALS/ADDITIONS

<Namespace OldName=Microsoft.Research.Kinect.Audio
Name=Microsoft.Kinect>

    <Type Name=AudioDeviceInfo Removed=True />

    <Type Name=KinectAudioSource>

        <Member Name=FindCaptureDevices Removed=True />

        <Member Name=RetrieveTsStats Removed=True />

        <Member Name=QualityMetrics Removed=True />

        <Member Name=DevicePairGuid Removed=True />

        <Member Name=KinectAudioSource Removed=True />

        <Member OldName=AutomaticGainControl Name=AutomaticGainControlEnabled />

        <Member OldName=SoundSourcePosition Name=SoundSourceAngle Message=Now using degrees, instead of Radians./>

        <Member OldName=SoundSourcePositionConfidence Name=SoundSourceAngleConfidence />

        <Member OldName=MicArrayMode Name=BeamAngleMode />

        <Member OldName=MicArrayBeamAngle Name=ManualBeamAngle />

        <Member OldName=BeamChanged Name=BeamAngleChanged />

        <Member OldName=SpeakerIndex Name=EchoCancellationSpeakerIndex Message=Automatically set to default Speaker on
PC now. />

        <Member Name=AcousticEchoSuppression
Removed=True Message=Replaced by setting kinectAudioSource.EchoCancellationMode
= EchoCancellationMode.CancellationAndSuppression />

        <Member Name=CenterClip Removed=True/>

        <Member Name=EchoLength Removed=True/>

        <Member Name=FeatureMode Removed=True Message=Just remove the line of code that set FeatureMode. It was useless./>

        <Member Name=FrameSize Removed=True/>

        <Member Name=GainBounder Removed=True/>

        <Member Name=MicArrayPreprocess Removed=True/>

        <Member Name=MicrophoneIndex Removed=True/>

        <Member Name=NoiseFill Removed=True/>

        <Member Name=SourceMode Removed=True/>

        <Member Name=VoiceActivityDetector Removed=True/>

        <Member OldName=SystemMode Name=EchoCancellationMode Message=For ArrayOnly,
use EchoCancellationMode.None. For ArrayAndEchoCancellation, use EchoCancellationMode.CancellationOnly. />

        <Member Name=Dispose Removed=True
/>

    </Type>

    <Type Name=MicArrayMode Removed=True />

    <Type Name=SystemMode Removed=True Message=Use EchoCancellationMode
property instead. />

    <Type OldName=BeamChangedEventArgs Name=BeamAngleChangedEventArgs/>

    <Type Name=SoundSourceAngleChangedEventArgs Added=True />

    <Type Name=EchoCancellationMode Added=True />

    <Type Name=BeamAngleMode Added=True />

</Namespace>

 

OLD
CODE

KinectAudioSource audioSource
=
newKinectAudioSource();

audioSource.SystemMode = SystemMode.OptibeamArrayOnly;

audioSource.FeatureMode = true;

audioSource.AutomaticGainControl = false;

audioSource.MicArrayMode = MicArrayMode.MicArrayAdaptiveBeam;

var kinectStream
= audioSource.Start();

NEW
CODE

KinectAudioSource audioSource = kinectSensor.AudioSource;

audioSource.EchoCancellationMode = EchoCancellationMode.CancellationOnly;

audioSource.AutomaticGainControlEnabled = false;

audioSource.BeamAngleMode = BeamAngleMode.Adaptive;

var audioStream
= audioSource.Start();

Speech API improvements

Significant changes:

Relevant samples (installed with SDK):

From → API, Kinect

12 Comments
  1. Phil permalink

    Your old code/equivalent new code is unreadable. I can’t see more than 20 characters of the new code.

  2. Jamie permalink

    Would you be able to post VB code for the skelton sample project using the new API?

  3. @Phil: if you have a Touch Pad or Mouse with Horizontal Scrolling, you can scroll to see more of the code.
    Alternatively, you can just select the code from start to finish then copy-paste to notepad to see the whole code.

    This just because a CSS glitch causing the browser to not show a scroll bar :S

  4. Fil permalink

    hey, could you do a simple tutorial for beginners with this new API?
    I can’t found tutorials in internet for this new version.

    thanks

  5. Do you know where I can find the KinectExplorer sample in VB?

  6. jeffery permalink

    Great but how do i capture frames one by one like a picture in code? Thats what im trying to do but I think im doing something wrong because I have the depth stream like above in code but its not working and the depth stream displays correctly on image control if I remove my section of code from received data.
    Im using gifbitmap encoder.

  7. jeffery permalink

    Jamie take a look at kinect mouse for skeleton tracking because they do skeleton tracking in their sample code and its in v1. Remember to remove readme.txt file because it cause you to not be able to compile the project.

  8. Kendrick permalink

    hi everyone!

    Sorry for my bad English.

    void SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
    {
    if (e.SkeletonFrame.Skeletons.Count() == 0) return;

    SkeletonFrame skeletonSet = e.SkeletonFrame;

    SkeletonData firstPerson = (from s in skeletonSet.Skeletons
    where s.TrackingState == SkeletonTrackingState.Tracked
    orderby s.UserIndex descending
    select s).FirstOrDefault();
    if (firstPerson == null) return;

    JointsCollection joints = firstPerson.Joints;

    Joint rightHand = joints[JointID.HandRight];
    Joint leftHand = joints[JointID.HandLeft];

    //find which hand is being used for cursor – is the user right handed or left handed?
    var joinCursorHand = (rightHand.Position.Y > leftHand.Position.Y)
    ? rightHand
    : leftHand;

    float posX = joinCursorHand.ScaleTo((int)SystemParameters.PrimaryScreenWidth, (int)SystemParameters.PrimaryScreenHeight).Position.X;
    float posY = joinCursorHand.ScaleTo((int)SystemParameters.PrimaryScreenWidth, (int)SystemParameters.PrimaryScreenHeight).Position.Y;

    Joint scaledCursorJoint = new Joint
    {
    TrackingState = JointTrackingState.Tracked,
    Position = new Microsoft.Research.Kinect.Nui.Vector
    {
    X = posX,
    Y = posY,
    Z = joinCursorHand.Position.Z
    }
    };
    OnButtonLocationChanged(kinectButton, buttons, (int)scaledCursorJoint.Position.X, (int)scaledCursorJoint.Position.Y);
    }

  9. Kendrick permalink

    would like u guys, anyone know how to convert these code from BETA 2 to SDK V1.

    thanks in advance!

  10. Alex permalink

    Hi Rob,
    I’m rather new at this… I was using the beta version with the runtime class in a .NET environment (runtime.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor). We have now bought a Kinect for Windows and I want to use the new SDK driver. The question is that when I select de KinectSensor class I’m told there is not a “public constructor” and I receive an error 1172. I guess I need that public constructor so as I can use the members Start, Stop, VideoStream, etc… What should I do?

Trackbacks & Pingbacks

  1. Windows Client Developer Roundup 087 for 2/9/2012 - Pete Brown's 10rem.net
  2. Kinect Programming Try-out | Interactive Performance and Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: