-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakeSynthBoxes.m
More file actions
82 lines (72 loc) · 2.36 KB
/
makeSynthBoxes.m
File metadata and controls
82 lines (72 loc) · 2.36 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
dataDir = '';%afs/umich.edu/user/b/j/bjocelyn/eecs445/Team_Avatar/';%'/afs/umich.edu/user/a/n/andersct/Public/difficult_buoy/'; %pwd + /
green = 'synth_data/green/';
white = 'synth_data/white/';
red = 'synth_data/red/';
black = 'synth_data/black/';
blue = 'synth_data/blue/';
yellow = 'synth_data/yellow/';
greenPics = dir(sprintf('%s*.png',[dataDir, green]));
whitePics = dir(sprintf('%s*.png',[dataDir, white]));
redPics = dir(sprintf('%s*.png',[dataDir, red]));
blackPics = dir(sprintf('%s*.png',[dataDir, black]));
bluePics = dir(sprintf('%s*.png',[dataDir, blue]));
yellowPics = dir(sprintf('%s*.png',[dataDir, yellow]));
synthPicsData = cell(length(greenPics) + length(whitePics) + 1400 + length(blackPics) + length(bluePics) + length(yellowPics), 3);
ind = 1;
%{
case {1}
out = 'red';
case {2}
out = 'green';
case {3}
out = 'white';
case {4}
out = 'blue';
case {5}
out = 'yellow';
case {6}
out = 'black';
%}
for i=1:length(greenPics)
synthPicsData{ind,1}(1:2,1) = [1,100];
synthPicsData{ind,1}(1:2,2) = [1,100];
synthPicsData{ind,2} = 2;
synthPicsData{ind,3} = [green, greenPics(i).name];
ind = ind + 1;
end
for i=1:length(whitePics)
synthPicsData{ind,1}(1:2,1) = [1,100];
synthPicsData{ind,1}(1:2,2) = [1,100];
synthPicsData{ind,2} = 3;
synthPicsData{ind,3} = [white, whitePics(i).name];
ind = ind + 1;
end
for i=1:1400
synthPicsData{ind,1}(1:2,1) = [1,100];
synthPicsData{ind,1}(1:2,2) = [1,100];
synthPicsData{ind,2} = 1;
synthPicsData{ind,3} = [red, redPics(i).name];
ind = ind + 1;
end
for i=1:length(blackPics)
synthPicsData{ind,1}(1:2,1) = [1,100];
synthPicsData{ind,1}(1:2,2) = [1,100];
synthPicsData{ind,2} = 6;
synthPicsData{ind,3} = [black, blackPics(i).name];
ind = ind + 1;
end
for i=1:length(bluePics)
synthPicsData{ind,1}(1:2,1) = [1,100];
synthPicsData{ind,1}(1:2,2) = [1,100];
synthPicsData{ind,2} = 4;
synthPicsData{ind,3} = [blue, bluePics(i).name];
ind = ind + 1;
end
for i=1:length(yellowPics)
synthPicsData{ind,1}(1:2,1) = [1,100];
synthPicsData{ind,1}(1:2,2) = [1,100];
synthPicsData{ind,2} = 5;
synthPicsData{ind,3} = [yellow, yellowPics(i).name];
ind = ind + 1;
end
save(sprintf('%ssynthBoxes.mat',dataDir),'synthPicsData');