public static WriteableBitmap FromUShort(ushort[] myDepthFrame) { byte[] pixels = ImageExtensions.ConvertUshortToByte(myDepthFrame); WriteableBitmap depthBitmap = WriteableBitmapUtils.FromByteArray_ToGray(pixels, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect); return(depthBitmap); }
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 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); }
private void SaveColorBitmap() { //write color Bitmap if (this.ColorMetaData != null) { //ImageSource imSource = ImageSourceUtils.CreateImageSource(ColorMetaData.Pixels, ColorMetaData.XResDefault, ColorMetaData.YResDefault); WriteableBitmap bitmap = WriteableBitmapUtils.FromByteArray_ToColor(ColorMetaData.Pixels, ColorMetaData.XColorMaxKinect, ColorMetaData.YColorMaxKinect); WriteableBitmapUtils.SaveImage(pathModels, "Color_", bitmap, true); } }
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 void SaveImageInterpolated() { if (listPointsInterpolated == null) { return; } //----------------------------------------------- //now interpolate last 10 frames to one frame and save //ushort[] rotatedPoints = DepthMetaData.RotateDepthFrame(this.DepthMetaData.DepthFrameData, DepthMetaData.XResDefault, DepthMetaData.YResDefault); WriteableBitmap depthInterpolated = DepthMetaData.ToWriteableBitmap(listPointsInterpolated); WriteableBitmapUtils.SaveImage(pathModels, "DepthInterpolated", depthInterpolated, true); }
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); }
public RibbonGroupsPanel() { _phantomGroup = new RibbonGroup { Header = "RibbonGroup", ItemCollection = { new RibbonButton { LargeIcon = WriteableBitmapUtils.Create(32, 32), SmallIcon = WriteableBitmapUtils.Create(16, 16), Text = "Ribbon Item", ActualItemStyle = RibbonItemStyle.Large } } }; }
private void SaveDepthAndColor_DataAndImage() { try { //byte[] myColorPixels = MetaDataBase.CreateColorInfoForDepth(this.ColorMetaData, this.DepthMetaData, this.coordinateMapper); PointCloud pc = MetaDataBase.ToPointCloud(this.ColorMetaData, this.DepthMetaData, this.BodyMetaData, this.coordinateMapper); //List<Point3D> newList = DepthMetaData.CreateListPoint3D_Depth(this.DepthMetaData.FrameData, DepthMetaData.XResDefault, DepthMetaData.YResDefault); SavePointCloudColor(pc); WriteableBitmap bitmapCustom = WriteableBitmapUtils.FromPointCloud_ToColor(pc, DepthMetaData.XDepthMaxKinect, DepthMetaData.YDepthMaxKinect); WriteableBitmapUtils.SaveImage(pathModels, "ColorDepthSpace_", bitmapCustom, true); } catch (Exception err) { System.Diagnostics.Debug.WriteLine("Error " + err.Message); } }
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); }