Fitting some circles to the corner points of an image
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone,
I am working on the image of asphalt aggregates and I am going to extract some properties of them ( such as roundness). To compute this index, I need the circles which fitted to the curved part of the object(as can be seen in the image that I have uploaded). As you can see in the picture, I need the radius of the green circles. Do you know how can I extract them?
For finding the coordinates of boundary points from images, I used the following functions;
b=imread('aggregate.png');
BW = im2bw(b,0.36);
boundaries = bwboundaries(BW);
numberOfBoundaries = size(boundaries, 1);
hold on;
for k = 1 : numberOfBoundaries
thisBoundary = boundaries{k};
x = thisBoundary(:,2);
y= thisBoundary(:,1);
end
And then I tried to use function 'circfit' to fit a circle to the corner(or curved part) but I couldnt.
0 Kommentare
Antworten (1)
Amit Dhakite
am 8 Jun. 2023
Hi Narges,
To find out details about the circles from an image, you can consider the following code which detects circles in an image and returns their centers as well as radii using "imfindcircles()" functon.
% Read the image
rgb = imread("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1201918/aggregate.png");
imshow(rgb);
% Extract their centers and radii using imfindcircles()
[centers,radii] = imfindcircles(rgb,[20 25],"ObjectPolarity","dark", "Sensitivity",0.955, ...
"Method","twostage")
fprintf("Number of circles detected: %d", length(centers));
To know more about detecting circles in an image, kindly refer to the following links:
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!