none
Replacing Obsolete MapSkeletonPointToDepth with CoordinateMapper.MapSkeletonPointToDepthPoint RRS feed

  • Question

  • Hi all

    I am quite new to c# and I am following an old kinect programming book (2012), trying to create a view of the skeleton tracker

    I have one warning that will not let me build and run the project. The code line is

    DepthImagePoint point = this.KinectDevice.MapSkeletonPointToDepth(joint.Position, this.KinectDevice.DepthStream.Format);

    'This method is obsolete replace with:'

    Microsoft.Kinect.CoordinateMapper.MapSkeletonPointToDepthPoint

    So after looking up CoordinateMapper and MapSkeletonPointToDepthPoint

    http://msdn.microsoft.com/en-us/library/microsoft.kinect.coordinatemapper.aspx and http://msdn.microsoft.com/en-us/library/jj883696.aspx

    I created this line of code to replace the old one:

    DepthImagePoint point = this.CoordinateMapper.MapSkeletonPointToDepthPoint( joint.Position, this.KinectDevice.DepthStream.Format);


    But now I get an error under 'CoordinateMapper' saying: 

    'ColourStreamTest.MainWindow' does not contain a definition for 'CoordinateMapper' and no extension method 'CoordinateMapper' accepting a first argument of type 'ColourStreamTest.MainWindow' could be found (are you missing a using directive or an assembly reference?)

    I am including the Microsoft.Kinect.dll reference, which should include the CoordinateMapper Class, I have even tried to create a new Coordinate mapper object but that throws up more errors


    Can anybody help me?

     
    Wednesday, April 16, 2014 1:26 PM

Answers

  • Elliott,

    You don't have an instance of Microsoft.Kinect.CoordinateMapper named CoordinateMapper defined.

    Based on your previcous code, just try this instead (where KinectDevice is an instance of the KinectSensor type):

    this.KinectDevice.CoordinateMapper.MapSkeletonPointToDepthPoint

    James


    James Ashley - Presentation Layer Architect at Razorfish Emerging Experiences
    jamesashley@imaginativeuniversal.com
    www.imaginativeuniversal.com www.emergingexperiences.com

    Wednesday, April 16, 2014 3:38 PM