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


C# TransformSmoothParameters类代码示例

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


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

示例1: initializ

        //Methode d'initialisation
        public void initializ()
        {
            //on associe a port , le port USB COM3
            port = new SerialPort ("COM3", 9600);
            //On ouvre le port pour l'envoie des données
            port.Open ();
            //On recupere la Kinect
            sensor = KinectSensor.KinectSensors[0];

               			// SmoothParamater pour reduire les interferances sur le SkeletonStream
            TransformSmoothParameters parameters = new TransformSmoothParameters{
                Smoothing = 0.3f,
                Correction = 0.0f,
                Prediction = 0.0f,
                JitterRadius = 1.0f,
                MaxDeviationRadius = 0.5f
            };
            //On demare la capture
            sensor.Start();
              			// Ouverture des flux
            sensor.ColorStream.Enable();
            sensor.DepthStream.Enable();
            sensor.SkeletonStream.Enable(parameters);
            //on ouvre une frame toute les 33 millisecondes
            //soit environ 30 images secondes.
            sensor.SkeletonStream.OpenNextFrame(33);
            //le Tracking du skelette est réalisé par défault:
                //20 joints , quelque soit la position de l'utilisateur.
            sensor.SkeletonStream.TrackingMode = SkeletonTrackingMode.Default;
            return;
        }
开发者ID:ClementDubos,项目名称:ProjetKinect,代码行数:32,代码来源:BetaInit.cs

示例2: StartKinectSensor

        public void StartKinectSensor()
        {
            kinect = KinectSensor.KinectSensors[0];
            if (kinect.Status == KinectStatus.Connected)
            {
                kinect.SkeletonStream.Enable();
                kinect.SkeletonStream.TrackingMode = SkeletonTrackingMode.Seated;

                TransformSmoothParameters smoothingParam = new TransformSmoothParameters();
                {
                    smoothingParam.Smoothing = 0.5f;
                    smoothingParam.Correction = 0.1f;
                    smoothingParam.Prediction = 0.5f;
                    smoothingParam.JitterRadius = 0.1f;
                    smoothingParam.MaxDeviationRadius = 0.1f;
                };

                kinect.SkeletonStream.Enable(smoothingParam); // Enable skeletal tracking

                skeletonData = new Skeleton[kinect.SkeletonStream.FrameSkeletonArrayLength];
                kinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(kinect_SkeletonFrameReady);
                kinect.Start();
            }
            else
                Console.WriteLine("No Kinect Found");
        }
开发者ID:jmoyers14,项目名称:AIProject,代码行数:26,代码来源:kinectPoints.cs

示例3: SkeletonSlam

        /// <summary>
        /// Starts up the SkeletonSlam class.
        /// </summary>
        public SkeletonSlam()
        {
            halfSpinFlag = false;
            fullSpinFlag = false;

            fullRightFlag = false;
            fullLeftFlag = false;
            halfSpinRightFlag = false;
            halfSpinLeftFlag = false;
            quarterRightFlag = false;
            quarterLeftFlag = false;

            //kinectSensor = KinectSensor.KinectSensors[0];

            TransformSmoothParameters smoothingParam = new TransformSmoothParameters();
            {
                smoothingParam.Smoothing = 0.5f;
                smoothingParam.Correction = 0.5f;
                smoothingParam.Prediction = 0.5f;
                smoothingParam.JitterRadius = 0.05f;
                smoothingParam.MaxDeviationRadius = 0.04f;
            };

            //kinectSensor.SkeletonStream.Enable(smoothingParam);
            //kinectSensor.Start();

            reset();

            //kinectSensor.SkeletonFrameReady += getSkeleton;

            //processHandMove = new Thread(ProcessHandMove);
            //processHandMove.Start();
        }
开发者ID:Blargansmarf,项目名称:Rizzy-Project,代码行数:36,代码来源:SkeletonSlam.cs

