Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 8
0
        private void SaveDepthBitmap()
        {
            WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect);

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