How to implement Boundary discriminative noise detection method for salt and pepper noise removal of images

Respected sir/madam
I have to implement the boundary discriminative noise detection method for high density impulse noise removal from images using matlab.can you help me with the implementation? Noise as high as 80-90% needs to be removed. can it be implemented for colour images also?

1 Comment

function [ bin_noisy ] = BDND( image_noisy, wind_init )
[row, col] = size(image_noisy);
start_wind = ceil(wind_init/2);
end_wind = floor(wind_init/2);
bin_noisy = false(row, col);
loc_median = ceil(wind_init*wind_init/2);
image_padded = pad_image( image_noisy, wind_init );
for i = start_wind: row+end_wind
for j = start_wind: col+end_wind
% if(i == 317 + start_wind - 1 && j == 296 + start_wind - 1)
% i
% end
patch_selected = image_padded(i - end_wind: i + end_wind, j -
end_wind: j + end_wind);
pix_center = patch_selected(start_wind, start_wind);
patch_selected = patch_selected(:);
[array_sorted, ind] = sort(patch_selected);
diff_patch = diff(array_sorted);
pre_med = diff_patch(1:loc_median);
post_med = diff_patch(loc_median+1:end);
[~,max_pre] = max(pre_med);
[~,max_post] = max(post_med);
b1 = array_sorted(max_pre);
b2 = array_sorted(loc_median+max_post);
bin_noisy(i - end_wind, j - end_wind) = (pix_center<=b1 || pix_center>b2);
end
end

Sign in to comment.

Asked:

on 28 Feb 2013

Edited:

on 27 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!