如何用Kinect在真实人物上绘制2D衬衫 [英] How Do I Map 2D Shirt On Real Person With Kinect

查看:98
本文介绍了如何用Kinect在真实人物上绘制2D衬衫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将2d衬衫图像映射到kinect相机拍摄的真实人物上 -



我尝试使用此代码进行映射 -



我的xaml代码是 -



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-

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

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.

推荐答案

这篇关于如何用Kinect在真实人物上绘制2D衬衫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