当前位置: 首页>>代码示例>>C#>>正文


C# KinectSensor.Start方法代码示例

本文整理汇总了C#中Microsoft.Kinect.KinectSensor.Start方法的典型用法代码示例。如果您正苦于以下问题:C# KinectSensor.Start方法的具体用法?C# KinectSensor.Start怎么用?C# KinectSensor.Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Kinect.KinectSensor的用法示例。


在下文中一共展示了KinectSensor.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InicializarKinect

 private void InicializarKinect()
 {
     Kinect = InicializadorKinect.InicializarPrimeiroSensor(0);
     Kinect.Start();
     Kinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
     Kinect.ColorFrameReady += Kinect_ColorFrameReady;
 }
开发者ID:jorgeLuizChaves,项目名称:MSKinect,代码行数:7,代码来源:MainWindow.xaml.cs

示例2: Window_Loaded_1

 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     miKinect = KinectSensor.KinectSensors[0];
     miKinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
     miKinect.Start();
     miKinect.ColorFrameReady += miKinect_ColorFrameReady;
 }
开发者ID:egaleano,项目名称:Kinect,代码行数:7,代码来源:MainWindow.xaml.cs

示例3: KinectControl

        public KinectControl(HoverButton kinectButton, double layoutHeight, double layoutWidth, List<Button> buttons, TextBox debugBox = null)
        {
            _kinectButton = kinectButton;
            _layoutHeight = layoutHeight;
            _layoutWidth = layoutWidth;
            _buttons = buttons;
            _debugBox = debugBox;

            _kinect = KinectSensor.KinectSensors.FirstOrDefault();

            if (_kinect != null)
            {
                _kinect.Start();

                _kinect.ColorStream.Enable();
                _kinect.SkeletonStream.Enable(new TransformSmoothParameters
                    {
                        Smoothing = 0.7f,
                        Correction = 0.1f,
                        Prediction = 0.1f,
                        JitterRadius = 0.05f,
                        MaxDeviationRadius = 0.05f
                    });

                _kinect.SkeletonFrameReady += kinect_SkeletonFrameReady;
            }

            _activeRecognizer = CreateRecognizer();
            _kinectButton.Click += KinectButton_Click;
        }
开发者ID:rudylee,项目名称:WpfApp,代码行数:30,代码来源:KinectControl.cs

示例4: StartKinect

        /// <summary>
        /// Starts up Kinect
        /// </summary>
        void StartKinect()
        {
            try
            {
                kinect = KinectSensor.KinectSensors.FirstOrDefault();

                kinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(runtime_SkeletonFrameReady);

                TransformSmoothParameters parameters = new TransformSmoothParameters()
                {
                    Smoothing = 0.75f,
                    Correction = 0.0f,
                    Prediction = 0.0f,
                    JitterRadius = 0.05f,
                    MaxDeviationRadius = 0.4f
                };

                kinect.SkeletonStream.Enable(parameters);
                
                this.skeletonData = new Skeleton[kinect.SkeletonStream.FrameSkeletonArrayLength];
                kinect.Start();
                Trace.WriteLine("Kinect initialized");
            }
            catch (Exception)
            {
                Trace.WriteLine("Error while initializing Kinect. Trying again in 5 seconds...");
                kinectRetryTimer.Start();
            }
        }
开发者ID:wonguk,项目名称:TeuduKinect,代码行数:32,代码来源:UserKinectService.cs

示例5: Main

        static void Main()
        {
            Init();

            try
            {
                logic = new Logic();
                sensor = KinectSensor.KinectSensors[0];

                sensor.Start();
                sensor.SkeletonStream.Enable();
                sensor.SkeletonStream.EnableTrackingInNearRange = true;

                timer = new Timer();
                timer.Interval = 500;
                timer.Elapsed += Timer_Elapsed;
                timer.Enabled = true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.ReadLine();
        }
开发者ID:kchikuse,项目名称:kinect,代码行数:25,代码来源:Program.cs

示例6: Window_Loaded_1

        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            if (KinectSensor.KinectSensors.Count == 0)
            {
                MessageBox.Show("No se detecta ningun kinect");
                Application.Current.Shutdown();
            }

            miKinect = KinectSensor.KinectSensors.FirstOrDefault();

            try
            {
                miKinect.SkeletonStream.Enable();
                miKinect.ColorStream.Enable();
                miKinect.Start();
            }
            catch
            {
                MessageBox.Show("La inicializacion del Kinect fallo");
                Application.Current.Shutdown();
            }

            miKinect.SkeletonFrameReady += miKinect_SkeletonFrameReady;
            miKinect.ColorFrameReady += miKinect_ColorFrameReady;
        }
