How to fix error: Error using logical Conversion to logical from table is not possible?
16 ビュー (過去 30 日間)
古いコメントを表示
I I used pixel label from image labeler App.There is a menu 'Export Labels > To workSpace' in the Image Labeler App and it exports a table format called gTruth as shown in attached , I got an error when I used it in similarity evaluation as following
A = logical(imread('7001-236.png'));
BW_groundTruth =logical(gTruth);
similarity = jaccard(squeeze(A(:,:,1)), BW_groundTruth)
Error using logical
Conversion to logical from table is not possible.
Error in Untitled_ask (line 5)
BW_groundTruth =logical(gTruth)
how to fix it?
2 件のコメント
Dyuman Joshi
2023 年 10 月 11 日
The error clearly states what the problem is.
load('matlab.mat')
gTruth
How are you going to take logical values of text?
採用された回答
dpb
2023 年 10 月 11 日
移動済み: dpb
2023 年 10 月 11 日
Well, all you've shown us is a file name in a folder that contains that text string; one presumes you would then have to also load that image as the comparison one?
ix=contains(gTruth.imageFilename,'PixelLabelData'); % look up which is the desired file
BW_groundTruth=logical(imread(gTruth.imageFilename(ix))); % read that image file...
6 件のコメント
dpb
2023 年 10 月 12 日
Just loop thru the array of filenames with a for loop using the index of the loop...
for i=1:height(gTruth)
figure
imshow(gTruth.imageFilename{i})
end
"Salt to suit..."
その他の回答 (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!