No value in centers when using imfindcircles

Hello, im trying to detect a circle caused fungi using imfindcircles function. But when i checked workspace there are no values in centres, radii, and metric that leads to Index exceeds matrix dimensions. Can anyone help me, please?
this is the script i used:
A=imread('1.jpg');
imshow(A)
B=rgb2gray(A);
figure, imshow(B)
[centers, radii, metric] = imfindcircles(A,[15 30]);
X= centers(1:1,:);
Y= radii(1:1);
Z= metric(1:1);
viscircles(X, Y,'EdgeColor','b');

2 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 22 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 22 日
Please do share image 1 (Use Clip Attach)
Please do explain, what you are trying to with 1:1?
Firecky Dwika
Firecky Dwika 2019 年 7 月 23 日
detecting a single circle, here is the picture i use:
1.jpg

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

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 22 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 22 日

0 投票

A=imread('1.jpg');
imshow(A);
B=rgb2gray(A);
figure,imshow(B)
[centers,radii,metric]=imfindcircles(A,[1 100]);
%........................................^^ change this as per requiremnets
viscircles(centers,radii,'EdgeColor','b');
See the results in case of my sample image
pic22.png
Please do read about return colm metric here.
Hope it helps!

2 件のコメント

Firecky Dwika
Firecky Dwika 2019 年 7 月 23 日
Thank you so much!!
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 23 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 23 日
you're welcome

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by