How to fill a gap between line segments in an image

조회 수: 5 (최근 30일)
Abdul Hannan Qureshi
Abdul Hannan Qureshi 2022년 6월 4일
댓글: Abdul Hannan Qureshi 2022년 6월 5일
I am working on raster images. How I can fill up this gap between line segments, as shown in figure below.
the raster image file is enclosed. Kindly advice.

채택된 답변

Matt J
Matt J 2022년 6월 4일
편집: Matt J 2022년 6월 4일
load gap
Irasterl=imclose(Irasterl,ones(3));
imshow(Irasterl,[])

추가 답변 (1개)

Image Analyst
Image Analyst 2022년 6월 4일
For single pixel gaps you can also use bwmorph with the 'bridge' option.
Irasterl = bwmorph(Irasterl, 'bridge');

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by