Fast Gauss Bilateral Filtering
In spite of high computational complexity, the bilateral filter and its modifications and extensions have recently become very popular image and shape processing tools. In this research, we proposed a fast and accurate approximation of the bilateral filter. Our approach combines a dimension elevation trick with a Fast Gauss Transform. First we represent the bilateral filter as a convolution in a high dimensional space. Then the convolution is efficiently approximated by using space partitioning and Gaussian function expansions. Advantages of our approach include linear computational complexity, user-specified precision, and an ability to process high dimensional and non-uniformly sampled data. We demonstrated capabilities of the approach by considering its applications to the image and volume denoising and HDR tone mapping problems.
This research was collaborated with Prof. Dr. A. G. Belyaev and H. Yokota (RIKEN). The paper was published in Computer Graphics Forum, Vol. 29, No. 1, pp. 60-74, 2010.
C++ Code
The program provides a fast approximation of a 3D image bilateral filter with a Gaussian kernel (applicable to 2D images). You can download the C++ code which is not a program used in the paper but provides a fast Gauss bilateral filter consisting of a same method described in the paper. After applied unzip, please read README.txt and the following simple manual. Questions and Bug report are welcome to my e-mail: shin[_at_]riken.jp.
Copyright
All rights are reserved by Shin Yoshizawa. This C++ files are allowed for only a primary user for research and educational purposes. Don't use secondary use: copy, distribution, diversion, business purpose, and etc.. In no event shall the author be liable to any party for direct, indirect, special, incidental, or consequential damage arising out of the use of this program and source files.
A TIFF image I/O library included in the program is a courtesy of Masaomi Nishimura (RIKEN).
Commercial and Business Use
If you would like to use this C++ sources in your commercial software then please contact with me and RIKEN.
Simple Manual
How to use
- Program Organization: The program consists of a set of C++ source files, which approximates bilateral image filtering with Gaussian kernel via fast Gauss transformations.
- Compile:
- C++ code, by using attached Makefile, you may run "make". If you are using a 32bit OS then please remove "-m64" option in the Makefile. Then you will get the executable file "FGTBilateralFilter". You should use the later versions of g++ 4.4.
- Execute:
- C++ code, You can run FGTBilateralFilter itself as (% ./FGTBilateralFilter input.tif output.tif sigx sigy sigz sigI IRC error), where "input.tif" is an input image (multipage TIFF format), "output.tif" is a filtered output image (multipage TIFF format), "sigx", "sigy", and "sigz" are the spatial range parameters (double) for X, Y, and Z dimensions, respectively, "sigI" is an intensity (tonal) range parameter (double), "IRC" is an interaction region radius (Integer, "r" in the paper), and "error" is a specified error parameter (double, "\epsilon in the paper").
- "sigx", "sigy", and "sigz" should be greater than zero (>0.0). I would recommend to use 1% < sigx, sigy, and sigz < 20% of simage size (5 to 100 for 512^2 images).
- "sigI" should be greater than zero (>0.0). Also it used as "sigI*s_{d}" in the program where "s_{d}" is a standard deviation of the image intensity (see the paper). I would recommend to use 0.1 < sigI < 2.0.
- "IRC" should be a number of \{2,3,4,5,6\}. If you use IRC=6 then it is very accurate and if you use IRC=2 then it is fast, see the paper.
- "error" should be greater than zero (>0.0).
- File Formats:
- Input/output for the program: The input image have to be multipage TIFF format which can write/read by using a TIFF I/O libraly included in the program. We do not support some compressed TIFF files. Here the page number corresponds to a Z dimention of 3D images. Hence you may use one page multipage TIFF for 2D images.
.
- For Windows User: Please use Cygwin or VMWare for your compile and run my code on Windows.
Quick Practice
- Road to ready:
% unzip FBGFilter.zip
% cd FBGFilter
% make
- Let's play with a 2D image:
Download lena.tif.
Run as
% ./FGTBilateralFilter lena.tif lena_FGBF_15_075.tif 15.0 15.0 15.0 0.75 2 1.0
You obtain lena_FGBF_15_075.tif, where they look like the following images (left: input and right: output). Note that you need to specify "sigz" for 2D images, where it does not affect anything.
- Let's play with a 3D image:
Download Foot.tif. The original Foot CT image is a courtesy of Philips Research.
Run as
% ./FGTBilateralFilter Foot.tif Foot_FGBF_8_1_first.tif 8.0 8.0 8.0 1.0 2 100.0
% ./FGTBilateralFilter Foot_FGBF_8_1_first.tif Foot_FGBF_8_1_second.tif 8.0 8.0 8.0 1.0 2 100.0
You obtain Foot_FGBF_8_1_second.tif, where they look like similar to the top images (left: input and right: output). Note that volume rendering was employed to visualize the 3D images.
Log