Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }