How to fix error:Unrecognized method, property, or field 'imageFilename' for class 'groundTruth'. ?

32 次查看(过去 30 天)
I am new biggener in image processing, I used iamge labeler App and I export the labeled image, then I would like to calculate the similarity :
load('label7027_157.mat')
gTruth
ix=contains(gTruth.imageFilename,'LabelData');
A = logical(imread('7027-157.png'));% look up which is the desired file
BW_groundTruth=logical(imread(gTruth.imageFilename{ix})); % read that image file.
similarity = jaccard(squeeze(A(:,:,1)), BW_groundTruth)
gTruth =
groundTruth with properties:
DataSource: [1×1 groundTruthDataSource]
LabelDefinitions: [1×6 table]
LabelData: [1×1 table]
Unrecognized method, property, or field 'imageFilename' for class 'groundTruth'.
Error in trial2 (line 3)
ix=contains(gTruth.imageFilename,'LabelData');
How to fix this error?

回答(1 个)

Steven Lord
Steven Lord 2023-10-13
Nowhere on the documentation page for the groundTruth object does the identifier "imageFilename" appear (except in an example as one of the variables in the table array named stopSignsAndCars in the MAT-file stopSignsAndCars.mat.) It is not a property of groundTruth objects.
Is there something on a documentation page or in an example that led you to believe that object has such a property? If so please post a link to that documentation page or example so we can determine if that needs to be corrected or clarified.

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by