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

C# Kinect.SkeletonFrameReadyEventArgs类代码示例

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

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



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

示例1: Nui_SkeletonFrameReady

        static void Nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            if (!_initialized) return;

            List<Skeleton> users = new List<Skeleton>();

            SkeletonFrame skeletonFrame = e.OpenSkeletonFrame();
            Skeleton[] skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];

            skeletonFrame.CopySkeletonDataTo(skeletons);

            foreach (var user in skeletons)
            {
                if (user.TrackingState == SkeletonTrackingState.Tracked)
                {
                    users.Add(user);
                }
            }

            if (users.Count > 0)
            {
                string json = users.Serialize();

                foreach (var socket in _sockets)
                {
                    socket.Send(json);
                }
            }
        }
开发者ID:uniphil,项目名称:FitHub,代码行数:29,代码来源:Program.cs


示例2: Kinect_SkeletonFrameReadyTwo

        //Eventhanterare för andra skeletet
        public void Kinect_SkeletonFrameReadyTwo(object sender, SkeletonFrameReadyEventArgs e)
        {
            SkeletonsPanelTwo.Children.Clear();

            if (this.IsEnabled)
            {
                using (SkeletonFrame frame = e.OpenSkeletonFrame())
                {
                    if (frame != null)
                    {
                        if (this.IsEnabled)
                        {
                            frame.CopySkeletonDataTo(this._FrameSkeletons);

                            for (int i = 0; i < this._FrameSkeletons.Length; i++)
                            {
                                DrawSkeleton(this._FrameSkeletons[i], this._SkeletonBrushes[i]);

                                TrackJoint(this._FrameSkeletons[i].Joints[JointType.HandLeft], this._SkeletonBrushes[i]);
                                TrackJoint(this._FrameSkeletons[i].Joints[JointType.HandRight], this._SkeletonBrushes[i]);
                                TrackJoint(this._FrameSkeletons[i].Joints[JointType.HipLeft], this._SkeletonBrushes[i]);
                                TrackJoint(this._FrameSkeletons[i].Joints[JointType.HipRight], this._SkeletonBrushes[i]);
                                TrackJoint(this._FrameSkeletons[i].Joints[JointType.KneeLeft], this._SkeletonBrushes[i]);
                                TrackJoint(this._FrameSkeletons[i].Joints[JointType.KneeRight], this._SkeletonBrushes[i]);
                            }

                        }
                    }
                }
            }
        }
开发者ID:kulturberikare,项目名称:RUNKinect,代码行数:32,代码来源:SkeletonViewerTwo.xaml.cs


示例3: SensorSkeletonFrameReady

        private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs skeletonFrameReadyEventArgs)
        {
            
            using (SkeletonFrame skeletonFrame = skeletonFrameReadyEventArgs.OpenSkeletonFrame())
            {
                if (skeletonFrame == null)
                    return;

                
                try
                {
                    

                    skeletonFrame.CopySkeletonDataTo(skeletons);
                    var accelerometerReading = sensor.AccelerometerGetCurrentReading();
                    interactionStream.ProcessSkeleton(skeletons, accelerometerReading, skeletonFrame.Timestamp);

                   
                }
                catch (InvalidOperationException)
                {
                    // SkeletonFrame functions may throw when the sensor gets
                    // into a bad state.  Ignore the frame in that case.
                }
            }
        }
开发者ID:GregWard,项目名称:Tronsformers,代码行数:26,代码来源:KinectEvents.cs


