private List <Graph.Peak> ComputeGraph() { if (_graphHandle != null) { return(_graphHandle.Peaks); } _graphHandle = Histogram(PlateCopy.GetBitmap()); _graphHandle.ApplyProbabilityDistributor(Distributor); _graphHandle.FindPeaks(NumberOfCandidates); return(_graphHandle.Peaks); }
public PlateGraph Histogram(Bitmap bitmap) { PlateGraph graph = new PlateGraph(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); }