How can I fill the gaps that occurred as a result of thinning? The first image is the image before thinning, the second one is the image after thinning and the third one is an example of the pixels that I need to connect. I'm using MATLAB R2013a.
I used this code in thinning:
bw_clean = imopen(binary_image, strel('rectangle',[3 3]));
bw_clean = bwareaopen(bw_clean, 15);
thin_image = ~bwmorph(imcomplement(bw_clean), 'thin', Inf);
Image before thinning:
Image after thinning:
Example of what I need to connect:
When I used BW2 = imfill(A,'holes');
the output was:
And when I used
se = strel('disk',10);
closeBW = imclose(A,se);
the output was: