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); }
public static WriteableBitmap FromUShort(ushort[] myDepthFrame) { byte[] pixels = ImageExtensions.ConvertUshortToByte(myDepthFrame); WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect); return(depthBitmap); }
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); } }
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); }
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); } }
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; }
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); }
private void SaveDepthBitmap() { WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect); WriteableBitmapUtils.SaveImage(pathModels, "Depth", depthBitmap, true); }
private void SHowInterpolatedFrame() { this.imageEntropy.Source = WriteableBitmapUtils.FromByteArray_ToGray(DepthMetaData.Pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect); }