• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Kinect.SkeletonPoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Kinect.SkeletonPoint的典型用法代码示例。如果您正苦于以下问题:C# SkeletonPoint类的具体用法?C# SkeletonPoint怎么用?C# SkeletonPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SkeletonPoint类属于Microsoft.Kinect命名空间,在下文中一共展示了SkeletonPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GestureStatus

 /// <summary>
 /// Initializes a new Gesture Status.
 /// </summary>
 public GestureStatus()
 {
     this.isMakingAFast = false;
     this.startPoint = new SkeletonPoint();
     this.endPoint = new SkeletonPoint();
     this.headPoint = new SkeletonPoint();
 }
开发者ID:k19862217,项目名称:DioramaExhibitionSupportSystem,代码行数:10,代码来源:GestureStatus.cs


示例2: comparePoint

 public static bool comparePoint(SkeletonPoint a, SkeletonPoint b, float dif)
 {
     if (compareValue(a.X, b.X, dif) && compareValue(a.Y, b.Y, dif) && compareValue(a.Z, b.Z, dif))
         return true;
     else
         return false;
 }
开发者ID:kscat,项目名称:ECUSTkinect,代码行数:7,代码来源:App.xaml.cs


示例3: Test90DegreeAngle

        public void Test90DegreeAngle()
        {
            Joint vertex = new Joint();
            Joint[] otherJoints = new Joint[2];

            SkeletonPoint sp = new SkeletonPoint();
            sp.X = 0.0F;
            sp.Y = 0.0F;
            sp.Z = 0.0F;
            vertex.Position = sp;

            Joint joint1 = new Joint();
            SkeletonPoint point = new SkeletonPoint();
            point.X = 0.0F;
            point.Y = 1.0F;
            point.Z = 0.0F;
            joint1.Position = point;

            Joint joint2 = new Joint();
            SkeletonPoint point2 = new SkeletonPoint();
            point2.X = 1.0F;
            point2.Y = 0.0F;
            point2.Z = 0.0F;
            joint2.Position = point2;

            otherJoints[0] = joint1;
            otherJoints[1] = joint2;

            Assert.AreEqual(90, JointAnalyzer.findAngle(vertex,otherJoints), "Angle should be 90 degrees");
        }
开发者ID:slowbump,项目名称:KinectTherapyTest,代码行数:30,代码来源:JointAnalyzerTest.cs


示例4: vecSubt

 public static SkeletonPoint vecSubt(SkeletonPoint a, SkeletonPoint b)
 {
     a.X -= b.X;
     a.Y -= b.Y;
     a.Z -= b.Z;
     return a;
 }
开发者ID:Team694,项目名称:kinect-CAD,代码行数:7,代码来源:JointTracker.cs


示例5: Add

        public virtual void Add(SkeletonPoint position, KinectSensor sensor)
        {
            GesturePoint entity = new GesturePoint { Position = Vector.ToVector(position), Time = DateTime.Now };
            GestureEntities.Add(entity);
            if (GestureCanvas != null)
            {
                entity.DisplayEllipse = new Ellipse
                {
                    Width = 4,
                    Height = 4,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    StrokeThickness = 2.0,
                    Stroke = new SolidColorBrush(DisplayColor),
                    StrokeLineJoin = PenLineJoin.Round
                };

                Point point = Tools.Convert(sensor, position);
                float x = (float)(point.X * GestureCanvas.ActualWidth);
                float y = (float)(point.Y * GestureCanvas.ActualHeight);
                Canvas.SetLeft(entity.DisplayEllipse, x - entity.DisplayEllipse.Width / 2);
                Canvas.SetTop(entity.DisplayEllipse, y - entity.DisplayEllipse.Height / 2);
                GestureCanvas.Children.Add(entity.DisplayEllipse);
            }
            if (GestureEntities.Count > WindowSize)
            {
                GesturePoint entryToRemove = GestureEntities[0];
                if (GestureCanvas != null)
                {
                    GestureCanvas.Children.Remove(entryToRemove.DisplayEllipse);
                }
                GestureEntities.Remove(entryToRemove);
            }
            LookForGesture();
        }