示例4: startKinect

        private void startKinect()
        {
            if (KinectSensor.KinectSensors.Count > 0)
            {
                // Choose the first Kinect device
                kinect = KinectSensor.KinectSensors[0];
                if (kinect == null)
                    return;

                kinect.ColorStream.Enable();

                var tsp = new TransformSmoothParameters
                {
                    Smoothing = 0.5f,
                    Correction = 0.5f,
                    Prediction = 0.5f,
                    JitterRadius = 0.05f,
                    MaxDeviationRadius = 0.04f
                };
                kinect.SkeletonStream.Enable(tsp);

                // Start skeleton tracking
                //kinect.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(kinect_ColorFrameReady);
                //kinect.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(kinect_SkeletonFrameReady);

                // Start Kinect device
                kinect.Start();
            }
            else
            {
                MessageBox.Show("No Kinect Device found.");
            }
        }
开发者ID:BilldBird,项目名称:Kinect_Fitness,代码行数:33,代码来源:logout.xaml.cs

示例5: startKinect

		private void startKinect()
		{
			if (KinectSensor.KinectSensors.Count > 0)
			{
				kinect = KinectSensor.KinectSensors[0];
				if (kinect == null)
				{
                return;
				}
				//Get Depth Stream, Color Stream
				kinect.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
				kinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
				var parameters = new TransformSmoothParameters
				{
					Smoothing = 0.5f,
					Correction = 0.5f,
					Prediction = 0.5f,
					JitterRadius = 0.05f,
					MaxDeviationRadius = 0.04f
				};
				kinect.SkeletonStream.Enable(parameters);

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

                kinectColorViewer1.Kinect = kinect;
                //kinectSkeletonViewer1.Kinect = kinect;
				kinect.Start();
				//OperationRecognizer();
			}
			else
			{
				MessageBox.Show("No kinect device found");
			}
		}
开发者ID:BilldBird,项目名称:Kinect_Fitness,代码行数:34,代码来源:MainWindow.xaml.cs

示例6: StartKinect

        public void StartKinect()
        {
            // Checks to see how many Kinects are connected to the system. If None then exit.
            if (KinectSensor.KinectSensors.Count == 0)
            {
                Console.Out.WriteLine("There are no Kinects Connected");
                return;
            }

            // If there is a Kinect connected, get the Kinect
            ks = KinectSensor.KinectSensors[0];
            ks.Start();
            //Sets the initial elevation angle of the connect to 0 degrees
            ks.ElevationAngle = 0;

            // Set smoothing parameters for when Kinect is tracking a skeleton
            TransformSmoothParameters parameters = new TransformSmoothParameters()
            {
                Smoothing = 0.7f,
                Correction = 0.3f,
                Prediction = 0.4f,
                JitterRadius = 1.0f,
                MaxDeviationRadius = 0.5f,
            };

            ks.SkeletonStream.Enable(parameters);
            ks.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(ks_SkeletonFrameReady);
        }
开发者ID:ase-lab,项目名称:MSEAPI,代码行数:28,代码来源:KinectCamera.cs

示例7: 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

示例8: Initialize

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here
            //initialize Kinect SDK
            LoadGameComponents();
            kinectSensor = (from sensorToCheck in KinectSensor.KinectSensors
                            where sensorToCheck.Status == KinectStatus.Connected
                            select sensorToCheck).FirstOrDefault();

            kinectSensor.DepthStream.Enable();
            TransformSmoothParameters param = new TransformSmoothParameters();
            param.Smoothing = 0.2f;
            param.Correction = 0.0f;
            param.Prediction = 0.0f;
            param.JitterRadius = 0.2f;
            param.MaxDeviationRadius = 0.3f;

            kinectSensor.SkeletonStream.Enable(param);
            kinectSensor.Start();

            kinectSensor.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(kinectSensor_AllFrameReady);

            //setup speech recognition
               // SetupSpeech();

            base.Initialize();
        }
开发者ID:pengare,项目名称:flocking,代码行数:31,代码来源:Kinect.cs

