public BandGraph Histogram(Bitmap bitmap) { BandGraph graph = new BandGraph(this); for (int x = 0; x < bitmap.Width; x++) { float counter = 0; for (int y = 0; y < bitmap.Height; y++) { counter += GetBrightness(bitmap, x, y); } graph.AddPeak(counter); } return(graph); }
private List <Graph.Peak> ComputeGraph() { if (_graphHandle != null) { return(_graphHandle.Peaks); } Bitmap imageCopy = DuplicateBitmap(Image); FullEdgeDetector(imageCopy); _graphHandle = Histogram(imageCopy); _graphHandle.RankFilter(Image.Height); _graphHandle.ApplyProbabilityDistributor(Distributor); _graphHandle.FindPeaks(numberOfCandidates); return(_graphHandle.Peaks); }