-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadSignData.m
26 lines (21 loc) · 997 Bytes
/
readSignData.m
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
function [rImgFiles, rRois, rClasses] = readSignData(aFile)
% Reads the traffic sign data.
%
% aFile Text file that contains the data for the traffic signs
%
% rImgFiles Cell-Array (1 x n) of Strings containing the names of the image
% files to operate on
% rRois (n x 4)-Array containing upper left column, upper left row,
% lower left column, lower left row of the region of interest
% of the traffic sign image. The image itself can have a
% small border so this data will give you the exact bounding
% box of the sign in the image
% rClasses (n x 1)-Array providing the classes for each traffic sign
fID = fopen(aFile, 'r');
fgetl(fID); % discard line with column headers
f = textscan(fID, '%s %*d %*d %d %d %d %d %d', 'Delimiter', ';');
rImgFiles = f{1};
rRois = [f{2}, f{3}, f{4}, f{5}];
rClasses = f{6};
fclose(fID);
end