How to fill a black area with circles?

2 views (last 30 days)
Ryan Moore
Ryan Moore on 10 Mar 2020
Answered: Nikhil Sonavane on 13 Mar 2020
I'm using imfindcircles() of the Image Processing Toolbox to scan a simple rectangular image for black circles. When the dots are clumped, a region becomes black and imfindcircles() doesn't identify any circles. I've attached an example image and scan.
I'd like to flood/fill that region with circles anyway but am unsure how to proceed. The circles can overlap, or not, either is fine.
A script using the attached input file, resulting in the attached output file.
clear all;
close all;
function centers = dots_center(image,pixeldiameter,sensitivity)
[centers,radii] = imfindcircles(image,[pixeldiameter pixeldiameter],'ObjectPolarity','dark','Sensitivity',sensitivity)
hold on;
h = viscircles(centers,radii);
Ryan Moore
Ryan Moore on 11 Mar 2020
Yes you're right it wouldn't be technically correct, but this is just for a rough first order approximation.
If I was able to randomly fill the black areas with circles, it would be more informative for my needs than it's current state.

Sign in to comment.

Answers (1)

Nikhil Sonavane
Nikhil Sonavane on 13 Mar 2020
The area which you are concerned about is just a accumulation of black pixels. From the image there is no way to find the exact circles by which the black area is created unless you find a method with which the original image is created. But given only the image you won't be able to get fill the black region with circles.


Community Treasure Hunt

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

Start Hunting!