示例4: KinectOnSkeletonFrameReady

        private static void KinectOnSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs skeletonFrameReadyEventArgs)
        {
            using (var frame = skeletonFrameReadyEventArgs.OpenSkeletonFrame())
            {
                if (frame == null) return;

                //フレームに含まれる骨格情報を取得する
                var skeletonData = new Skeleton[frame.SkeletonArrayLength];
                frame.CopySkeletonDataTo(skeletonData);

                foreach (var skeleton in skeletonData)
                {
                    if (skeleton == null) continue;

                    //トラッキングできている骨格だけ取得
                    if (skeleton.TrackingState != SkeletonTrackingState.Tracked) continue;
                    foreach (Joint joint in skeleton.Joints)
                    {
                        //トラッキングできている関節だけ取得
                        if (joint.TrackingState != JointTrackingState.Tracked) continue;
                        Console.WriteLine("JointType: {0}\t X: {1} \t Y: {2} \t Z: {3}", joint.JointType, joint.Position.X, joint.Position.Y, joint.Position.Z);

                        //座標系の変換
                        var cp = (sender as KinectSensor).CoordinateMapper.MapSkeletonPointToColorPoint(joint.Position, ColorImageFormat.RawBayerResolution640x480Fps30);
                        Console.WriteLine("RGB X: {0} \t RGB Y: {1}", cp.X, cp.Y);
                    }
                }
            }
        }
开发者ID:buchizo,项目名称:ITAP5,代码行数:29,代码来源:Program.cs


示例5: Sensor_SkeletonFrameReady

		void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
		{
			using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
			{
				skeletonFrame.CopySkeletonDataTo(this.FSkeletons);
			}
		}
开发者ID:kevinbs,项目名称:VVVV.Packs.Image,代码行数:7,代码来源:Skeleton.cs


示例6: myKinect_AllFramesReady

        private void myKinect_AllFramesReady(Object sender,SkeletonFrameReadyEventArgs e)
        {
            using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
            {
                if (skeletonFrame != null)
                {
                    if (this.skeletonData == null || (this.skeletonData.Length != skeletonFrame.SkeletonArrayLength))
                    {
                        this.skeletonData = new Skeleton[skeletonFrame.SkeletonArrayLength];
                    }

                    skeletonFrame.CopySkeletonDataTo(skeletonData);

                    foreach(Skeleton skeleton in skeletonData)
                    {
                        if(skeleton.TrackingState == SkeletonTrackingState.Tracked)
                        {
                            double x = 0, y = 0, z = 0;
                            Joint joint = skeleton.Joints[JointType.HandRight];
                            x = joint.Position.X;
                            y = joint.Position.Y;
                            z = joint.Position.Z;
                            tRightHand.Content = "X: " + x + " \nY: " + y + " \nZ: " + z;
                            if (x > 0.5)
                            {
                                tRightHand.Foreground = Brushes.Red;
                            } else
                            {
                                tRightHand.Foreground = Brushes.Black;
                            }
                        }
                    }
                }
            }
        }
开发者ID:Broams,项目名称:holography,代码行数:35,代码来源:MainWindow.xaml.cs


示例7: sensor_SkeletonFrameReady

        void sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            //frameNumber = frameNumber + 1;
            timepassed++;
            seconds = timepassed / 30;

            e.OpenSkeletonFrame().CopySkeletonDataTo(skeletons);
            int counter = 0;
            foreach(Skeleton skeleton in skeletons)
            {
                if (skeleton.TrackingState == SkeletonTrackingState.Tracked)
                    counter++;
            }

            //Console.WriteLine("Frame: {0}, Number of Skeletons: {1}",  frameNumber, counter);
            if (timepassed == seconds * 30)
                Console.WriteLine("Seconds passed: {0}, Number of Skeletons: {1}", seconds, counter);

            if (counter > 0)
            {
                if (timepassed == seconds * 30)
                {
                    Console.WriteLine("Location of head: " + skeletons[counter].Joints[JointType.Head].Position.X + ", " + skeletons[counter].Joints[JointType.Head].Position.Y + ", " + skeletons[counter].Joints[JointType.Head].Position.Z + "; Found at: " + DateTime.Now);
                }
            }
        }
开发者ID:hcilab-um,项目名称:STim,代码行数:26,代码来源:Program.cs


示例8: NewSensor_SkeletonFrameReady

        void NewSensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs args)
        {
            var colors = new Dictionary<int, Color>();
            Skeleton[] skeletons;

            using (var frame = args.OpenSkeletonFrame())
            {
                if (frame == null)
                    return;

                skeletons = new Skeleton[frame.SkeletonArrayLength];
                frame.CopySkeletonDataTo(skeletons);
            }

            foreach (var skeleton in skeletons.Where(s => SkeletonTrackingState.Tracked.Equals(s.TrackingState)))
            {
                Random _rnd = new Random();
                var userId = skeleton.TrackingId;

                var crazyColors = Color.FromRgb((byte)_rnd.Next(255), (byte)_rnd.Next(255), (byte)_rnd.Next(255));

                colors.Add(userId, KinectRegion.PrimaryUserTrackingId == userId ?
                    crazyColors :
                    Colors.Blue);
            }

            this.KinectUserViewer.UserColors = colors;
        }
开发者ID:jorgeLuizChaves,项目名称:K4W,代码行数:28,代码来源:KinectInteractionsConfig.cs


示例9: kinectSensor_SkeletonFrameReady

        private void kinectSensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            using (SkeletonFrame frame = e.OpenSkeletonFrame())
            {
                if (frame == null)
                    return;

                frame.GetSkeletons(ref skeletons);

                if (skeletons.All(s => s.TrackingState == SkeletonTrackingState.NotTracked))
                    return;

                foreach (var skeleton in skeletons)
                {
                    if (skeleton.TrackingState != SkeletonTrackingState.Tracked)
                        continue;

                    foreach (Joint joint in skeleton.Joints)
                    {
                        if (joint.TrackingState != JointTrackingState.Tracked)
                            continue;

                        if (joint.JointType == JointType.HandRight)
                        {
                            MouseController.Current.SetHandPosition(kinectSensor, joint, skeleton);
                        }
                    }
                }
            }
        }
开发者ID:rajankz,项目名称:cmsc838f-a4,代码行数:30,代码来源:MainWindow.xaml.cs


示例10: Sensor_SkeletonFrameReady

        void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            using (var frame = e.OpenSkeletonFrame())
            {
                if (frame != null)
                {
                    canvas.ClearSkeletons();

                    var skeletons = frame.Skeletons().Where(s => s.TrackingState == SkeletonTrackingState.Tracked);

                    foreach (var skeleton in skeletons)
                    {
                        if (skeleton != null)
                        {
                            // Update skeleton gestures.
                            _gestureController.Update(skeleton);

                            // Draw skeleton.
                            canvas.DrawSkeleton(skeleton);

                        }
                    }
                }
            }
        }
开发者ID:Milpoder,项目名称:NPI,代码行数:25,代码来源:MainWindow.xaml.cs


示例11: kinect_SkeletonFrameReady

        /// <summary>
        /// スケルトンの更新通知
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void kinect_SkeletonFrameReady( object sender, SkeletonFrameReadyEventArgs e )
        {
            try {
            // Kinectのインスタンスを取得する
            KinectSensor kinect = sender as KinectSensor;
            if ( kinect == null ) {
              return;
            }

            // スケルトンのフレームを取得する
            using ( SkeletonFrame skeletonFrame = e.OpenSkeletonFrame() ) {
              if ( skeletonFrame != null ) {
            Skeleton skeleton = skeletonFrame.GetFirstTrackedSkeleton();
            if ( skeleton != null ) {
              // ポーズの検出用に、スケルトンデータを追加する
              postureDetector.TrackPostures( skeleton );

              // 右手がトラッキングされていた場合、ジェスチャーの検出用にジョイントを追加する
              Joint hand = skeleton.Joints[JointType.HandRight];
              if ( hand.TrackingState == JointTrackingState.Tracked ) {
                swipeDetector.Add( hand.Position, kinect );

              }
            }
              }
            }
              }
              catch ( Exception ex ) {
            MessageBox.Show( ex.Message );
              }
        }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:36,代码来源:MainWindow.xaml.cs


示例12: Sensor_SkeletonFrameReady

        void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            using (var frame = e.OpenSkeletonFrame())
            {
                if (frame != null)
                {
                    canvas.ClearSkeletons();
                    tblHeights.Text = string.Empty;

                    var skeletons = frame.Skeletons().Where(s => s.TrackingState == SkeletonTrackingState.Tracked);

                    foreach (var skeleton in skeletons)
                    {
                        if (skeleton != null)
                        {
                            // Update skeleton gestures.
                            _gestureController.Update(skeleton);

                            // Draw skeleton.
                            canvas.DrawSkeleton(skeleton);

                            // Display user height.
                            tblHeights.Text += string.Format("\nUser {0}: {1}cm", skeleton.TrackingId, skeleton.Height());
                        }
                    }
                }
            }
        }
开发者ID:etrigger,项目名称:Vitruvius,代码行数:28,代码来源:MainWindow.xaml.cs


示例13: miKinect_SkeletonFrameReady

        private void miKinect_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            canvasesqueleto.Children.Clear();
            Skeleton[] esqueletos = null;

            using (SkeletonFrame frameEsqueleto = e.OpenSkeletonFrame()) {
                if (frameEsqueleto != null) {
                    esqueletos = new Skeleton[frameEsqueleto.SkeletonArrayLength];
                    frameEsqueleto.CopySkeletonDataTo(esqueletos);
                }
            }

            if (esqueletos == null) return;

            foreach (Skeleton esqueleto in esqueletos) {
                if (esqueleto.TrackingState == SkeletonTrackingState.Tracked) { 
                    Joint handJoint = esqueleto.Joints[JointType.HandRight];
                    Joint elbowJoint = esqueleto.Joints[JointType.ElbowRight];

                    Line huesoBrazoDer = new Line();
                    huesoBrazoDer.Stroke = new SolidColorBrush(Colors.Red);
                    huesoBrazoDer.StrokeThickness = 5;

                    ColorImagePoint puntoMano = miKinect.CoordinateMapper.MapSkeletonPointToColorPoint(handJoint.Position, ColorImageFormat.RgbResolution640x480Fps30);
                    huesoBrazoDer.X1 = puntoMano.X;
                    huesoBrazoDer.Y1 = puntoMano.Y;

                    ColorImagePoint puntoCodo = miKinect.CoordinateMapper.MapSkeletonPointToColorPoint(elbowJoint.Position, ColorImageFormat.RgbResolution640x480Fps30);
                    huesoBrazoDer.X2 = puntoCodo.X;
                    huesoBrazoDer.Y2 = puntoCodo.Y;

                    canvasesqueleto.Children.Add(huesoBrazoDer);
                }
            }
        }
开发者ID:egaleano,项目名称:Kinect,代码行数:35,代码来源:MainWindow.xaml.cs


示例14: kinect_SkeletonFrameReady

        private void kinect_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            //Debug.WriteLine("In kinect skeleton event handler");

            using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame()) // Open the Skeleton frame
            {
                if (skeletonFrame != null && this.skeletonData != null) // check that a frame is available
                {
                    skeletonFrame.CopySkeletonDataTo(this.skeletonData); // get the skeletal information in this frame
                }
            }
               // Debug.WriteLine(this.skeletonData.Length);

            foreach (Skeleton skel in this.skeletonData)
            {
                if (skel.TrackingState == SkeletonTrackingState.Tracked)
                {
                    count++;
                    if (count > 50)
                    {
                        Console.WriteLine("id: " + skel.TrackingId + "shoulder L      X:" + skel.Joints[JointType.ShoulderLeft].Position.X + " Y: " + skel.Joints[JointType.ShoulderLeft].Position.Y + " Z: " + skel.Joints[JointType.ShoulderLeft].Position.Z);
                        Console.WriteLine("id: " + skel.TrackingId + "shoulder C      X:" + skel.Joints[JointType.ShoulderCenter].Position.X + " Y: " + skel.Joints[JointType.ShoulderCenter].Position.Y + " Z: " + skel.Joints[JointType.ShoulderCenter].Position.Z);
                        Console.WriteLine("id: " + skel.TrackingId + "shoulder R      X:" + skel.Joints[JointType.ShoulderRight].Position.X + " Y: " + skel.Joints[JointType.ShoulderRight].Position.Y + " Z: " + skel.Joints[JointType.ShoulderRight].Position.Z);
                        //Console.WriteLine("id: " + skel.TrackingId + " X: " + skel.Position.X + " Y: " + skel.Position.Y + " Z: " + skel.Position.Z);
                        count = 0;
                    }
                }

            }
        }
开发者ID:seapong,项目名称:capstone,代码行数:30,代码来源:Program.cs


