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
|
|
|
Re: Local Maxima of 2D array [message #69568 is a reply to message #69473] |
Thu, 21 January 2010 05:02  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Jan 20, 10:35 am, DavidPS <dps.he...@gmail.com> wrote:
> 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
I don't think it's the same problem... correct me if I'm wrong, but I
think that Robin wants the maximum value within the window, regardless
of whether it's surrounded by lower values.
The only IDL-way I've thought of so far uses absurd amounts of memory
if your image is large, so I'm not even going to suggest it. Still
thinking about it...
-Jeremy.
|
|
|