Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to map 2d shirt image on real person captured by kinect camera-

I have tried mapping with this code-

My xaml code is-

XML
<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>



Code behind-

-In skeleton frame ready method-

C#
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);



        }



SQL
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.
Posted
Comments
Member 10466515 17-May-14 12:54pm    
Please help with this question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900