示例15: Sensor_SkeletonFrameReady

        void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            using (var frame = e.OpenSkeletonFrame())
            {
                if (frame != null)
                {
                    canvas.Children.Clear();

                    Skeleton[] skeletons = new Skeleton[frame.SkeletonArrayLength];

                    frame.CopySkeletonDataTo(skeletons);

                    var skeleton = skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault();

                    if (skeleton != null)
                    {
                        // Calculate height.
                        double height = Math.Round(skeleton.Height(), 2);

                        // Draw skeleton joints.
                        foreach (JointType joint in Enum.GetValues(typeof(JointType)))
                        {
                            //DrawJoint(skeleton.Joints[joint].ScaleTo(640, 480));
                            Point p = posionScale(skeleton.Joints[joint].Position);
                            DrawJoint(p);
                        }

                        // Display height.
                        tblHeight.Text = "Height: " + height.ToString() + "m";
                    }
                }
            }
        }
开发者ID:RyanAuu,项目名称:yyf,代码行数:33,代码来源:MainWindow.xaml.cs


示例16: MeasureDistance

 protected void MeasureDistance(object sender,SkeletonFrameReadyEventArgs e)
 {
     using(SkeletonFrame skeletonFrame=e.OpenSkeletonFrame())
         if(skeletonFrame!=null){
             Skeleton[] skeletons=new Skeleton[skeletonFrame.SkeletonArrayLength];
             skeletonFrame.CopySkeletonDataTo(skeletons);
             Skeleton firstTrackedSkeleton=null;
             foreach(Skeleton skel in skeletons)
                 if(skel.TrackingState==SkeletonTrackingState.Tracked){
      							firstTrackedSkeleton=skel;
                     break;
                 }
             if(firstTrackedSkeleton==null){
                 IsTracking=false;
                 return;
             }
             IsTracking=true;
             var point1=sensor.MapSkeletonPointToDepth(firstTrackedSkeleton.Joints[Joint1].Position,DepthImageFormat.Resolution640x480Fps30);
             var point2=sensor.MapSkeletonPointToDepth(firstTrackedSkeleton.Joints[Joint2].Position,DepthImageFormat.Resolution640x480Fps30);
             Joint1Location=new Point(point1.X,point1.Y);
             Joint2Location=new Point(point2.X,point2.Y);
             Distance=(int)Math.Sqrt((point2.X-point1.X)*(point2.X-point1.X)+(point2.Y-point1.Y)*(point2.Y-point1.Y));
         }
     return;
 }
开发者ID:abcsharp,项目名称:KinectTestApp,代码行数:25,代码来源:JointDistance.cs


示例17: KinectDevice_SkeletonFrameReady

        //---------------------METHODS-------------
        #region Methods
        private void KinectDevice_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            SkeletonsPanel.Children.Clear();
            JointInfoPanel.Children.Clear();

            if (this.IsEnabled)
            {
                using (SkeletonFrame frame = e.OpenSkeletonFrame())
                {
                    if (frame != null)
                    {
                        if (this.IsEnabled)
                        {
                            Brush brush;
                            Skeleton skeleton;
                            frame.CopySkeletonDataTo(this._FrameSkeletons);

                            for (int i = 0; i < this._FrameSkeletons.Length; i++)
                            {

                                skeleton = this._FrameSkeletons[i];
                                brush = this._SkeletonBrushes[i];
                                DrawSkeleton(skeleton, brush);

                                TrackJoint(skeleton.Joints[JointType.HandLeft], brush);
                                TrackJoint(skeleton.Joints[JointType.HandRight], brush);
                                //You can track all the joints if you want
                            }
                        }
                    }
                }
            }
        }
开发者ID:Kazhunter,项目名称:Kinect,代码行数:35,代码来源:SkeletonViewer.xaml.cs


