How to fill a black area with circles?

조회 수: 2 (최근 30일)
Ryan Moore
Ryan Moore 2020년 3월 10일
답변: Nikhil Sonavane 2020년 3월 13일
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.
clc;
clear all;
close all;
dots_center(imread("10_2.png"),6,1)
function centers = dots_center(image,pixeldiameter,sensitivity)
[centers,radii] = imfindcircles(image,[pixeldiameter pixeldiameter],'ObjectPolarity','dark','Sensitivity',sensitivity)
hold on;
imshow(image);
h = viscircles(centers,radii);
end
  댓글 수: 2
Ralf U.
Ralf U. 2020년 3월 11일
It does not identify any circles because there are none. And there is no way to tell, where they were. So the only thing left for you is guessing.
You can randomly fill the black areas with circles, although you would generate data, that did not exist in the first place. Depending on what you want to do with the result, it might get corrupted.
Ryan Moore
Ryan Moore 2020년 3월 11일
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.

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

답변 (1개)

Nikhil Sonavane
Nikhil Sonavane 2020년 3월 13일
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.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by