필터 지우기
필터 지우기

How to make a 2-d binary shape a little more round?

조회 수: 9 (최근 30일)
Eli
Eli 2011년 6월 1일
Hi All,
I'm new to image processing, and hope you can help: I managed to generate a binary mask indicating the location of roundish shapes in an image. The problem is that sometimes the mask is not very round and I want make it a little rounder, i.e., smooth the irregularities a bit, but not loose the original shape. Can anyone suggest a way to do that?
Thanks, Rachel

채택된 답변

Jan
Jan 2011년 6월 1일
You can try IMDILATE(IMERODE(Image)):
img = imread('text.png');
radius = 1;
imga = imdilate(img, strel('disk', radius));
imgb = imerode(img, strel('disk', radius));
A bigger radius removes more details.
  댓글 수: 2
Sean de Wolski
Sean de Wolski 2011년 6월 1일
The above is the same as a morphological closing, imclose.
Eli
Eli 2011년 6월 2일
thanks, I'll try that!

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

추가 답변 (1개)

Wolfgang Schwanghart
Wolfgang Schwanghart 2011년 6월 1일
You could also use a median filter to remove small objects and irregular boundaries. In a BW image, the median image would act like a majority filter.

Community Treasure Hunt

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

Start Hunting!

Translated by