Hello, I am having a problem segmenting the following image below. It is a colored symbol to be recognized. I use sharpening, smoothing and smoothing. After that, I split the image using fuzzy-c clustering (3-grade). But in the case of the letter E, the best that I get does not have drastic changes, smoothing and smoothing, only with threshold segmentation fcm. However, I should get a better result than this, where I could combine these two parts as a whole (and not just the top white part with the other half black).
How can I solve this problem in order to be more reliable and work with other images, for example, 5 in the picture? Result 5 - with sharpening, deflation and smoothing, on top of fcm clustering. How can I make it more connected maybe?
I would really appreciate any help that I could get, please oh, and I do it in Matlab ... so it would be nice to get any help from there, thanks!


EDIT:
My next code is: function [bw, level] = fcmthresh (IM, sw) if (nargin <1) error ('You must provide an image.'); elseif (nargin == 1) SW = 0; elseif (sw ~ = 0 & sw ~ = 1) error ('sw must be 0 or 1.'); end
data=reshape(IM,[],1); [center,member]=fcm(data,3); [center,cidx]=sort(center); member=member'; member=member(:,cidx); [maxmember,label]=max(member,[],2); if sw==0 level=(max(data(label==1))+min(data(label==2)))/2; else level=(max(data(label==2))+min(data(label==3)))/2; end bw=im2bw(IM,level); function img=wienerDeblur(im) ImgNoisyBlurry = im2double(im); PSF = fspecial('laplacian'); %LEN, THETA add parameters for 'motion' noise_var = 0.0001; %0.0001 estimated_nsr = noise_var / var(ImgNoisyBlurry(:)); wnr3 = deconvwnr(ImgNoisyBlurry, PSF, estimated_nsr); img = wnr3; end H = fspecial('unsharp'); im = imfilter(im,H,'replicate'); im = wienerDeblur(im); im = wienerSmoothing(im);
This is all the code, plus I use only fcmthres for the letter E, because it works best. I read about morphological image processing (expansion, erosion) to possibly do the trick.
Is there a better technique for image contrast and noise removal?