sir, what is required to denoise the attached image, i tried with following code but still some noise is there
1 view (last 30 days)
Show older comments
clc; close all; %% %roiFolder = 'E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\Jermanfilter\dbROI'; %filePattern = fullfile(myFolder, '*.bmp'); %dataFiles = dir(filePattern);
myFolder = 'E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\Jermanfilter\db\Test'; for iuser=1:1 path1=strcat('E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\Jermanfilter\dbROI\',num2str(iuser)); mkdir(path1); path1=strcat(path1,'\'); for irep=1:1 fname=num2str(irep); nnfile=[myFolder,'\',num2str(iuser,'%d')]; nfile=[nnfile,'\',num2str(irep,'%d'),'.bmp']; % nfile=[nnfile,'mano-',num2str(iuser,'%3.3d'),'-',num2str(irep,'%3.3d'),'.bmp']; % a=imread(nfile,'bmp');
I=imread(nfile,'bmp');
% preprocess the input a little bit Ip = single(I); thr = prctile(Ip(Ip(:)>0),1) * 0.9; Ip(Ip<=thr) = thr; Ip = Ip - min(Ip(:)); Ip = Ip ./ max(Ip(:));
% compute enhancement for two different tau values %V1 = vesselness2D(Ip, 0.5:0.5:2.5, [1;1], 1, false); I = vesselness2D(Ip, 0.5:0.5:2.5, [1;1], 0.5, false);
%% Thresholding bw = adaptivethresh(I,45,1,'median','relative'); % Wellner's adaptive thresholding 50 2 %bw=adaptivethreshold(y,40,0.02,1); % adaptive thresholding % subplot(2,3,3); % imshow(bw); % title('Wellners adaptive thresholding');
%%low pass filter
G = fspecial('gaussian',[5 5],1); %0.8
bw = imfilter(bw,G,'full');
% figure,
% imshow(bw);
img1 =noisecomp(bw,3,7,3,6,1);
% figure,
% imshow(img1);
kernel = [-1, -1, -1; -1,8, -1; -1, -1, -1]; % 3 by 3 window.
bw = imfilter(img1, kernel); figure, imshow(bw);
%% saving images
bw = imresize(bw,[110 110]); imwrite(bw,[path1,num2str(irep),'.bmp']); % writing images in
end
% hold on; % plot(j,i,'rx'); end
0 Comments
Answers (0)
See Also
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!