4.0 | 1 rating Rate this file 151 Downloads (last 30 days) File Size: 161 KB File ID: #36657
image thumbnail

Fast Bilateral Filter



11 May 2012 (Updated )

Fast O(1) implementation of the bilateral and the joint (or cross) bilateral filter.

| Watch this File

File Information

MATLAB implementation of the fast O(1) bilateral filter described in the following papers:

[1] K.N. Chaudhury, D. Sage, and M. Unser, "Fast O(1) bilateral filtering using trigonometric range kernels," IEEE Trans. Image Processing, vol. 20, no. 11, 2011.

[2] K.N. Chaudhury, "Acceleration of the shiftable O(1) algorithm for bilateral filtering and non-local means," IEEE Transactions on Image Processing, vol. 22, no. 4, 2013.

Also included is the MATLAB implementation of joint bilateral filtering.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.3 (R2014a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
29 Apr 2013 Kunal Chaudhury

Ben: Yes, you can modify the code for volume data as well. The dimension of the data is immaterial.

20 Apr 2013 Ben

A quick question before trying it: does the code support 3D image?

20 Nov 2012 Kunal Chaudhury

Yes, it can introduce artifacts in the output if the actual T is much larger than 255. This could well be the case near edges
when processing images corrupted by noise
with large sigma. A better guess in this case would be T + C(sigma), where C(sigma) is a reasonable upper bound on the intensity variation induced by noise.

19 Nov 2012 PeeVee

Does setting T to max (255 in my case) decrease the accuracy of the final result?

19 Nov 2012 Kunal Chaudhury

One can always use a good guess of the local dynamic range. The 'maxfilter' is not required in this case. Note, however, that the local dynamic range can be much smaller than 255(the global gynamic range) for a grayscale image, and in some cases, it might be difficult to make a good guess of T (eg, if there's a lot of noise).

17 Nov 2012 PeeVee

Most of the time is spent on maxfilter for large image sizes. Is it really necessary, or can we just set T=255?

21 May 2012 Kunal Chaudhury

Thanks Derek. Bug fixed.

18 May 2012 Derek

Thanks! One bug: change line 66 in maxFilter.m to
R(m - k + 1) = max( R(m - k + 2), template(m - k + 1, jj));

otherwise will get error if width<height

14 May 2012 Curtis

Nice effort!

11 May 2012

screenshot added.

21 May 2012

Code for joint filtering of multiband images added (Courtsey of Derek).

08 Aug 2012

A minor update.

22 Aug 2012

Replaced 'parfor' loop with 'for' loop.

18 Apr 2013

Replaced rand( ) by randn( ) in the file *demo*.

24 Jun 2014

Small fixes made to speedup the code.

Contact us