Undefined function 'graythresh' for input arguments of type 'uint8'
Show older comments
img1=imread('Counting.jpg');
imshow(img1)
img1=rgb2gray(img1);
imshow(img1)
img2=im2bw(img1,graythresh(img1));
imshow(img2)
img2=~img2;
imshow(img2)
B = bwboundaries(img2);
imshow(img2)
text(10,10,strcat('\color{green}Objects Found:',num2str(length(B))))
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 0.2)
end
When I type this in, I get an error saying, "Undefined function 'graythresh' for input arguments of type 'uint8'
Does anybody know why? Help would be greatly appreciated.
Accepted Answer
More Answers (1)
Bassel
on 24 Feb 2016
0 votes
Hello, I have the same problem. although i have installed the "Image Processing Toolbox"

It'll be great if you can help me.
kind regards Bassel
2 Comments
Image Analyst
on 9 Nov 2018
You may have it installed but don't have a license for it, for example you're in a pool of licenses and all the Image Processing licenses are checked out when you try to check one out. What does this show:
>> hasLicenseForToolbox = license('test', 'image_toolbox') % Check for Image Processing Toolbox.
hasLicenseForToolbox =
1
As you can see, you should see a 1 if there is a license available.
minseok kang
on 16 May 2022
thank you - from south korea
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!