Removing Noise From an image in MATLAB -
i'm using geometric mean filter remove noise instead of median filter image quality goes off in former case. code shown below part of m-file remove noise.
fname = getappdata(0, 'fname'); [a, map] = imread(fname); x = ind2rgb(a, map); b = im2double(x); w=fspecial('gaussian',[3,3]); geom=exp(imfilter(log(b),ones(3,3),'replicate')).^(1/3/3); fname=imfilter(b,w,'replicate'); axes(handles.axes1); imshow(fname);
if press push button named 'remove noise' above code executed irrespective of image quality/property. in sense if no noise present, image subjected filter.
my question, there way detect whether noise present or not, moment pressed push button if no noise in image should display message stating 'no noise remove' automatically.
there no direct way determine whether image noisy or not.
however, can compare resulting image fname
input image b
in such way if difference lower threshold, can decided denoising operation has not changed image , there not noise in original image like:
threshold_ratio = 0.2; % decided experimentally difference_ratio = sum(sum((fname - b).^2)) / sum(sum(b.^2)); if difference_ratio < threshold_ratio disp('no noise remove'); end
Comments
Post a Comment