ingenuitas/SimpleCV — pull request #369 by rajatkapoor (2013-04-02 09:05:05+00:00)
Title: grayPeaks implemented

I have implemented the grayPeaks() function on the lines of huePeaks(), with a similar approach but with added functionality.
This resolves #308

Syntax:

grayPeaks(self, bins = 255, delta = 0, lookahead = 15)

Documentation:

**PARAMETERS**

* *bins* - the integer number of bins, between 1 and 255.

* *delta* - the minimum difference betweena peak and the following points,
before a peak may be considered a peak.Useful to hinder the
algorithm from picking up false peaks towards to end of
the signal.

* *lookahead* - the distance to lookahead from a peakto determine if it is
an actual peak, should be an integer greater than 0.

**RETURNS**

A list of (grays,fraction) tuples.

Usage:

i=Image('lenna')
i.grayPeaks()
#prints
[(49, 0.008022308349609375),
(99, 0.007961273193359375),
(129, 0.00962066650390625),
(155, 0.010471343994140625),
(209, 0.004077911376953125)]