Re: Local Maxima of 2D array [message #69473] |
Wed, 20 January 2010 07:35  |
DavidPS
Messages: 10 Registered: December 2009
|
Junior Member |
|
|
On Jan 19, 5:48 pm, Robin Wilson <r.t.wil...@rmplc.co.uk> wrote:
> Hi,
>
> Another question from me I'm afraid. I'm trying to implement a routine
> which needs to be able to calculate the local maxima of a small window
> moved across an array. That is, I have a large array and I will need to
> move a small 3x3 array across it, each time working out what the maximum
> value of that array is and storing its index (or selecting it in some
> other way).
>
> I've investigated various methods for doing this, including the dilate
> method, but I can't seem to get them to work properly.
>
> Is there any good (as in fast, efficient and elegant) way of doing this,
> or will I be reduced to using for loops and lots of IF statements?
>
> Best regards,
>
> Robin
> University of Southampton
Hi Robin,
I asked something similar a few weeks ago, but I was looking for a
local minima in a running window of 9. I think you can use the same
the guys suggested to me then, just changing the sign of the function
to convolve (so you find a max). It's in here:
http://tr.im/L0ob [groups.google.com]
David
|
|
|