
% 1get the filename
dataSource = groundTruthDataSource(MoisImageset.imageFilename);
%2 table your class
ldc = labelDefinitionCreator();
addLabel(ldc,'Moisture',labelType.Rectangle);
addLabel(ldc,'Joint',labelType.Rectangle);
labelDefs = create(ldc)
%3 data,only two classes
MoistureTruth =MoisImageset.Moisture;
JointTruth=MoisImageset.Joint;
labelNames = {'Moisture';'Joint'};
labelData = table(MoistureTruth,JointTruth,'VariableNames',labelNames);
%4 get ground truth ,then you can use
gTruth = groundTruth(dataSource,labelDefs,labelData);
.
Besides
Change the table to datasource
%Add Rebar here ......Oct.22,2021
% Create an image datastore for loading the images.
imdsTrain =imageDatastore(RebarTrain227.filename); %imageDatastore(trainingDataTbl.imageFilename);
imdsTest =imageDatastore(RebarTest227.filename);%imageDatastore(testDataTbl.imageFilename);
%Create a datastore for the ground truth bounding boxes.
bldsTrain =boxLabelDatastore(RebarTrain227(:,2:end));% boxLabelDatastore(trainingDataTbl(:, 2:end));
bldsTest = boxLabelDatastore(RebarTest227(:,2:end));%boxLabelDatastore(testDataTbl(:, 2:end));
%Combine the image and box label datastores.
trainingData = combine(imdsTrain, bldsTrain);
testData = combine(imdsTest, bldsTest);
博客提及将表格转换为数据源,但未提供更多详细信息。推测围绕此操作在信息技术领域可能涉及数据处理等相关内容。

390

被折叠的 条评论
为什么被折叠?