示例18: Sensor_SkeletonFrameReady

        void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            using (var frame = e.OpenSkeletonFrame())
            {
                if (frame != null)
                {
                    Skeleton[] bodies = new Skeleton[frame.SkeletonArrayLength];

                    frame.CopySkeletonDataTo(bodies);

                    var body = bodies.Where(b => b.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault();

                    if (body != null)
                    {
                        Joint handLeft = body.Joints[JointType.HandLeft];
                        Joint handRight = body.Joints[JointType.HandRight];

                        if (handLeft.TrackingState != JointTrackingState.NotTracked && handRight.TrackingState != JointTrackingState.NotTracked)
                        {
                            // Select the hand that is closer to the sensor.
                            var activeHand = handRight.Position.Z <= handLeft.Position.Z ? handRight : handLeft;
                            var position = _sensor.CoordinateMapper.MapSkeletonPointToColorPoint(activeHand.Position, ColorImageFormat.RgbResolution640x480Fps30);

                            cursor.Flip(activeHand);                            
                            cursor.Update(position);
                        }
                    }
                }
            }
        }
开发者ID:guozanhua,项目名称:kinect-controls,代码行数:30,代码来源:MainWindow.xaml.cs


示例19: SensorSkeletonFrameReady

        private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
        {
            // Access the skeleton frame
            using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())
            {
                if (skeletonFrame != null)
                {
                    if (this.skeletons == null)
                    {
                        // Allocate array of skeletons
                        this.skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];

                    }

                    // Copy skeletons from this frame
                    skeletonFrame.CopySkeletonDataTo(this.skeletons);

                    // Find first tracked skeleton, if any
                    Skeleton skeleton = this.skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault();
                    FloorClipPlane = skeletonFrame.FloorClipPlane;
                    //Debug.WriteLine(skeletonFrame.FloorClipPlane);

                    if (skeleton != null)
                    {
                        // Obtain the left knee joint; if tracked, print its position

                       Calibration.mainSkeleton = skeleton;
                       Debug.WriteLine(skeleton.Joints[JointType.FootLeft].Position.X + " " + skeleton.Joints[JointType.FootLeft].Position.Y + " " + skeleton.Joints[JointType.FootLeft].Position.Z);
                    }
                }
            }
        }
开发者ID:junker4ce,项目名称:307-Interactive-Floor,代码行数:32,代码来源:CaliTracking.cs


示例20: MeasureAngle

 protected void MeasureAngle(object sender,SkeletonFrameReadyEventArgs e)
 {
     if(IsEnabled)
         using(SkeletonFrame skeletonFrame=e.OpenSkeletonFrame())
             if(skeletonFrame!=null){
                 Skeleton[] skeletons=new Skeleton[skeletonFrame.SkeletonArrayLength];
                 skeletonFrame.CopySkeletonDataTo(skeletons);
                 Skeleton firstTrackedSkeleton=null;
                 foreach(Skeleton skel in skeletons)
                     if(skel.TrackingState==SkeletonTrackingState.Tracked){
      								firstTrackedSkeleton=skel;
                         break;
                     }
                 if(firstTrackedSkeleton==null){
                     IsTracking=false;
                     return;
                 }
                 IsTracking=true;
                 var point1=sensor.CoordinateMapper.MapSkeletonPointToDepthPoint(firstTrackedSkeleton.Joints[JointType.HandRight].Position,DepthImageFormat.Resolution640x480Fps30);
                 var point2=sensor.CoordinateMapper.MapSkeletonPointToDepthPoint(firstTrackedSkeleton.Joints[JointType.HandLeft].Position,DepthImageFormat.Resolution640x480Fps30);
                 RightHandLocation=new Point(point1.X,point1.Y);
                 LeftHandLocation=new Point(point2.X,point2.Y);
                 MiddlePoint=new Point((point1.X+point2.X)/2.0,(point1.Y+point2.Y)/2.0);
                 var angle=(int)(Math.Atan(-(((double)point2.Y-point1.Y)/(point2.X-point1.X)))*(180.0/Math.PI));
                 Angle=point1.X<point2.X?point1.Y<point2.Y?angle+180:angle-180:angle;
             }
     return;
 }
开发者ID:abcsharp,项目名称:KinectControls,代码行数:28,代码来源:HandVolume.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Kinect.SkeletonPoint类代码示例发布时间:2022-05-26
下一篇:
C# Kinect.Skeleton类代码示例发布时间: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