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

enter image description here

output enter image description here

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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -