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


C# KinectSensor.OpenMultiSourceFrameReader方法代码示例

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


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

示例1: MainPage

        public MainPage()
        
        {
           
            InitializeComponent();
            
            _navigationHelper = new NavigationHelper(this);

            _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;
            }
            // Initialize the gesture detection objects for our gestures
            this.gestureDetectorList = new List<GestureDetector>();

            // Create a gesture detector for each body (6 bodies => 6 detectors)
            int maxBodies = this._sensor.BodyFrameSource.BodyCount;
            for (int i = 0; i < maxBodies; ++i)
            {
                GestureResultView result =
                     new GestureResultView(i, false, false, 0.0f);
                GestureDetector detector =
                    new GestureDetector(this._sensor, result);
                result.PropertyChanged += GestureResult_PropertyChanged;
                this.gestureDetectorList.Add(detector);
            }
        }
开发者ID:akashdeepgoel,项目名称:Identified-Flying-Object,代码行数:35,代码来源:MainPage.xaml.cs

示例2: Page_Loaded

        private void Page_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;

                _gestureController = new GestureController(GestureType.All);
                _gestureController.GestureRecognized += GestureController_GestureRecognized;
            }
        }
开发者ID:etrigger,项目名称:Vitruvius,代码行数:15,代码来源:MainPage.xaml.cs

示例3: BackgroundRemovalPage

        public BackgroundRemovalPage()
        {
            InitializeComponent();
            
            _navigationHelper = new NavigationHelper(this);

            _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,代码行数:16,代码来源:BackgroundRemovalPage.xaml.cs

示例4: GesturesPage

        public GesturesPage()
        {
            InitializeComponent();

            _navigationHelper = new NavigationHelper(this);

            _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:leemtion,项目名称:Vitruvius,代码行数:19,代码来源:GesturesPage.xaml.cs

示例5: SnapHand

        public SnapHand()
        {
            this.InitializeComponent();

            _sensor = KinectSensor.GetDefault();

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

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

                _playersController = new PlayersController();
                _playersController.BodyEntered += UserReporter_BodyEntered;
                _playersController.BodyLeft += UserReporter_BodyLeft;
                _playersController.Start();
            }
            viewer.Visualization = Visualization.Color;
        }
开发者ID:projetoliki,项目名称:SnapHand,代码行数:20,代码来源:SnapHand.xaml.cs

示例6: CameraPage

        public CameraPage()
        {
            InitializeComponent();

            _navigationHelper = new NavigationHelper(this);

            _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 UsersController();
                _userReporter.BodyEntered += UserReporter_BodyEntered;
                _userReporter.BodyLeft += UserReporter_BodyLeft;
                _userReporter.Start();
            }
        }
开发者ID:leemtion,项目名称:Vitruvius,代码行数:21,代码来源:CameraPage.xaml.cs

示例7: OnNavigatedTo

        protected override void OnNavigatedTo( NavigationEventArgs e )
        {
            base.OnNavigatedTo( e );

            try {
                kinect = KinectSensor.GetDefault();
                kinect.Open();

                mapper = kinect.CoordinateMapper;

                // カラー画像の情報を作成する(BGRAフォーマット)
                colorFrameDesc = kinect.ColorFrameSource.CreateFrameDescription(
                                                        colorFormat );
                colorBuffer = new byte[colorFrameDesc.LengthInPixels *
                                       colorFrameDesc.BytesPerPixel];

                // Depthデータの情報を取得する
                depthFrameDesc = kinect.DepthFrameSource.FrameDescription;
                depthBuffer = new ushort[depthFrameDesc.LengthInPixels];

                // BodyIndexデータの情報を取得する
                var bodyIndexFrameDesc = kinect.BodyIndexFrameSource.FrameDescription;
                bodyIndexBuffer = new byte[bodyIndexFrameDesc.LengthInPixels];

                // フレームリーダーを開く
                multiReader = kinect.OpenMultiSourceFrameReader(
                    FrameSourceTypes.Color |
                    FrameSourceTypes.Depth |
                    FrameSourceTypes.BodyIndex );

                multiReader.MultiSourceFrameArrived += multiReader_MultiSourceFrameArrived;
            }
            catch ( Exception ex ) {
                MessageDialog dlg = new MessageDialog(ex.Message);
                dlg.ShowAsync();
            }
        }
开发者ID:noa99kee,项目名称:K4W2-Book,代码行数:37,代码来源:MainPage.xaml.cs

示例8: MainPage

        public MainPage()
        {
            frame_counter=0;
            // one sensor is currently supported
            kinectSensor= KinectSensor.GetDefault();

            SetupCurrentDisplay(DEFAULT_DISPLAYFRAMETYPE);

            coordinateMapper=kinectSensor.CoordinateMapper;

            multiSourceFrameReader=kinectSensor.OpenMultiSourceFrameReader(FrameSourceTypes.Infrared | FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.BodyIndex | FrameSourceTypes.Body);
            
            // wire handler for frame arrival
            multiSourceFrameReader.MultiSourceFrameArrived +=Reader_MultiSourceFrameArrived;
            //multiSourceFrameReader.MultiSourceFrameArrived+=SensorSkeletonFrameReady;
            multiSourceFrameReader.MultiSourceFrameArrived+=WritingData;


            // set IsAvailableChanged event notifier
            kinectSensor.IsAvailableChanged +=Sensor_IsAvailableChanged;

            // use the window object as the view model in this simple example
            DataContext= this;

            Datapreparing=new DataPreparing();

            // open the sensor
            kinectSensor.Open();
            InitializeComponent();
            //this.Suspending+=OnSuspending;
            CreateDelayTimer();
        }
开发者ID:Wyswist,项目名称:Kinect-plus-SharpDX,代码行数:32,代码来源:MainPage.xaml.cs

示例9: MainPage_Loaded

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            sensor = KinectSensor.GetDefault();
            irReader = sensor.InfraredFrameSource.OpenReader();
            FrameDescription fd = sensor.InfraredFrameSource.FrameDescription;
            irData = new ushort[fd.LengthInPixels];
            irDataConverted = new byte[fd.LengthInPixels * 4];
            irBitmap = new WriteableBitmap(fd.Width, fd.Height);
            image.Source = irBitmap;

            bodies = new Body[6];
            msfr = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Body | FrameSourceTypes.Infrared);
            msfr.MultiSourceFrameArrived += msfr_MultiSourceFrameArrived;

            sensor.Open();
        }
开发者ID:foodtaste-senior-design,项目名称:KinectSample,代码行数:16,代码来源:MainPage.xaml.cs


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