File Exchange

image thumbnail

Bilateral Filter

version 1.0.0.0 (34.2 KB) by Suraj Kamya
Edge-preserving and noise-reducing smoothing filter for images.

7 Downloads

Updated 12 May 2014

View License

This preserves sharp edges by systematically looping through each pixel and adjusting weights to the adjacent pixels accordingly.
% bif = bilateral filter
% im = input image
% sigd = domain parameter for spatial kernel
% sigr = range parmeter for intensity kernel
% n = noise intensity
% out = output image

% Code Developed BY : Suraj Kamya
% kamyasuraj@yahoo.com

% Other files used in this function
% rpadd = another function is used
% PSN = Peak Signal to noise ratio
% IEF = Image Enhancement Factor

% For ex.
% im=imread('bgray.jpg');
% out=bif(im,3,0.2,0.1);

Comments and Ratings (3)

Suraj Kamya

@Asad
Just apply this code to each channel of RGB image one by one.

nice~

Aasd

hi nice job but i have one confusion may be i am wrong, when i apply this code to grayscale than result is good but color image result is also convert into grayscale why?
please help me

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor