首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Kinect2.0骨架绘制-仅上半身;c#

Kinect2.0骨架绘制-仅上半身;c#
EN

Stack Overflow用户
提问于 2017-06-09 19:51:58
回答 0查看 644关注 0票数 1

我正在做一个使用kinect 2.0传感器的项目。

在用户上绘制骨架非常简单,但是如果只绘制某些部分,甚至绘制整个骨架,但如果身体的某些部分(脚,腿……)都在摄像头的视野范围之外,怎么不画呢?

我使用的是Vitruvius库和标准的kinect 2.0库。

代码语言:javascript
复制
 //depth
 using (var depthFrame = reference.DepthFrameReference.AcquireFrame())

 //Body index
 using (var bodyIndexFrame = reference.BodyIndexFrameReference.AcquireFrame())



 // Body
 using (var bodyframe = reference.BodyFrameReference.AcquireFrame())
 {
      var bodies = bodyframe.Bodies();
       ...
      _playersController.Update(bodies);
       ...
       Body body = bodies.Closest();
       viewer.Clear();
       viewer.DrawBody(body, 10.0, Brushes.Green, 10.0, Brushes.Green);
       ...
}

这就是我画身体的方式,它是有效的。如果我转到'DrawBody()‘定义,我得到这个:

代码语言:javascript
复制
public void DrawBody(Body body, double jointRadius, Brush jointBrush, double boneThickness, Brush boneBrush);

如果我转到body definition (这样我就可以选择要绘制的关节),我会发现:

代码语言:javascript
复制
//
    // Summary:
    //     Represents a single body.
    public sealed class Body
    {
        ~Body();

        //
        // Summary:
        //     Gets the number of joints in a body.
        public static int JointCount { get; }
        //
        // Summary:
        //     Gets the lean vector of the body.
        public PointF Lean { get; }
        //
        // Summary:
        //     Gets whether or not the body is restricted.
        public bool IsRestricted { get; }
        //
        // Summary:
        //     Gets whether or not the body is tracked.
        public bool IsTracked { get; }
        //
        // Summary:
        //     Gets the tracking ID for the body.
        public ulong TrackingId { get; }
        //
        // Summary:
        //     Gets the edges of the field of view that clip the body.
        public FrameEdges ClippedEdges { get; }
        //
        // Summary:
        //     Gets the status of the body's engagement. This API is not implemented in the
        //     Kinect for Windows v2 SDK. It is included to support cross-compilation with the
        //     Xbox SDK.
        [Obsolete("This API has been replaced by Microsoft.Kinect.Face", true)]
        public DetectionResult Engaged { get; }
        //
        // Summary:
        //     Gets the joint positions of the body.
        public IReadOnlyDictionary<JointType, Joint> Joints { get; }
        //
        // Summary:
        //     Gets the status of the body's right hand state.
        public HandState HandRightState { get; }
        //
        // Summary:
        //     Gets the confidence of the body's left hand state.
        public TrackingConfidence HandLeftConfidence { get; }
        //
        // Summary:
        //     Gets the status of the body's left hand state.
        public HandState HandLeftState { get; }
        //
        // Summary:
        //     Gets the status of the body's possible appearance characteristics. This API is
        //     not implemented in the Kinect for Windows v2 SDK and will always return null.
        //     It is included to support cross-compilation with the Xbox SDK.
        [Obsolete("This API has been replaced by Microsoft.Kinect.Face", true)]
        public IReadOnlyDictionary<Appearance, DetectionResult> Appearance { get; }
        //
        // Summary:
        //     Gets the status of the body's possible activities. This API is not implemented
        //     in the Kinect for Windows v2 SDK and will always return null. It is included
        //     to support cross-compilation with the Xbox SDK.
        [Obsolete("This API has been replaced by Microsoft.Kinect.Face", true)]
        public IReadOnlyDictionary<Activity, DetectionResult> Activities { get; }
        //
        // Summary:
        //     Gets the status of the body's possible expressions. This API is not implemented
        //     in the Kinect for Windows v2 SDK and will always return null. It is included
        //     to support cross-compilation with the Xbox SDK.
        [Obsolete("This API has been replaced by Microsoft.Kinect.Face", true)]
        public IReadOnlyDictionary<Expression, DetectionResult> Expressions { get; }
        //
        // Summary:
        //     Gets the joint orientations of the body.
        public IReadOnlyDictionary<JointType, JointOrientation> JointOrientations { get; }
        //
        // Summary:
        //     Gets the tracking state for the body lean.
        public TrackingState LeanTrackingState { get; }
        //
        // Summary:
        //     Gets the confidence of the body's right hand state.
        public TrackingConfidence HandRightConfidence { get; }
    }

这真的没有什么帮助。它说在哪里画什么?我甚至可以只画某些部分吗?我看到一个人之前只画了上半身,但没有解释他是如何做到的。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44457092

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档