开发者ID:egaleano,项目名称:Kinect,代码行数:25,代码来源:MainWindow.xaml.cs

示例7: Window_Loaded_1

 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     miKinect = KinectSensor.KinectSensors.FirstOrDefault();
     miKinect.Start();
     miKinect.ColorStream.Enable();
     miKinect.ColorFrameReady += miKinect_ColorFrameReady;
 }
开发者ID:egaleano,项目名称:Kinect,代码行数:7,代码来源:MainWindow.xaml.cs

示例8: initialize

        public void initialize( int elevationAngle = 0 )
        {
            try { kinectSensor = KinectSensor.KinectSensors[0]; }
            catch (Exception e)
            {
                Console.WriteLine("kinect not detected, continuing with kinect disabled {0}",e);
                return;
            }

            // limits elevation angle to keep the motors from trying too extreme an angle
            if (elevationAngle >= 26 )
            {
                elevationAngle = 26;
            }
            else if (elevationAngle <= -26)
            {
                elevationAngle = -26;
            }

            // Only initializes Skeletal Tracking
            kinectSensor.SkeletonStream.Enable();

            // set a call back function to process skeleton data
            kinectSensor.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(kinectSkeletonFrameReadyCallback);
            kinectSensor.Start();
            kinectSensor.ElevationAngle = elevationAngle;
        }
开发者ID:arellanj,项目名称:XNA_Tetris,代码行数:27,代码来源:Kinect.cs

示例9: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            // Check to see if a Kinect is available
            if (KinectSensor.KinectSensors.Count == 0)
            {
                MessageBox.Show("No Kinects detected", "Camera Viewer");
                Application.Current.Shutdown();
            }

            // Get the first Kinect on the computer
            myKinect = KinectSensor.KinectSensors[0];
            DateTime date = DateTime.Now;
            sessiondate = date.ToLongDateString();
            // Start the Kinect running and select the depth camera
            try
            {
                myKinect.SkeletonStream.Enable();

                myKinect.Start();
            }
            catch
            {
                MessageBox.Show("Kinect initialise failed", "Camera Viewer");
                Application.Current.Shutdown();
            }

            // connect a handler to the event that fires when new frames are available

            myKinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(myKinect_SkeletonFrameReady);

        }
开发者ID:nathad02,项目名称:CITS3200--Group-H,代码行数:32,代码来源:MainWindow.xaml.cs

示例10: KinectGrabWheelController

        public KinectGrabWheelController(WheelDelegate wheelDelegate, ScreenManager screenManager, KinectSensor kinect)
        {
            this.device = screenManager.GraphicsDevice;

            this.wheelDelegate = wheelDelegate;
            position = new Vector2();
            positionScreen = new Vector2();
            this.kinectSensor = kinect;

            //if (!kinect.IsRunning)
            //{
                var parameters = new TransformSmoothParameters
                {
                    Smoothing = 0.1f,
                    Correction = 0.0f,
                    Prediction = 0.0f,
                    JitterRadius = 1.0f,
                    MaxDeviationRadius = 0.5f
                };
                kinect.SkeletonStream.Enable(parameters);
                kinect.DepthStream.Enable();
                kinect.ColorStream.Enable();

                kinect.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(ks_AllFramesReady);

                interactionStream = new Microsoft.Kinect.Toolkit.Interaction.InteractionStream(kinect, new myIntClient());
                interactionStream.InteractionFrameReady += new EventHandler<InteractionFrameReadyEventArgs>(intStream_InteractionFrameReady);
                kinect.Start();
            //}
        }