开发者ID:gumacs92,项目名称:Szakdolgozat,代码行数:35,代码来源:GestureDetector.cs


示例6: vecMult

 public static SkeletonPoint vecMult(float coEffish, SkeletonPoint vec)
 {
     vec.X *= coEffish;
     vec.Y *= coEffish;
     vec.Z *= coEffish;
     return vec;
 }
开发者ID:Team694,项目名称:kinect-CAD,代码行数:7,代码来源:JointTracker.cs


示例7: averagePoint

 public static SkeletonPoint averagePoint(SkeletonPoint p1, int avgFactor)
 {
     p1.X = p1.X  / avgFactor;
     p1.Y = p1.Y  / avgFactor;
     p1.Z = p1.Z  / avgFactor;
     return p1;
 }
开发者ID:TheVerga,项目名称:NAOKinect,代码行数:7,代码来源:JointUtilities.cs


示例8: Update

        public void Update(SkeletonPoint position, int updateId, long timestamp)
        {
            // Movement magnitude gets scaled by this amount in order to get the current activity metric
            const double DeltaScalingFactor = 10.0;

            // Controls how quickly new values of the metric displace old values. 1.0 means that new values
            // for metric immediately replace old values, while smaller decay amounts mean that old metric
            // values influence the metric for a longer amount of time (i.e.: decay more slowly).
            const double ActivityDecay = 0.1;

            var delta = new SkeletonPoint
            {
                X = position.X - this.LastPosition.X,
                Y = position.Y - this.LastPosition.Y,
                Z = position.Z - this.LastPosition.Z
            };

            double deltaLengthSquared = (delta.X * delta.X) + (delta.Y * delta.Y) + (delta.Z * delta.Z);
            double newMetric = DeltaScalingFactor * Math.Sqrt(deltaLengthSquared);

            this.ActivityLevel = ((1.0 - ActivityDecay) * this.ActivityLevel) + (ActivityDecay * newMetric);

            bool newIsActive = this.ActivityLevel >= ActivityMetricThreshold;

            if (newIsActive != this.IsActive)
            {
                this.IsActive = newIsActive;
                this.StateTransitionTimestamp = timestamp;
            }

            this.LastPosition = position;
            this.LastUpdateId = updateId;
        }
开发者ID:fabiocasagrande,项目名称:Research_Project_Microsoft_Kinect_SDK1.8,代码行数:33,代码来源:UserActivityRecord.cs


示例9: AssignAnglesToSkeleton

        public void AssignAnglesToSkeleton(Skeleton skeleton)
        {
            Hashtable angles = getAllAngles();

            foreach (JointType key in angles.Keys)
            {
                List<double> anglesInDouble = (List<double>)angles[key];

                SkeletonPoint point = new SkeletonPoint();

                if (!double.IsNaN(anglesInDouble[0]))
                {
                    point.X = (int)anglesInDouble[0];
                }
                if (!double.IsNaN(anglesInDouble[1]))
                {
                    point.Y = (int)anglesInDouble[1];
                }
                if (!double.IsNaN(anglesInDouble[2]))
                {
                    point.Z = (int)anglesInDouble[2];
                }

                var joint = skeleton.Joints[key];
                joint.Position = point;
                skeleton.Joints[key] = joint;
            }
        }
开发者ID:12vidusha,项目名称:kinect-human-action-recognition,代码行数:28,代码来源:JointAnglesManager.cs


示例10: DoPan

        protected void DoPan(SkeletonPoint handPoint)
        {
            var mapExtentDeltaX = (_startExtent.XMax - _startExtent.XMin);
            var mapExtentDeltaY = (_startExtent.YMax - _startExtent.YMin);

            var relativeDeltaDistance = _startHandPoint.DistanceVectorFrom(handPoint, _map.ActualWidth, _map.ActualHeight);
            var deltaX = relativeDeltaDistance.X * mapExtentDeltaX;
            var deltaY = relativeDeltaDistance.Y * mapExtentDeltaY;

            var nextExtent = new Envelope
                                 {
                                     XMin = _startExtent.XMin + deltaX,
                                     XMax = _startExtent.XMax + deltaX,
                                     YMin = _startExtent.YMin - deltaY,
                                     YMax = _startExtent.YMax - deltaY
                                 };

            _map.Extent = nextExtent;

            if (KinectPanning != null)
            {
                var handCoordinate = handPoint.ToEsriWebMercatorMapPoint(_map);
                KinectPanning(handCoordinate.ToMapCoord());
            }
        }
