How to fill a hollow donut-shaped object so that it looks like a circle?
10 次查看(过去 30 天)
显示 更早的评论
I have a segmentation that looks like a donut (see image attached). I want to fill the "donut hole" so that the segmentation looks like a circle instead of a donut. I feel like there has to be a simple solution but I cannot seem to figure it out. I have tried inverting the image using imcomplement and then using bwconncomp and regionprops to find the pixel indices of the two objects in the image (1 being the centre circle, the other being the background pixels which are now white, as seen in the attached image). However, running bwconncomp on the inverted image, I can get the pixel indices of the white pixels, but there is no distinction between the two objects such that I can set the "background" area to black and keep the centre circle as white. Is there any other solution?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!