From: Tessa on
I am now working on a histogram of an image, is anyone has any idea
how to detect local maxima and local minima of a histogram? Appreciate
your help. Urgent.
From: Walter Roberson on
Tessa wrote:
> I am now working on a histogram of an image, is anyone has any idea
> how to detect local maxima and local minima of a histogram? Appreciate
> your help. Urgent.

Local maxima: the value is greater than both the previous value and the
next value.

Local minima: the value is less than both the previous value and the
next value.


These definitions have a small problem if there are equal adjacent
values: if you have (say) 4 2 2 2 5, then _which_ of the 2's is the
local minima?

I seem to recall that recently John D'Errico mentioned something about a
FEX contribution that took a gradient-based approach to this matter. I
haven't looked at his code, but I would -speculate- that it knows how to
ignore small local minima that are part of a downward trend.
From: Tessa on
On Mar 16, 2:49 pm, Walter Roberson <rober...(a)hushmail.com> wrote:
> Tessa wrote:
> > I am now working on a histogram of an image, is anyone has any idea
> > how to detect local maxima and local minima of a histogram? Appreciate
> > your help. Urgent.
>
> Local maxima: the value is greater than both the previous value and the
> next value.
>
> Local minima: the value is less than both the previous value and the
> next value.
>
> These definitions have a small problem if there are equal adjacent
> values: if you have (say) 4 2 2 2 5, then _which_ of the 2's is the
> local minima?
>
> I seem to recall that recently John D'Errico mentioned something about a
> FEX contribution that took a gradient-based approach to this matter. I
> haven't looked at his code, but I would -speculate- that it knows how to
> ignore small local minima that are part of a downward trend.

Thank you for your sharing.
Let's say if a histogram is ideal, it has some peaks(maxima) and
troughs(minima), however, there are still some noises from the
diagram, if there are only 3 peaks and 3 troughs, but due to noise the
algorithm can detect more than that, which means i need to either
smooth the histogram first, or I need filter those noises to get the
outcome that I want. After I detect them, I need to plot them on the
original histogram as well. Thank you again.
From: ImageAnalyst on
Sometimes I've run my histogram through a median filter to smooth it a
bit so that I can try to select a proper threshold. Perhaps you can
try that.
From: Tessa on
On Mar 16, 6:22 pm, ImageAnalyst <imageanal...(a)mailinator.com> wrote:
> Sometimes I've run my histogram through a median filter to smooth it a
> bit so that I can try to select a proper threshold.  Perhaps you can
> try that.

Would you mind to show me how do you do that?
 |  Next  |  Last
Pages: 1 2
Prev: LSB steganography
Next: simulation for wimax