How to implement Boundary discriminative noise detection method for salt and pepper noise removal of images
Show older comments
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
Sajid Khan
on 25 Nov 2015
Edited: Walter Roberson
on 27 Nov 2015
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
Answers (1)
Image Analyst
on 28 Feb 2013
0 votes
I don't know that method by name. I have posted salt and pepper removal code here before. Didn't you run across it in your search?
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!