How to solve the error: Expected input number 2, B, to be one of these types: logical, double, categorical Instead its type was uint8?
29 次查看(过去 30 天)
显示 更早的评论
I used jaccard method as following:
A = imread('R7001-60.png');
I = im2gray(A);
figure
imshow(I)
title('OutPut Image')
mask = false(size(I));
mask(25:end-25,25:end-25) = true;
BW = activecontour(I, mask, 300);
BW_groundTruth = imread('gT7001_60.png');
similarity = jaccard(BW, BW_groundTruth);
and I got the following error:
Error using jaccard
Expected input number 2, B, to be one of these types:
logical, double, categorical
Instead its type was uint8.
Error in
jaccard>@(x,name,pos)validateattributes(x,{'logical','double','categorical'},{'real','nonempty','nonsparse'},mfilename,name,pos)
(line 118)
validateInput = @(x,name,pos) validateattributes(x, ...
Error in jaccard (line 124)
validateInput(B,'B',2);
Error in Gtruth3 (line 37)
similarity = jaccard(BW, BW_groundTruth);
can anyone help me to fix it?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!