Hi
I have this binary image with 4 objects, and want to connect this 4 object into one object/blob (see image, with the approximate connection points marked with red).
I have tried: imclose, bwmorph(BW,'bridge'), bwmorph(BW,'endpoints'), imdilate, imerode and imfill.
Do you have solution for that, I have been struggling for weeks. BW_img_marked.jpg

답변 (1개)

Subhadeep Koley
Subhadeep Koley 2020년 2월 4일

0 개 추천

Hi, try the code below and see if it gives the expected output. (Download the attached image)
a = rgb2gray(imread('BW_img_marked.jpeg'));
b = imbinarize(a);
se = strel('disk', 12, 4); % Structuring element for dilation
c = imdilate(b, se); % Dilating the image
d = imfill(c,'holes'); % Filling the holes
imshow(d);
filledBWImage.png

댓글 수: 3

Mithushan Soundaranathan
Mithushan Soundaranathan 2020년 2월 4일
Hi,
Thank you very much for the response, i have tried that.
The problem is that is closes the area which I have marked in the image below, which is not desired
filledBWImage_LI.jpg
Mithushan Soundaranathan
Mithushan Soundaranathan 2020년 2월 4일
편집: Mithushan Soundaranathan 2020년 2월 4일
I though of something similar to this, to find the outer boundary?
Jonne
Jonne 2021년 4월 29일
Nice how did you do this? could you share the code

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2020년 2월 4일

댓글:

2021년 4월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by