Effacer les filtres
Effacer les filtres

Find the circle for the image using imfindcircles

1 vue (au cours des 30 derniers jours)
Pankaja Tanjore
Pankaja Tanjore le 3 Mar 2015
Commenté : Ashish Uthama le 3 Mar 2015
Hello,
I have an image for which i need to determine the outer circle and then find the centre for the outer circle.I am using the function
imfindcircles()
I have the following code to do this :
img2 = imread('Image.bmp'); imshow(img2);
% Find all the circles with radius >= 15 and radius <= 30
[centers, radii, metric] = imfindcircles(img2,[15 416]);
% Retain the five strongest circles according to metric values
centersStrong5 = centers(1:1,:);
radiiStrong5 = radii(1:1);
metricStrong5 = metric(1:1);
% Draw the circle perimeter for the five strongest circles
viscircles(centersStrong5, radiiStrong5,'EdgeColor','b');
but when i run this code i am getting the following error.
Error in Cap_Test (line 16)
centersStrong5 = centers(1:1,:);
Please let me know the reason for this and how to solve this.
I am attaching the image here for which I need to find the centre.
The radius for this is around 416.
Looking forward to hear from you.
Thanks Pankaja
  1 commentaire
Ashish Uthama
Ashish Uthama le 3 Mar 2015
The image attachment did not make it through, could you try again?

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by