<Canvas > <Image x:Name="VideoControl" ></Image> <StackPanel Canvas.Left="0" Canvas.Top="0" Name="shirt"> <Image Source="C:\Users\398780\Desktop\NikitaKinectLearn\WearHatNikita\WearHatNikita\Images\shirt2D.jpeg" Height="300" Width="300"></Image> </StackPanel> </Canvas>
if(firstSkeleton.Joints[JointType.ShoulderLeft].TrackingState==JointTrackingState.Tracked && firstSkeleton.Joints[JointType.ShoulderRight].TrackingState==JointTrackingState.Tracked) { MapJointsWithUIElement(firstSkeleton); } private void MapJointsWithUIElement(Skeleton skeleton) { Joint shoulderleftJoint=skeleton.Joints[JointType.ShoulderLeft]; var mappedPointshoulderLeft = this.sensor.CoordinateMapper.MapSkeletonPointToColorPoint(shoulderleftJoint.Position, this.sensor.ColorStream.Format); Canvas.SetLeft(shirt, mappedPointshoulderLeft.X - shirt.ActualWidth / 2); Canvas.SetTop(shirt, mappedPointshoulderLeft.Y - shirt.ActualHeight / 2); }
By this code-the shirt image is mapped to left shoulder,now what i want is- To map left shoulder of shirt with person's left shoulder and the same should happen with right shoulder also. How to increase or decrease the size of shirt depending upon the skeleton tracked by kinect so that perfect mapping of 2d shirt with human is done. Please tell how to implement this.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)