This project implements the impulse noise (also known as salt-and-pepper noise) removal algorithm published in paper entitled A weighted mean filter with spatial-bias elimination for impulse noise removal (UWMF, see here). UWMF is based on another paper entitled Interpolation-based impulse noise removal (IBINR, see here). IBINR basically interpolates the corrupted pixel using inverse Euclidean Distance. UWMF recalculates the weights (based on inverse Manhattan Distance) according to the spatial distribution of corrupted pixels, effectively yielding a more spatially-balanced weight contribution.
cd uwmf
mkdir build && cd build
cmake ..
make -j8
./uwmf -i <corrupted image> -w <filtering window size>
Suggested Filtering Window Sizes:
Corruption Density | Filtering Window Size |
---|---|
p < 20 | 1 |
20 <= p < 50 | 2 |
50 <= p < 70 | 3 |
70 <= p < 85 | 4 |
85 <= p < 90 | 5 |
90 >= p | 6 |
where p is the corruption density. Also note that edge length of a filtering window with size 1 is 3 (2 * wsize + 1). This ensures an odd edge length.
./uwmf -m c -i <input image> -d <corruption density>
Application of UWMF to well-known benchmark images. Images are first corrupted with various corruption densities, ranging from 0.1 to 0.9, and then restored. The restoration capability of UWMF is measured with SSIM, PSNR and IEF.
./sim.sh <path to images (def: ./images)> <repeat counter (def: 10)> <output file (def: ./results.txt)>
- Offload simulation to a number of threads
- make sure to use release builds of zlib and libpng
GPLv3. See LICENSE for full description.