开发者ID:vmachuca,项目名称:kinect4map,代码行数:25,代码来源:MapPanGestureHandler.cs


示例11: Plane

 public Plane(SkeletonPoint p1, SkeletonPoint p2, SkeletonPoint p3)
 {
     a = (p2.Y - p1.Y) * (p3.Z - p1.Z) - (p3.Y - p1.Y) * (p2.Z - p1.Z);
     b = (p2.Z - p1.Z) * (p3.X - p1.X) - (p3.Z - p1.Z) * (p2.X - p1.X);
     c = (p2.X - p1.X) * (p3.Y - p1.Y) - (p3.X - p1.X) * (p2.Y - p1.Y);
     d = -(a * p1.X + b * p1.Y + c * p1.Z);
 }
开发者ID:koshihub,项目名称:MediaInfomatics,代码行数:7,代码来源:Plane.cs


示例12: SkeletonPointToScreen

 /// <summary>
 /// Maps a SkeletonPoint to lie within our render space and converts to Point
 /// </summary>
 /// <param name="sensor">Sensor to proyect point</param>
 /// <param name="skelpoint">point to map</param>
 /// <returns>mapped point</returns>
 public Point SkeletonPointToScreen(KinectSensor sensor, SkeletonPoint skelpoint)
 {
     // Convert point to depth space.
     // We are not using depth directly, but we do want the points in our 640x480 output resolution.
     DepthImagePoint depthPoint = sensor.CoordinateMapper.MapSkeletonPointToDepthPoint(skelpoint, DepthImageFormat.Resolution640x480Fps30);
     return new Point(depthPoint.X, depthPoint.Y);
 }
开发者ID:AnabelGRios,项目名称:NPI15-16,代码行数:13,代码来源:Calculator.cs


示例13: Detect

        public bool Detect(SkeletonPoint shoulderCenter, SkeletonPoint rightHandPoint, bool rightHandTracked,
                           SkeletonPoint leftHandPoint, bool leftHandTracked)
        {
            var rightHandInFront = rightHandTracked && (shoulderCenter.Z - rightHandPoint.Z >= MinZDistanceFromBody);
            var leftHandInFront = leftHandTracked && (shoulderCenter.Z - leftHandPoint.Z >= MinZDistanceFromBody);

            // Just one hand at minimal distance from Shoulder Center
            if (rightHandInFront ^ leftHandInFront)
            {
                SkeletonPoint handPoint;
                if (rightHandInFront)
                {
                    handPoint = rightHandPoint;
                    PanningHand = Hand.Right;
                }
                else
                {
                    handPoint = leftHandPoint;
                    PanningHand = Hand.Left;
                }

                if (!IsPanning)
                {
                    StartPan(handPoint);
                }

                RunPanning(handPoint);
            }
            else
            {
                StopZooming();
            }

            return IsPanning;
        }
开发者ID:vmachuca,项目名称:kinect4map,代码行数:35,代码来源:MapPanGestureHandlerBase.cs


示例14: vecAdd

 public static SkeletonPoint vecAdd(SkeletonPoint a, SkeletonPoint b)
 {
     a.X += b.X;
     a.Y += b.Y;
     a.Z += b.Z;
     return a;
 }
开发者ID:Team694,项目名称:kinect-CAD,代码行数:7,代码来源:JointTracker.cs


示例15: Detect

        public bool Detect(SkeletonPoint shoulderCenter, SkeletonPoint rightHandPoint, bool rightHandTracked,
                           SkeletonPoint leftHandPoint, bool leftHandTracked)
        {
            if (rightHandTracked == false || leftHandTracked == false)
            {
                StopZooming();
            }
                // Both hands at minimal distance from Shoulder Center
            else if (shoulderCenter.Z - rightHandPoint.Z >= MinZDistanceFromBody &&
                     shoulderCenter.Z - leftHandPoint.Z >= MinZDistanceFromBody)
            {
                if (!IsZooming)
                {
                    StartZoom(rightHandPoint, leftHandPoint);
                }

                RunZooming(rightHandPoint, leftHandPoint);
            }
            else
            {
                StopZooming();
            }

            return IsZooming;
        }
