當前位置: 首頁>>代碼示例>>C#>>正文


C# Kinect.SkeletonPoint類代碼示例

本文整理匯總了C#中Microsoft.Kinect.SkeletonPoint的典型用法代碼示例。如果您正苦於以下問題:C# SkeletonPoint類的具體用法?C# SkeletonPoint怎麽用?C# SkeletonPoint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SkeletonPoint類屬於Microsoft.Kinect命名空間,在下文中一共展示了SkeletonPoint類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Microsoft.Kinect.SkeletonPoint類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。