hi tried using code removing noise , blur.
j = double(imread('c:\users\sai_praneeth7777\desktop\project\real123.jpg')); l= imnoise(j,'salt & pepper',0.02); k = im2bw(i); se=strel('disk',1); bw=imopen(k,se); imshow(bw); cc = bwconncomp(bw,4); number1 = cc.numobjects; display(number1); bw1 = imfill(bw,'holes'); cc = bwconncomp(bw1,4); number2 = cc.numobjects; figure; imshow(l); display(number2); imshow(i);
the problem there still noise remaining , divisions not clear,like in top right partitions gone.i want count number of white pieces getting wrong answer.i new matlab , image processing.
i start median filter, can make opening little bit bigger , small closing in order regularize contours. borders fuzzy, cannot have precise/neat segmentation.
if want separate different components, can compute distance map , use local maxima in watershed.
Comments
Post a Comment