Пример #1
0
        public void Initialize()
        {
            if (!_Initialized)
            {
                // _MainThreadID = Thread.CurrentThread.ManagedThreadId;

                int deviceCount = AzureKinectSensor.GetDeviceCount();
                for (int i = 0; i < deviceCount; i++)
                {
                    var kinectSensor = new AzureKinectSensor(ColorImageFormat, ColorCameraMode, DepthCameraMode);
                    if (kinectSensor.OpenSensor(i))
                    {
                        _AzureKinectSensorList.Add(kinectSensor);
                        _DeviceSerialNumList.Add(kinectSensor.Device.SerialNum);
                        _CancellationTokenSourceList.Add(new CancellationTokenSource());

                        kinectSensor.CloseSensor();
                    }
                }

                _Initialized = true;
            }
        }
Пример #2
0
 void OnDestroy()
 {
     _CancellationTokenSource.Cancel();
     _AzureKinectSensor.CloseSensor();
 }