Faster image median filtering [message #76662] |
Fri, 24 June 2011 06:48  |
Deckard++;
Messages: 11 Registered: March 2010
|
Junior Member |
|
|
Hi,
I am confronted with a performance issue related to median filtering
of images using the median() function of IDL. I have rather extended
sets (several thousands) of 1500x1500 images, and I need to median
filter each of them. So far I have been using this to filter them
img_filtered = median(img, boxsize)
The problem is that it take ~5 seconds per image for boxsize=15, which
is ok for a few images but really time consuming when considering
thousands of images. I have a few questions:
1- is there a way to speed-up median filtering that I am not aware of?
2- do you know if IDL implementation of 2D median() is the most
efficient?
3- if not, are you aware of a DLM that would implement a faster median
filtering of images?
Thank a lot in advance.
Best regards,
-- Arthur;
|
|
|
|
|
Re: Faster image median filtering [message #76772 is a reply to message #76725] |
Sun, 03 July 2011 06:53   |
Deckard++;
Messages: 11 Registered: March 2010
|
Junior Member |
|
|
On Jun 28, 7:33 pm, Bennett <juggernau...@gmail.com> wrote:
> On Jun 24, 9:48 am, "Deckard++;" <arthur.vi...@gmail.com> wrote:
>
>
>
>
>
>> Hi,
>
>> I am confronted with a performance issue related to median filtering
>> of images using the median() function of IDL. I have rather extended
>> sets (several thousands) of 1500x1500 images, and I need to median
>> filter each of them. So far I have been using this to filter them
>
>> img_filtered = median(img, boxsize)
>
>> The problem is that it take ~5 seconds per image for boxsize=15, which
>> is ok for a few images but really time consuming when considering
>> thousands of images. I have a few questions:
>
>> 1- is there a way to speed-up median filtering that I am not aware of?
>> 2- do you know if IDL implementation of 2D median() is the most
>> efficient?
>> 3- if not, are you aware of a DLM that would implement a faster median
>> filtering of images?
>
>> Thank a lot in advance.
>
>> Best regards,
>
>> -- Arthur;
>
> If you have multiple cores on your computer try out the idl_idlbridge
> object in IDL and just run multiple instances of your median
> processing at once.
This looks really interesting! I had never heard of idl_idlbridge
before. I will look into it because I am running my code on a 16-core
computer. Actually I am quite surprised that the MEDIAN function is
not optimised for multi-core.
Thanks,
-- Arthur;
|
|
|
Re: Faster image median filtering [message #76773 is a reply to message #76753] |
Sun, 03 July 2011 06:54  |
Deckard++;
Messages: 11 Registered: March 2010
|
Junior Member |
|
|
On Jun 25, 12:33 am, wlandsman <wlands...@gmail.com> wrote:
> I think suspect that the IDL implementation of MEDIAN is reasonably optimal (e.g. using a rolling window). In the ancient days of IDL, MEDIAN() only worked on byte data, and I used to use a CALL_EXTERNAL to a C program for float data. But when support for floating data in MEDIAN was added, it was definitely faster than my CALL_EXTERNAL setup.
>
> Having said that you might look at scaling your data to byte. The MEDIAN() is the midpoint of ordered data , and the order should be maintained after byte scaling (except that resolution is lost, so some nonequal values become equal). And MEDIAN is *much* faster on byte data.
>
> --Wayne
Hi Wayne,
scaling my data to byte is not possible I think, but thanks for the
tip.
-- Arthur;
|
|
|