loss of information while binarizing an image: Matlab -
i trying binarize images. in images pattern in images lose of pattern. using greythresh binarizing. there other method improve output.
i = imread('image.jpg'); = rgb2gray(i); = uint8(255*mat2gray(i)); figure,imshow(i); i=imresize(i,[128 128]); figure,imshow(i); = medfilt2(i,[5 5]); i1 = medfilt2(i,[5 5]); = adapthisteq(i1,'cliplimit',0.4,'distribution','rayleigh'); figure,imshow(i); level = graythresh(i); bw = im2bw(i, level); figure,imshow(bw);
input
output
getting unique threshold whole image seems bad in case. should try perform adaptive local thresholding better adapt smooth image intensity variations.
you can find matlab example here
Comments
Post a Comment