/// <summary> /// Must be run at end of slice selection algorithm. /// </summary> /// <param name="imagesAndHistogram"></param> /// <param name="utilities"></param> public static unsafe void ShowSliceSelectionDebugImage(ImagesAndHistogram imagesAndHistogram, ThumbnailGeneratorUtilities utilities) { var edgeImage = imagesAndHistogram.EdgeImage; var edgeDensityHistogram = imagesAndHistogram.EdgeDensityHistogram; DrawHistogram(edgeImage, edgeDensityHistogram); DrawVerticalLine(edgeImage, edgeDensityHistogram.Median, 254); DrawVerticalLine(edgeImage, (int)edgeDensityHistogram.Mean, 253); DrawVerticalLine(edgeImage, (int)(edgeDensityHistogram.Median - edgeDensityHistogram.StdDev), 252); DrawVerticalLine(edgeImage, (int)(edgeDensityHistogram.Median + edgeDensityHistogram.StdDev), 252); var resultAspect = 16.0 / 10.0; var sliceCount = 4; var sliceAspect = resultAspect / sliceCount; var desiredWidth = (int)(edgeImage.Height * sliceAspect); var range = utilities.GetRangeOfWidth(edgeDensityHistogram, desiredWidth); DrawVerticalLine(edgeImage, range.Min, 250); DrawVerticalLine(edgeImage, range.Max, 250); ShowImage(edgeImage); Application.Run(); }
/// <summary> /// Must be run at end of slice selection algorithm. /// </summary> /// <param name="imagesAndHistogram"></param> /// <param name="utilities"></param> public static unsafe void ShowSliceSelectionDebugImage(ImagesAndHistogram imagesAndHistogram, ThumbnailGeneratorUtilities utilities) { var edgeImage = imagesAndHistogram.EdgeImage; var edgeDensityHistogram = imagesAndHistogram.EdgeDensityHistogram; DrawHistogram(edgeImage, edgeDensityHistogram); DrawVerticalLine(edgeImage, edgeDensityHistogram.Median, 254); DrawVerticalLine(edgeImage, (int)edgeDensityHistogram.Mean, 253); DrawVerticalLine(edgeImage, (int)(edgeDensityHistogram.Median - edgeDensityHistogram.StdDev), 252); DrawVerticalLine(edgeImage, (int)(edgeDensityHistogram.Median + edgeDensityHistogram.StdDev), 252); var resultAspect = 16.0 / 10.0; var sliceCount = 4; var sliceAspect = resultAspect / sliceCount; var desiredWidth = (int)(edgeImage.Height * sliceAspect); var range = utilities.GetRangeOfWidth(edgeDensityHistogram, desiredWidth); DrawVerticalLine(edgeImage, range.Min, 250); DrawVerticalLine(edgeImage, range.Max, 250); ShowImage(edgeImage); Application.Run(); }