-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerateGroundTruth.m
More file actions
27 lines (20 loc) · 882 Bytes
/
generateGroundTruth.m
File metadata and controls
27 lines (20 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% Helper code to generate some label definitions for the test images.
function gTruth = generateGroundTruth
% Label definitions
ldc = labelDefinitionCreator;
labels = {'person','vehicle','outdoor','animal','accessory','sports', ...
'kitchen','food','furniture','appliance','indoor' };
% Create randomized label colors for the categories
for i=1:numel(labels)
addLabel(ldc,labels{i},'Rectangle','LabelColor',rand([1,3]))
end
labelDefs = create(ldc);
% DataSource for the images
imageFilenames = {'stopSignTest.jpg','camp.jpg'};
imageFilenames = fullfile(pwd,'Testimages',imageFilenames);
dataSource = groundTruthDataSource(imageFilenames);
% Empty Ground truth
labelData =cell2table(cell(2,11), 'VariableNames', labels);
%Ground Truth object
gTruth = groundTruth(dataSource,labelDefs,labelData);
end