开发者ID:slavede,项目名称:InitialGame,代码行数:30,代码来源:KinectGrabWheelController.cs

示例11: InitilizeKinect

 private static void InitilizeKinect()
 {
     _sensor = KinectSensor.KinectSensors.SingleOrDefault();
     _sensor.SkeletonStream.Enable();
     _sensor.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(Sensor_SkeletonFrameReady);
     _sensor.Start();
 }
开发者ID:ruinalmeida,项目名称:KinectHtml5,代码行数:7,代码来源:Program.cs

示例12: btnStream_Click

        private void btnStream_Click(object sender, EventArgs e)
        {
            if (btnStream.Text == "Stream")
            {

                if (KinectSensor.KinectSensors.Count > 0)
                {
                    sensor = KinectSensor.KinectSensors[0];
                    btnStream.Text = "Stop";
                    KinectSensor.KinectSensors.StatusChanged += KinectSensors_StatusChanged;
                    sensor.Start();
                    lblConID.Text = sensor.DeviceConnectionId;
                    sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
                    sensor.ColorFrameReady += Sensor_ColorFrameReady;
                    sensor.ElevationAngle = 0;
                    sliderValue.Text = sliderAngle.Value.ToString();
                    sliderAngle.Value = 0;
                }

            }
            else
            {
                if (sensor != null && sensor.IsRunning)
                {
                    sensor.Stop();
                    btnStream.Text = "Stream";
                    pb.Image = null;

                }

            }
        }
开发者ID:motamed,项目名称:Kinect,代码行数:32,代码来源:Form1.cs

示例13: OnLoaded

        private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            
            // this is just a test, so it only works with one Kinect, and quits if that is not available.
            _sensor = KinectSensor.KinectSensors.FirstOrDefault();
            if (_sensor == null)
            {
                MessageBox.Show("No Kinect Sensor detected!");
                Close();
                return;
            }
            
            //_sensor.SkeletonStream.EnableTrackingInNearRange = true;
            _sensor.SkeletonStream.Enable();

            _sensor.SkeletonFrameReady += NuiSkeletonFrameReady;

            _sensor.Start();
            IGestureDetector gestureDetector = new InteractiveGestureDetector(_sensor);
            ((InteractiveGestureDetector)gestureDetector).DumpReady += InteractionStreamOnInteractionFrameReady;
            IGestureDetector voiceDetector = new VoiceRecognition.KinectVoiceGestureDetector(_sensor);
            ICommandSender commandSender = new XbmcCommandSender();
            adapter = new GestureToCommandAdapter(@"GestureToCommand.XML", commandSender, gestureDetector, voiceDetector);
            adapter.ShowNotification = true;
            //Gestures
            gestureDetector.GestureDetected += gestureDetector_GestureDetected;
        }
开发者ID:vova1987,项目名称:KinectAdapter.github.io,代码行数:29,代码来源:DebugWindow.xaml.cs

示例14: Window_Loaded

 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     sensor = KinectSensor.KinectSensors[0];
     sensor.ColorStream.Enable();
     sensor.ColorFrameReady += VideoFrameReady;
     sensor.Start();
 }
开发者ID:ChengYouFang,项目名称:MyFirstKinect,代码行数:7,代码来源:MainWindow.xaml.cs

示例15: Load

        public override void Load()
        {
            try
            {
                IsEnabled = true;
                _kinect = KinectSensor.KinectSensors[0];

                var parameters = new TransformSmoothParameters
                {
                    Smoothing = 0.3f,
                    Correction = 0.0f,
                    Prediction = 0.0f,
                    JitterRadius = 1.0f,
                    MaxDeviationRadius = 0.5f
                };
                _kinect.SkeletonStream.Enable(parameters);

                _kinect.AllFramesReady += _kinect_AllFramesReady;
                _kinect.Start();

                RawRotation = Quaternion.Identity;
            }
            catch (Exception exc)
            {
                Logger.Instance.Error(exc.Message, exc);
                IsEnabled = false;
            }
        }
开发者ID:Inner-room,项目名称:VrPlayer,代码行数:28,代码来源:KinectTracker.cs


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