示例9: SetupKinect

        private void SetupKinect()
        {
            // Check to see if there are any Kinect devices connected.
            if (Runtime.Kinects.Count == 0)
            {
                MessageBox.Show("No Kinect connected");
            }
            else
            {
                // Use first Kinect.
                kinectRuntime = Runtime.Kinects[0];

                // Initialize to return skeletal data.
                kinectRuntime.Initialize(RuntimeOptions.UseSkeletalTracking);

                // Attach to the event to receive skeleton frame data.
                kinectRuntime.SkeletonFrameReady += KinectRuntime_SkeletonFrameReady;

                kinectRuntime.SkeletonEngine.TransformSmooth = true;

                TransformSmoothParameters parameters = new TransformSmoothParameters();
                parameters.Smoothing = 0.5f;
                parameters.Correction = 0.3f;
                parameters.Prediction = 0.2f;
                parameters.JitterRadius = .2f;
                parameters.MaxDeviationRadius = 0.5f;

                kinectRuntime.SkeletonEngine.SmoothParameters = parameters;

                kinectRuntime.NuiCamera.ElevationAngle = 0;
            }
        }
开发者ID:NashDotNet,项目名称:Intro-to-Developing-for-the-Kinect,代码行数:32,代码来源:MainWindow.xaml.cs

示例10: KinectNuiService

        public KinectNuiService()
        {
            if (KinectSensor.KinectSensors.Count == 0)
            {
                return;
            }

            this.handsRaisingStart = new Dictionary<JointType, DateTime>();
            this.handsRaising = new Dictionary<JointType, bool>();
            this.handsWaitingToLower = new Dictionary<JointType, bool>();
            this.BoundsWidth = .5d;
            this.BoundsDepth = .5d;
            this.MinDistanceFromCamera = 1.0d;
            this.sensor = KinectSensor.KinectSensors[0];
            this.sensor.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(sensor_AllFramesReady);
            this.initialized = true;

            var parameters = new TransformSmoothParameters();
            parameters.Smoothing = 0.7f;
            parameters.Correction = 0.9f;
            parameters.Prediction = 0.5f;
            parameters.JitterRadius = 0.5f;
            parameters.MaxDeviationRadius = 0.5f;

            this.sensor.SkeletonStream.Enable(parameters);
            this.sensor.SkeletonStream.Enable();
            this.sensor.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);

            this.sensor.Start();
            DebugLogWriter.WriteMessage("Kinect initialized.");
        }
开发者ID:kindohm,项目名称:getstem-kinect-3d,代码行数:31,代码来源:KinectNuiService.cs

示例11: kinectSensorChooser1_KinectSensorChanged

        void kinectSensorChooser1_KinectSensorChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            KinectSensor oldSensor = (KinectSensor)e.OldValue;
            stopKinect(oldSensor);
            KinectSensor newSensor = (KinectSensor)e.NewValue;

            newSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
            newSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            var parameters = new TransformSmoothParameters
            {
                Smoothing = 0.3f,
                Correction = 0.0f,
                Prediction = 0.0f,
                JitterRadius = 1.0f,
                MaxDeviationRadius = 0.5f
            };
            //newSensor.SkeletonStream.Enable(parameters);
            newSensor.SkeletonStream.Enable();
            newSensor.AllFramesReady += new EventHandler<AllFramesReadyEventArgs>(newSensor_AllFramesReady);
            try
            {
                newSensor.Start();
            }
            catch (System.IO.IOException)
            {
                kinectSensorChooser1.AppConflictOccurred();
            }
        }
开发者ID:bcoleman532,项目名称:Interactive-Prototype,代码行数:28,代码来源:MainWindow.xaml.cs

示例12: SmoothingParams

        private static TransformSmoothParameters SmoothingParams()
        {
            TransformSmoothParameters verySmoothParam = new TransformSmoothParameters();
            {
                verySmoothParam.Smoothing = 0.7f;
                verySmoothParam.Correction = 0.3f;
                verySmoothParam.Prediction = 1.0f;
                verySmoothParam.JitterRadius = 1.0f;
                verySmoothParam.MaxDeviationRadius = 1.0f;
            };

            TransformSmoothParameters smoothParam = new TransformSmoothParameters();
            {
                smoothParam.Smoothing = 0.5f;
                smoothParam.Correction = 0.1f;
                smoothParam.Prediction = 0.5f;
                smoothParam.JitterRadius = 0.1f;
                smoothParam.MaxDeviationRadius = 0.1f;
            };

            TransformSmoothParameters fastSmoothingParam = new TransformSmoothParameters();
            {
                fastSmoothingParam.Smoothing = 0.5f;
                fastSmoothingParam.Correction = 0.5f;
                fastSmoothingParam.Prediction = 0.5f;
                fastSmoothingParam.JitterRadius = 0.05f;
                fastSmoothingParam.MaxDeviationRadius = 0.04f;
            };

            return verySmoothParam;
        }
