[Insight-users] itk::BilateralImageFilter extremely slow

Oleksandr Dzyubak adzyubak at gmail.com
Mon Aug 9 15:35:37 EDT 2010


Dear ITK users and developers,

A while ago for my experiments I ran into a need of using
a narrow kernel bilateral filter so I decided to give
the itk:: BilateralImageFilter class a try.
After some pre-tests with small test images, I ran a filter on real images.
Well, my first impression is somewhat discouraging.
But it might be that I am doing some terrible mistake which I do not see.

My setup.
1) Hardware: 4x4 core server with 64 bit Debian Linux.
2) ITK-3.18 with p-threads support ON.
3) Image 561x561x478.

I followed the recommendations from the ITK user guide
and below are results.

dzyubak at helium: /H61_Mo_721Views_July_31_2009$ time 
./Bilateral_LessAgressive h61_with_psf.hdr h61_with_psf_ds05_rs4.hdr 0.5 4.0

With all 16 CPUs 100% busy after 1241m29.741s it was still running.
Thus I should cancel the run not having an output.

real    1241m29.741s
user    19600m14.380s
sys    6m33.993s

After I changed the parameters, I got something but it was not what I 
wanted.

dzyubak at helium: /H61_Mo_721Views_July_31_2009$ time 
./Bilateral_LessAgressive h61_with_psf.hdr h61_with_psf_ds005_rs4.hdr 
0.05 4.0

real    63m46.774s
user    764m24.782s
sys    0m18.849s

Since this filter worked extremely slow even with 16 horses under the hood,
I started digging the Insight Journal and found the contribution
"A Fast Approximation to the Bilateral Filter for ITK" by J. Woehr.

I was attracted by the word "Fast" since it quite often means "faster 
performance".
Even though I did not like the author's note "it is single threaded",
I decided to eventually try it and, to be fair,
I used exactly the same parameters as for itk:: BilateralImageFilter.

dzyubak at helium: /H61_Mo_721Views_July_31_2009$  time 
./FastBilateral_LessAgressive h61_with_psf.hdr h61_with_psf_ds05_rs4.hdr 
0.5 4.0
ImageFileName: h61_with_psf.img

real    4m49.325s
user    4m35.085s
sys    0m5.804s

In the submission description J. Woehr said that FastBilateral
performs poorer for the narrow kernels thus if someone is
in a need of such cases (it is exactly me!),
then the itk:: BilateralImageFilter should be used instead.

Well, I would like to but FastBilateral performed 200 times
as much vs itk:: BilateralImageFilter.
And in addition to that, for some kernel sizes it never
went out of the loop.

What am I missing here?
Did someone experience the same filter behaver?
Is it wrong conditional causing such a "prolongated" loop?
Is there any recipe I could used to shorten
such unacceptable long run time of itk:: BilateralImageFilter?

I appreciate any suggestions/discussions on this matter.

Regards,

Alex


More information about the Insight-users mailing list