comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Fast local contrast calculations?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Fast local contrast calculations? [message #86294] Wed, 23 October 2013 11:28 Go to next message
kagoldberg is currently offline  kagoldberg
Messages: 26
Registered: November 2012
Junior Member
I'm looking for a quick way to calculate local contrast across a (2048,2048) image.
The end result could be a 64x64 element array, for example, and that would be fine.

Speed-wise, calculating local averages with rebin() are lightning fast. Even median(image,N) is pretty fast. But is there a similar high-speed way to get minimum and maximum values within each 'tile' without having to write a loop? It's as though I need a rebin_min() and rebin_max() where the min and max values are preserved within the sampled output array.

I'd love to hear any suggestions. Thanks, Ken
Re: Fast local contrast calculations? [message #86300 is a reply to message #86294] Wed, 23 October 2013 22:33 Go to previous messageGo to next message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
Hi Ken,
my suggestion is to 'align' the tile elements with reform:

IDL> t = randomn(1, 6,6)
IDL> print, t
IDL> print, max(max( reform( t, 2, 6/2, 2, 6/2 ), D=1),D=2)

You could even remove the second max, by using transpose and another
reform, but I think transpose will cost you...

Let me know what you end up with!

mo

Am 23.10.2013 20:28, schrieb kagoldberg@lbl.gov:
> I'm looking for a quick way to calculate local contrast across a
> (2048,2048) image. The end result could be a 64x64 element array, for
> example, and that would be fine.
>
> Speed-wise, calculating local averages with rebin() are lightning
> fast. Even median(image,N) is pretty fast. But is there a similar
> high-speed way to get minimum and maximum values within each 'tile'
> without having to write a loop? It's as though I need a rebin_min()
> and rebin_max() where the min and max values are preserved within the
> sampled output array.
>
> I'd love to hear any suggestions. Thanks, Ken
>
Re: Fast local contrast calculations? [message #86310 is a reply to message #86300] Thu, 24 October 2013 20:35 Go to previous message
kagoldberg is currently offline  kagoldberg
Messages: 26
Registered: November 2012
Junior Member
Such genius, I don't even know where to begin, except: Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to package existing non-OO widget application into a catalyst based objects?
Next Topic: xtickformat type conversion

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:32 PDT 2025

Total time taken to generate the page: 0.00460 seconds