Is it possible to fill the kink at 4 o'clock in this image?

조회 수: 1 (최근 30일)
Pranaya Kansakar
Pranaya Kansakar 2020년 6월 17일
답변: Image Analyst 2020년 6월 18일
I have a BW image that's nearly circular, save the dent on the right side. Is it possible to fill this dent?
Also, is the segmentation on the second image good? Could you provide your thoughts?
Thanks!

채택된 답변

Image Analyst
Image Analyst 2020년 6월 18일
I'd call imfill, then bwareafilt(mask, 1) to get the largest blob.
mask = imfill(mask, 'holes');
mask = bwareafilt(mask, 1);
Then call bwboundaries and use the FAQ to fit it to a circle.
boundaries = bwboundaries(mask);
boundaries = boundaries{1};
x = boundaries(:, 2);
y = boundaries(:, 1);
Then use poly2mask to make a mask of the perfect/fit circle and AND the two
[rows, columns] = size(mask);
circleMask = poly2mask(xCircle, yCircle, rows, columns);
outputMask = mask & circleMask;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by