Finding the local maxima/peaks and minima/valleys of histograms
问题 Ok, so I have a histogram (represented by an array of ints), and I'm looking for the best way to find local maxima and minima. Each histogram should have 3 peaks, one of them (the first one) probably much higher than the others. I want to do several things: Find the first "valley" following the first peak (in order to get rid of the first peak altogether in the picture) Find the optimum "valley" value in between the remaining two peaks to separate the picture I already know how to do step 2