Find the circle for the image using imfindcircles

2 ビュー (過去 30 日間)
Pankaja Tanjore
Pankaja Tanjore 2015 年 3 月 3 日
コメント済み: Ashish Uthama 2015 年 3 月 3 日
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 件のコメント
Ashish Uthama
Ashish Uthama 2015 年 3 月 3 日
The image attachment did not make it through, could you try again?

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by