예제 #1
0
        public void SetDepthBitmap()
        {
            //for image viewing - rotate by 180 degrees
            //this.DepthMetaData.FrameData = DepthMetaData.RotateDepthFrame(this.DepthMetaData.FrameData, DepthMetaData.XResDefault, DepthMetaData.YResDefault);

            this.imageDepth.Source = WriteableBitmapUtils.FromByteArray_ToGray(this.DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);
        }
예제 #2
0
        public static WriteableBitmap FromUShort(ushort[] myDepthFrame)
        {
            byte[]          pixels      = ImageExtensions.ConvertUshortToByte(myDepthFrame);
            WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);

            return(depthBitmap);
        }
예제 #3
0
 public DepthMetaData(List <OpenTK.Vector3> vectors, bool createBitmap)
 {
     this.FrameData = FromVector3List(vectors);
     if (createBitmap)
     {
         this.pixels = ImageExtensions.ConvertUshortToByte(this.FrameData);
         depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);
     }
 }
예제 #4
0
        public static WriteableBitmap ToWriteableBitmap(List <Vector3> listOfPoints)
        {
            ushort[] myDepthFrame = FromVector3List(listOfPoints);

            byte[]          pixels      = ImageExtensions.ConvertUshortToByte(myDepthFrame);
            WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);

            return(depthBitmap);
        }
예제 #5
0
        public IRMetaData(InfraredFrame myframeIR, bool createBitmap)
        {
            this.frameInfrared = myframeIR;

            this.FrameData = AssignIRFrameData(myframeIR);


            if (createBitmap)
            {
                this.pixels = ImageExtensions.ConvertUshortToByte(this.FrameData);
                irBitmap    = WriteableBitmapUtils.FromByteArray_ToGray(pixels, MetaDataBase.XDepthMaxKinect, MetaDataBase.YDepthMaxKinect);
            }
        }
예제 #6
0
        private void ShowDepthScreenshot()
        {
            this.imageDepth.Source = null;

            if (this.DepthMetaData == null)
            {
                return;
            }

            WriteableBitmap depthBitmapTest = WriteableBitmapUtils.FromByteArray_ToGray(this.DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);

            this.ImageScreenshot   = depthBitmapTest;
            this.imageDepth.Source = depthBitmapTest;
        }
예제 #7
0
        private bool ProcessDepthFrame(MultiSourceFrame multiSourceFrame)
        {
            // Depth
            using (var frame = multiSourceFrame.DepthFrameReference.AcquireFrame())
            {
                if (frame != null)
                {
                    DepthFrame frameDepth = frame;
                    if (PointCloudScannerSettings.ScannerMode == ScannerMode.Depth || PointCloudScannerSettings.ScannerMode == ScannerMode.Color_Depth || PointCloudScannerSettings.ScannerMode == ScannerMode.Color_Depth_3DDisplay)
                    {
                        this.DepthMetaData = new DepthMetaData(frameDepth, false);


                        if (PointCloudScannerSettings.BackgroundRemoved)
                        {
                            backgroundRemovalTool.DepthFrameData_RemoveBackground(this.DepthMetaData, this.BodyMetaData);
                            if (PointCloudScannerSettings.CutFrames)
                            {
                                this.DepthMetaData.FrameData = DepthMetaData.CutDepth(this.DepthMetaData.FrameData, PointCloudScannerSettings.CutFrameMaxDistance, PointCloudScannerSettings.CutFrameMinDistance, ref numberOfCutPoints);
                            }
                            if (PointCloudScannerSettings.ScannerMode != ScannerMode.Color_Depth_3DDisplay)
                            {
                                this.imageDepth.Source = WriteableBitmapUtils.FromByteArray_ToGray(this.DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);
                            }
                        }
                        else
                        {
                            if (PointCloudScannerSettings.CutFrames)
                            {
                                this.DepthMetaData.FrameData = DepthMetaData.CutDepth(this.DepthMetaData.FrameData, PointCloudScannerSettings.CutFrameMaxDistance, PointCloudScannerSettings.CutFrameMinDistance, ref numberOfCutPoints);
                            }
                            if (PointCloudScannerSettings.ScannerMode != ScannerMode.Color_Depth_3DDisplay)
                            {
                                this.imageDepth.Source = DepthMetaData.FromUShort(DepthMetaData.FrameData);
                            }
                        }
                        if (PointCloudScannerSettings.InterpolateFrames)
                        {
                            CalculateInterpolatedPixels();
                        }
                    }

                    return(true);
                }
            }
            return(false);
        }
예제 #8
0
        private void SaveDepthBitmap()
        {
            WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);

            WriteableBitmapUtils.SaveImage(pathModels, "Depth", depthBitmap, true);
        }
예제 #9
0
 private void SHowInterpolatedFrame()
 {
     this.imageEntropy.Source = WriteableBitmapUtils.FromByteArray_ToGray(DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);
 }