コード例 #1
0
        public KinectDevice()
        {
            //_faceTracker = new FaceTrackerData();
            _skeletonTracker = new SkeletonTrackerData();
            _streamWriter    = new StreamWriter();

            // for Alpha, one sensor is supported
            _currentSensor = KinectSensor.Default;

            if (_currentSensor != null)
            {
                // get the coordinate mapper
                _coordinateMapper = _currentSensor.CoordinateMapper;

                // open the sensor
                _currentSensor.Open();

                // get the depth (display) extents
                FrameDescription frameDescription = _currentSensor.DepthFrameSource.FrameDescription;

                _bodies = new Body[_currentSensor.BodyFrameSource.BodyCount];

                // open the reader for the body frames
                _reader = _currentSensor.BodyFrameSource.OpenReader();

                if (_reader != null)
                {
                    _reader.FrameArrived += Reader_FrameArrived;
                }

                // set the status text
                Console.WriteLine("d|Found a sensor");
                //this.StatusText = Properties.Resources.InitializingStatusTextFormat;
            }
            else
            {
                // on failure, set the status text
                Console.WriteLine("d|No sensor found");
                //this.StatusText = Properties.Resources.NoSensorStatusText;
            }
        }
コード例 #2
0
        public KinectDevice()
        {
            //_faceTracker = new FaceTrackerData();
            _skeletonTracker = new SkeletonTrackerData();
            _streamWriter = new StreamWriter();

            // for Alpha, one sensor is supported
            _currentSensor = KinectSensor.Default;

            if (_currentSensor != null)
            {
                // get the coordinate mapper
                _coordinateMapper = _currentSensor.CoordinateMapper;

                // open the sensor
                _currentSensor.Open();

                // get the depth (display) extents
                FrameDescription frameDescription = _currentSensor.DepthFrameSource.FrameDescription;

                _bodies = new Body[_currentSensor.BodyFrameSource.BodyCount];

                // open the reader for the body frames
                _reader = _currentSensor.BodyFrameSource.OpenReader();

                if (_reader != null)
                {
                    _reader.FrameArrived += Reader_FrameArrived;
                }

                // set the status text
                Console.WriteLine("d|Found a sensor");
                //this.StatusText = Properties.Resources.InitializingStatusTextFormat;
            }
            else
            {
                // on failure, set the status text
                Console.WriteLine("d|No sensor found");
                //this.StatusText = Properties.Resources.NoSensorStatusText;
            }
        }