Labeling an Image (houghcircle)
5 views (last 30 days)
Show older comments
I have a code that takes an image of coins and draws the respective hough circles around them as well as gives me the circle's radius in a resulting vector. I want to take the radiuses generated in the vector and place them on the respective circle that they align with and I am hvaing an issue doing so. I have tried plotting the values; however, it gives me a different graph. I want the image with the hough circles to have the corresponsing values on that graph as well.Thanks!
Code:
clear all
clc
%Show Image in GrayScale
I = imread('1.png');
imshow(I)
BWI = im2gray(I);
figure
imshow(BWI)
%%Increase Sensitivity if the coins/circles are not found, Make sure radius is correct and includes entire range
[centers,radii] = imfindcircles(BWI,[10 74],'ObjectPolarity','bright', 'Sensitivity',0.93);
viscircles(centers,radii,'color','r')
length(centers)
0 Comments
Answers (1)
Maik
on 7 Nov 2022
% Code:
clear all
clc
%Show Image in GrayScale
I = imread('coins.png');
imshow(I)
BWI = im2gray(I);
figure
imshow(BWI)
%%Increase Sensitivity if the coins/circles are not found, Make sure radius is correct and includes entire range
[centers,radii] = imfindcircles(BWI,[8 74],'ObjectPolarity','bright', 'Sensitivity',0.93);
viscircles(centers,radii,'color','r')
length(centers)
% Draw Radius Function
for i = 1:size(centers,1)
line([centers(i,1) centers(i,1)],[centers(i,2) centers(i,2)+radii(i,1)], 'color', 'b' );
end
0 Comments
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!