1
votes

I'm using the function imfindcircles on image but occurs an error that says that function or method 'imfindcircles' for input arguments of type 'uint8'. I'm using this tutorial of Mathworks. My code:

rgb = imread('circles.png');
figure
imshow(rgb)
gray_image = rgb2gray(rgb);
imshow(gray_image);
[centers, radii, metric] = imfindcircles(I,[40 45]);
centersStrong5 = centers(1:5,:);
radiiStrong5 = radii(1:5);
metricStrong5 = metric(1:5);

This is the error: ??? Undefined function or method 'imfindcircles' for input arguments of type 'uint8'.

1
Do you happen to have a file called imfindcircles.m in your current working directory?beaker
No. This is function of MatlabPedro Marques
I understand that MATLAB has a function called imfindcircles. What I'm asking is if you've overshadowed that implementation with your own function or variable name. Because that's the only way I can think of right now that that error makes sense.beaker
I google it and find that this function is implementend on Image Processing toolbox. How do I install this toolbox?Pedro Marques
If you don't already have a license, you buy one from Mathworks. mathworks.com/products/imagebeaker

1 Answers

0
votes

You got that error because I was not defined. Replace I with gray_image and it'll work.

 [centers, radii, metric] = imfindcircles(gray_image,[40 45]);

You don't need any special toolbox or license for this function.