开发者ID:vmachuca,项目名称:kinect4map,代码行数:25,代码来源:MapZoomGestureHandlerBase.cs


示例16: getAngle

        ///<summary>
        /// Receive three skeleton point (3D position of a joint).
        /// Compute two vector, return the angle between them.
        /// If something is wrong return 0
        ///</summary>
        public static float getAngle(SkeletonPoint a, SkeletonPoint b, SkeletonPoint c, bool sign)
        {
            Vecto3Float[] vector = new Vecto3Float[2];
            //vector[0] = new Vecto3Float(b.X - c.X, b.Y - c.Y, b.Z - c.Z);
            vector[0] = new Vecto3Float(c.X - b.X, c.Y - b.Y, c.Z - b.Z);
            vector[1] = new Vecto3Float(a.X - b.X, a.Y - b.Y, a.Z - b.Z);

            float v0_magnitude = vector[0].magnitude();
            float v1_magnitude = vector[1].magnitude();
            if (v0_magnitude != 0.0 && v1_magnitude != 0.0)
            {
                vector[0].normalize();
                vector[1].normalize();

                float sign_f = sign ? -1f : 1f;
                double x = (double)vector[0].cross(vector[1]).magnitude();
                double y = (double)vector[0].dot(vector[1]);

                float theta = (float)Math.Atan2(sign_f * x, sign_f * y);

                return theta;// -theta;
            }
            else
            {
                return 0.0f;
            }
        }
开发者ID:TheVerga,项目名称:NAOKinect,代码行数:32,代码来源:Kinematic.cs


示例17: TransPortVector

        public static Vector3D TransPortVector(SkeletonPoint skel) //單點做世界座標轉換
        {
            Vector3D realPoint = new Vector3D(skel.X, skel.Y, skel.Z);
            realPoint = TransPortVector(realPoint);

            return realPoint;
        }   
开发者ID:sarsadsl,项目名称:fall_down_detect_with_chart,代码行数:7,代码来源:CalculateMethod.cs


示例18: DistanceXYBetweenPoints

        public static float DistanceXYBetweenPoints(SkeletonPoint point1, SkeletonPoint point2)
        {
            double d1 = point1.X - point2.X;
            double d2 = point1.Y - point2.Y;

            return (float)Math.Sqrt(d1 * d1 + d2 * d2);
        }
开发者ID:LucioC,项目名称:class_share,代码行数:7,代码来源:GestureUtils.cs


示例19: ConvertPoint

 public SkeletonPoint ConvertPoint(SkeletonPoint point)
 {
     SkeletonPoint pt = new SkeletonPoint();
     pt.X = ScalePoint(point.X, bottomCenterPoint.X) + (float)ActiveRectangle.Width / 2 + (float)ActiveRectangle.X;
     pt.Y = (float)ActiveRectangle.Height - ScalePoint(point.Y, bottomCenterPoint.Y) + (float)ActiveRectangle.Y;
     pt.Z = ScalePoint(point.Z, bottomCenterPoint.Z);
     return pt;
 }
开发者ID:kingston,项目名称:kineticmath,代码行数:8,代码来源:BodyRelativePointConverter.cs


示例20: CalculateMiddlePoint

 public static Point CalculateMiddlePoint(SkeletonPoint point1, SkeletonPoint point2)
 {
     return new Point(
         GetMiddleValue(point1.X, point2.X),
         GetMiddleValue(point1.Y, point2.Y),
         GetMiddleValue(point1.Z, point2.Z)
     );
 }
开发者ID:andreymir,项目名称:eggsss,代码行数:8,代码来源:MathProcessor.cs



注:本文中的Microsoft.Kinect.SkeletonPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Toolkit.KinectChangedEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Kinect.SkeletonFrameReadyEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap