Пример #1
0
        /// <summary>
        /// Build depth bitmap.
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="bitmap"></param>
        /// <param name="withLock"></param>
        /// <param name="segmentation"></param>
        public void BuildDepthBitmap(DepthFrame depthFrame, SmallFrameBitmap bitmap, bool withLock)
        {
            depthFrame.CopyFrameDataToArray(_depthData);

            _displayFilter.Init(
                DisplayFilterMode.Rainbow,
                Frame.DEPTH_INFRARED_WIDTH,
                Frame.DEPTH_INFRARED_HEIGHT,
                0,
                depthFrame.DepthMaxReliableDistance,
                depthFrame.DepthMinReliableDistance
                );

            Array.Clear(_depthPixels, 0, _depthPixels.Length);
            _displayFilter.Apply(_depthData, _depthPixels, null);

            WriteableBitmap outBitmap = bitmap.Bitmap;

            ValidateBitmap(outBitmap, Frame.DEPTH_INFRARED_WIDTH, Frame.DEPTH_INFRARED_HEIGHT);
            CopyToDisplay(outBitmap, _depthPixels, withLock);
        }
Пример #2
0
        public void BuildInfraredBitmap(InfraredFrame infraredFrame, SmallFrameBitmap bitmap, bool withLock)
        {
            infraredFrame.CopyFrameDataToArray(_infraredData);

            _displayFilter.Init(
                DisplayFilterMode.GrayScale,
                Frame.DEPTH_INFRARED_WIDTH,
                Frame.DEPTH_INFRARED_HEIGHT,
                0,
                int.MaxValue,
                int.MinValue
                );

            Array.Clear(_infraredPixels, 0, _infraredPixels.Length);
            _displayFilter.Apply(_infraredData, _infraredPixels, null);

            WriteableBitmap outBitmap = bitmap.Bitmap;

            ValidateBitmap(outBitmap, Frame.DEPTH_INFRARED_WIDTH, Frame.DEPTH_INFRARED_HEIGHT);
            CopyToDisplay(outBitmap, _infraredPixels, withLock);
        }
        public void BuildInfraredBitmap(InfraredFrame infraredFrame, SmallFrameBitmap bitmap, bool withLock)
        {
            infraredFrame.CopyFrameDataToArray(_infraredData);

            _displayFilter.Init(
                DisplayFilterMode.GrayScale,
                Frame.DEPTH_INFRARED_WIDTH,
                Frame.DEPTH_INFRARED_HEIGHT,
                0,
                int.MaxValue,
                int.MinValue
            );

            Array.Clear(_infraredPixels, 0, _infraredPixels.Length);
            _displayFilter.Apply(_infraredData, _infraredPixels, null);

            WriteableBitmap outBitmap = bitmap.Bitmap;
            ValidateBitmap(outBitmap, Frame.DEPTH_INFRARED_WIDTH, Frame.DEPTH_INFRARED_HEIGHT);
            CopyToDisplay(outBitmap, _infraredPixels, withLock);
        }
        /// <summary>
        /// Build depth bitmap.
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="bitmap"></param>
        /// <param name="withLock"></param>
        /// <param name="segmentation"></param>
        public void BuildDepthBitmap(DepthFrame depthFrame, SmallFrameBitmap bitmap, bool withLock)
        {
            depthFrame.CopyFrameDataToArray(_depthData);

            _displayFilter.Init(
                DisplayFilterMode.Rainbow,
                Frame.DEPTH_INFRARED_WIDTH,
                Frame.DEPTH_INFRARED_HEIGHT,
                0,
                depthFrame.DepthMaxReliableDistance,
                depthFrame.DepthMinReliableDistance
            );

            Array.Clear(_depthPixels, 0, _depthPixels.Length);
            _displayFilter.Apply(_depthData, _depthPixels, null);

            WriteableBitmap outBitmap = bitmap.Bitmap;
            ValidateBitmap(outBitmap, Frame.DEPTH_INFRARED_WIDTH, Frame.DEPTH_INFRARED_HEIGHT);
            CopyToDisplay(outBitmap, _depthPixels, withLock);
        }