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


C# KinectSensor.OpenMultiSourceFrameReader方法代码示例

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


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

示例1: Window_Loaded

        // Primary function. Runs when the window loads in.
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

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

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

                _bodyReader = _sensor.BodyFrameSource.OpenReader();
                _bodyReader.FrameArrived += BodyReader_FrameArrived;

                // 2) Initialize the face source with the desired features
                _faceSource = new FaceFrameSource(_sensor, 0, FaceFrameFeatures.BoundingBoxInColorSpace |
                                                              FaceFrameFeatures.FaceEngagement |
                                                              FaceFrameFeatures.Glasses |
                                                              FaceFrameFeatures.Happy |
                                                              FaceFrameFeatures.LeftEyeClosed |
                                                              FaceFrameFeatures.MouthOpen |
                                                              FaceFrameFeatures.PointsInColorSpace |
                                                              FaceFrameFeatures.RightEyeClosed);
                _faceReader = _faceSource.OpenReader();
                _faceReader.FrameArrived += FaceReader_FrameArrived;
            }
        }
开发者ID:tomgarcia,项目名称:kinect-iot,代码行数:30,代码来源:MainWindow.xaml.cs

示例2: KinectStreamer

        private KinectStreamer()
        {
            KinectStreamerConfig = new KinectStreamerConfig();

            kinectSensor = KinectSensor.GetDefault();

            CoordinateMapper = kinectSensor.CoordinateMapper;

            multiSourceFrameReader = kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Depth | FrameSourceTypes.Color | FrameSourceTypes.Body);

            multiSourceFrameReader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

            ColorFrameDescription = kinectSensor.ColorFrameSource.FrameDescription;

            DepthFrameDescription = kinectSensor.DepthFrameSource.FrameDescription;

            depthBitmap = new WriteableBitmap(DepthFrameDescription.Width, DepthFrameDescription.Height, 96.0, 96.0, PixelFormats.Gray8, null);

            colorBitmap = new WriteableBitmap(ColorFrameDescription.Width, ColorFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);

            bitmapBackBufferSize = (uint)((colorBitmap.BackBufferStride * (colorBitmap.PixelHeight - 1)) + (colorBitmap.PixelWidth * this.bytesPerPixel));

            colorPixels = new byte[ColorFrameDescription.Width * ColorFrameDescription.Height];

            depthPixels = new byte[DepthFrameDescription.Width * DepthFrameDescription.Height];

            depthArray = new ushort[DepthFrameDescription.Width * DepthFrameDescription.Height];

            SetupBody();

            kinectSensor.Open();
        }
开发者ID:kovand11,项目名称:kinect-demo,代码行数:32,代码来源:KinectStreamer.cs

示例3: KinectReader

 public KinectReader(WriteableBitmap depthBitmap, WriteableBitmap colorBitmap)
 {
     this.depthBitmap = depthBitmap;
     this.colorBitmap = colorBitmap;
     this.sensor = KinectSensor.GetDefault();
     sensor.Open();
     this.reader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Depth | FrameSourceTypes.Color);
     reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
 }
开发者ID:guozanhua,项目名称:KinectRobot,代码行数:9,代码来源:KinectController.cs

示例4: Core

        public Core()
        {
            InitExercises();

            sensor = KinectSensor.GetDefault();
            sensor.Open();

            reader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
            frameLock = new Mutex();
        }
开发者ID:rfratila,项目名称:a-team,代码行数:10,代码来源:Core.cs

示例5: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            mySensor = KinectSensor.GetDefault();
            mySensor.Open();
            myReader = mySensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Body);
            myReader.MultiSourceFrameArrived += myReader_MultiSourceFrameArrived;

            myBitmap = new WriteableBitmap(1920, 1080, 96.0, 96.0, PixelFormats.Pbgra32, null);
            image1.Source = myBitmap;
        }
开发者ID:TAMHAN,项目名称:ImagineProjPageTest,代码行数:11,代码来源:MainWindow.xaml.cs

示例6: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
            }
        }
开发者ID:Caribpa,项目名称:NPI---Kinect-2.0,代码行数:12,代码来源:MainWindow_Backup.xaml.cs

示例7: KinectFrameServer

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="port">Server port</param>
        /// <param name="sensor"></param>
        public KinectFrameServer(int port, KinectSensor sensor)
        {
            this.sensor = sensor;
            this.listener = new KinectClientListener(port);
            this.listener.ClientConnected += listener_ClientConnected;

            this.depthCompressor = new SnappyFrameCompressor(KinectFrameInformation.DepthFrame);
            this.bodyIndexCompressor = new SnappyFrameCompressor(KinectFrameInformation.BodyIndexFrame);

            this.multiSourceReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.BodyIndex | FrameSourceTypes.Depth);
            this.multiSourceReader.MultiSourceFrameArrived += multiSourceReader_MultiSourceFrameArrived;
        }
开发者ID:semihguresci,项目名称:kgp,代码行数:17,代码来源:KinectFrameServer.cs

示例8: BackgroundRemovalPage

        public BackgroundRemovalPage()
        {
            InitializeComponent();

            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body | FrameSourceTypes.BodyIndex);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
            }
        }
开发者ID:L-SEG,项目名称:Vitruvius,代码行数:14,代码来源:BackgroundRemovalPage.xaml.cs

示例9: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _kinectSensor = KinectSensor.GetDefault();
            InitializeInfrared();
            _kinectSensor.Open();

            if (_kinectSensor != null)
            {
                _utils = new Utils(_kinectSensor.CoordinateMapper);
                _reader =
                    _kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth |
                                                             FrameSourceTypes.BodyIndex);
            }
            _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
        }
开发者ID:franklinNCAT,项目名称:KinectPulseMonitor,代码行数:15,代码来源:MainWindow.xaml.cs

示例10: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                // 2) Initialize the background removal tool.
                _backgroundRemovalTool = new BackgroundRemovalTool(_sensor.CoordinateMapper);

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.BodyIndex);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
            }
        }
开发者ID:guozanhua,项目名称:kinect-2-background-removal,代码行数:15,代码来源:MainWindow.xaml.cs

示例11: Main

        static void Main(string[] args)
        {
            sensor = KinectSensor.GetDefault();

            sensor.IsAvailableChanged += Sensor_IsAvailableChanged;

            sensor.Open();

            _multiReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body);

            _multiReader.MultiSourceFrameArrived += OnMultipleFramesArrivedHandler;

            VirtualMouse.MoveTo(900, 39);
            VirtualMouse.LeftClick();
            Console.ReadKey();
        }
开发者ID:Sheepzez,项目名称:yorkhill-kinect,代码行数:16,代码来源:Program.cs

示例12: GesturesPage

        public GesturesPage()
        {
            InitializeComponent();

            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

                _gestureController = new GestureController();
                _gestureController.GestureRecognized += GestureController_GestureRecognized;
            }
        }
开发者ID:L-SEG,项目名称:Vitruvius,代码行数:17,代码来源:GesturesPage.xaml.cs

示例13: FrameReader

        public FrameReader()
        {
            _sensor = KinectSensor.GetDefault();

            if (_sensor == null)
            {
                throw new ScannerNotFoundException("No valid plugged-in Kinect sensor found.");
            }

            if (!_sensor.IsOpen)
            {
                _sensor.Open();
            }

            _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body | FrameSourceTypes.BodyIndex);
            _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;
        }
开发者ID:shirshmx,项目名称:Monocle-Record-Rssdk,代码行数:17,代码来源:FrameReader.cs

示例14: InitializeSceen

        private void InitializeSceen()
        {
            _sensor = KinectSensor.GetDefault();
            _sensor.Open();

            FrameDescription colorFrameDescription = _sensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Bgra);

            // create the bitmap to display
            this._colorBitmap = new WriteableBitmap(colorFrameDescription.Width, colorFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);

            _jedi = new JediGestureRecognizer(_sensor);
            _jedi.ForceApplying += ForceApplying;
            _jedi.ForceDispel += ForceDispel;

            _frameReader =  _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body | FrameSourceTypes.Depth | FrameSourceTypes.Color);

            _frameReader.MultiSourceFrameArrived +=MultiSourceFrameArrived;
        }
开发者ID:RomaRudyak,项目名称:start-wars-move-the-sphero,代码行数:18,代码来源:MainWindow.xaml.cs

示例15: AnglePage

        public AnglePage()
        {
            InitializeComponent();

            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

                _userReporter = new PlayersController();
                _userReporter.BodyEntered += UserReporter_BodyEntered;
                _userReporter.BodyLeft += UserReporter_BodyLeft;
                _userReporter.Start();
            }
        }
开发者ID:L-SEG,项目名称:Vitruvius,代码行数:19,代码来源:AnglePage.xaml.cs


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