How to bridge the gaps

조회 수: 11 (최근 30일)
Stelios Fanourakis
Stelios Fanourakis 2019년 9월 17일
댓글: KALYAN ACHARJYA 2019년 9월 17일
Please, see attached image.
I already, tried bwmorph(img,'bridge'); but it couldn't connect the detached lines.
I don't want to use extreme values of imdilate() since then the original shape and direction of the lines is lost. With extreme values of imdilate() I get thicker lines and this is not something I want to. I want to retain the same thickness but to get them elongated in a way so they can connect.
Any advice please?
Thanks

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 9월 17일
편집: KALYAN ACHARJYA 2019년 9월 17일
"I want to retain the same thickness but to get them elongated in a way so they can connect".
I tried using
se=strel('line',h,v);
result=imdilate(binary_image,se);
After that
use imerode (different structuring element), may be you will get similar to the original shape, with reaching the almost equal thickness.
  댓글 수: 4
Stelios Fanourakis
Stelios Fanourakis 2019년 9월 17일
Yeah. The small gaps filled. However there is a big gap at the upper curve that when I use high values e.g. 45 or 55 for horizontal and 14 for vertical in order to bridge the big gap, they usually tend to lose their shape and direction.
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 9월 17일
Please look here it may helps

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by