Smoothen lines/Remove jagged edges from lines in a binary image

7 ビュー (過去 30 日間)
stayfrosty
stayfrosty 2016 年 10 月 25 日
回答済み: Image Analyst 2018 年 11 月 2 日
As the question states, how would I go about making the lines of the attached binary image smoother/less jagged?
  1 件のコメント
JEONGSU KIM
JEONGSU KIM 2018 年 11 月 2 日
can I know what method did you use for this image?

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2018 年 11 月 2 日
Just blur it with conv2() or imfilter(), then threshold.
windowSize = 5; % Whatever odd integer you want that's more than 1.
kernel = ones(5)/windowSize^2;
blurredImage = conv2(grayImage, kernel, 'same');
binaryImage = blurredImage > 0.5;

製品

Community Treasure Hunt

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

Start Hunting!

Translated by