MapSkeletonPointToDepthPoint() public method

public MapSkeletonPointToDepthPoint ( Microsoft.Kinect.SkeletonPoint sp ) : DepthImagePoint
sp Microsoft.Kinect.SkeletonPoint
return DepthImagePoint
示例#1
0
        /// <summary>
        /// Computes the head circle in the depth image.
        /// </summary>
        /// <param name="skeleton"></param>
        /// <param name="mapper"></param>
        /// <returns></returns>
        public static FaceModel GetFaceModel(Skeleton skeleton, CoordinateConverter mapper)
        {
            var headJointPos        = GetJoint(skeleton, JointType.Head).Position;
            var shoulderCenterJoint = GetJoint(skeleton, JointType.ShoulderCenter);
            var headDepthPt         = mapper.MapSkeletonPointToDepthPoint(headJointPos);
            var shoulderDepthPt     = mapper.MapSkeletonPointToDepthPoint(shoulderCenterJoint.Position);
            var radius = Math.Abs(shoulderDepthPt.Y - headDepthPt.Y) / 2;

            return(new FaceModel(GeometryUtil.Midpoint(headDepthPt, shoulderDepthPt), radius));
        }
示例#2
0
 /// <summary>
 /// Computes the head circle in the depth image.
 /// </summary>
 /// <param name="skeleton"></param>
 /// <param name="mapper"></param>
 /// <returns></returns>
 public static FaceModel GetFaceModel(Skeleton skeleton, CoordinateConverter mapper)
 {
     var headJointPos = GetJoint(skeleton, JointType.Head).Position;
       var shoulderCenterJoint = GetJoint(skeleton, JointType.ShoulderCenter);
       var headDepthPt = mapper.MapSkeletonPointToDepthPoint(headJointPos);
       var shoulderDepthPt = mapper.MapSkeletonPointToDepthPoint(shoulderCenterJoint.Position);
       var radius = Math.Abs(shoulderDepthPt.Y - headDepthPt.Y) / 2;
       return new FaceModel(GeometryUtil.Midpoint(headDepthPt, shoulderDepthPt), radius);
 }