How to remove thin lines in binary image

How to remove thin horizontal or verticle lines - image attached
line thinkness < 3 -- remove
lines thinkness > 5-- stay
small objects -- remove

回答 (2 件)

Matt J
Matt J 2023 年 10 月 30 日
編集済み: Matt J 2023 年 10 月 30 日

1 投票

Image=imopen(Image,ones(3));
Image Analyst
Image Analyst 2023 年 10 月 30 日

0 投票

Like Matt said, use imopen to get rid of thin lines.
outputImage = imopen(binaryImage, ones(3, 3));
To get rid of small objects, of any shape, use bwareaopen or bwareafilt.

質問済み:

Az
2023 年 10 月 30 日

回答済み:

2023 年 10 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by