Is it possible to fill the kink at 4 o'clock in this image?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Pranaya Kansakar
am 17 Jun. 2020
Beantwortet: Image Analyst
am 18 Jun. 2020
I have a BW image that's nearly circular, save the dent on the right side. Is it possible to fill this dent?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/317892/image.png)
Also, is the segmentation on the second image good? Could you provide your thoughts?
Thanks!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/317895/image.png)
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 18 Jun. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!