i need to read a number of images (signature) then conert them to grayscale after that apply mediam filter then binarization the images and berform the morphological operation the following code doesn't contain an error but not implemented as i need
Directory='C:\Users\XXX\Desktop\Imges';
Imgs = dir(Directory);
for j=1:length(Imgs)
thisname = Imgs(j).name;
thisfile = fullfile(Directory, thisname);
try
Img = imread(thisfile); % try to read image
Im = rgb2gray(Img);
If2 = medfilt2(Im,[3 3]);
Bim=im2bw(If2);
I = bwmorph(Bim,'thicken',Inf);
figure
imshow(I)
title(thisname);
baseFileName= thisname;
fullFileName = fullfile('C:\Users\XXX\Desktop\Imges',baseFileName);
imwrite( I,fullFileName);
catch
end
end
Best Answer