开发者ID:mhope,项目名称:trellokinectcontrol,代码行数:31,代码来源:KinectControl.cs

示例13: VoiceControl

        /// <summary>
        /// Starts up the SkeletonSlam class.
        /// </summary>
        public VoiceControl()
        {
            kinectSensor = KinectSensor.KinectSensors[0];

            TransformSmoothParameters smoothingParam = new TransformSmoothParameters();
            {
                smoothingParam.Smoothing = 0.5f;
                smoothingParam.Correction = 0.5f;
                smoothingParam.Prediction = 0.5f;
                smoothingParam.JitterRadius = 0.05f;
                smoothingParam.MaxDeviationRadius = 0.04f;
            };

            kinectSensor.SkeletonStream.Enable(smoothingParam);

            kinectSensor.SkeletonFrameReady += getSkeleton;

            sre = CreateSpeechRecognizer();

            kinectSensor.Start();

            sre.SetInputToAudioStream(kinectSensor.AudioSource.Start(),
                 new SpeechAudioFormatInfo(
                 EncodingFormat.Pcm, 16000, 16, 1,
                 32000, 2, null));

            sre.RecognizeAsync(RecognizeMode.Multiple);

            reset();
        }
开发者ID:Blargansmarf,项目名称:Rizzy-Project,代码行数:33,代码来源:VoiceControl.cs

示例14: StartKinectST

        //Méthode d'initialisation de la Kinect
        public void StartKinectST()
        {
            //Instancitation d'un objet kinectSensor
            kinectSensor = KinectSensor.KinectSensors[0];
            kinectSensor.Start();

            // SmoothParamater pour éliminer le bruit
            TransformSmoothParameters parameters = new TransformSmoothParameters
            {
                Smoothing = 0.3f,
                Correction = 0.0f,
                Prediction = 0.0f,
                JitterRadius = 1.0f,
                MaxDeviationRadius = 0.5f
            };

            // Ouverture des flux
            kinectSensor.ColorStream.Enable();
            kinectSensor.DepthStream.Enable();

            kinectSensor.SkeletonStream.Enable(parameters);

            kinectSensor.SkeletonStream.OpenNextFrame(33);
            kinectSensor.SkeletonStream.TrackingMode = SkeletonTrackingMode.Default;

            kinectSensor.SkeletonFrameReady += kinect_SkeletonFrameReady;
            while (true)
            {

            }
        }
开发者ID:ClementDubos,项目名称:ProjetKinectTest,代码行数:32,代码来源:InitTestMove.cs

示例15: SetupKinect

        private void SetupKinect()
        {
            if (Runtime.Kinects.Count == 0)
            {
                this.Title = "No Kinect connected"; 
            }
            else
            {
                //use first Kinect
                nui = Runtime.Kinects[0];

                //Initialize to do skeletal tracking
                nui.Initialize(RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor | RuntimeOptions.UseDepthAndPlayerIndex);

                //add event to receive skeleton data
                nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

                //to experiment, toggle TransformSmooth between true & false and play with parameters            
                nui.SkeletonEngine.TransformSmooth = true;
                TransformSmoothParameters parameters = new TransformSmoothParameters();
                // parameters used to smooth the skeleton data
                parameters.Smoothing = 0.3f;
                parameters.Correction = 0.3f;
                parameters.Prediction = 0.4f;
                parameters.JitterRadius = 0.7f;
                parameters.MaxDeviationRadius = 0.2f;
                nui.SkeletonEngine.SmoothParameters = parameters;

            }
        }
开发者ID:guozanhua,项目名称:kinect-earth,代码行数:30,代码来源:MainWindow.xaml.cs


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