-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcode102_CWT_Creator.m
More file actions
44 lines (33 loc) · 1.05 KB
/
code102_CWT_Creator.m
File metadata and controls
44 lines (33 loc) · 1.05 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
clear
clc
close all
parentDir = pwd;
dataDir = '2022-01-24_SquareRef_L10';
caseDir = 'Sensor5Scenario';
cd(fullfile(parentDir,dataDir,caseDir))
load(fullfile('DMDDataDL.mat'))
for i = 1:1:length(DMDDataDL.Data)
refFolder = ['Scenario_' num2str(i)];
Data = DMDDataDL.Data(1,i);
Data = Data{1};
Labels = DMDDataDL.Labels(1,i);
Labels = Labels{1};
dataWndL = size(Data,2);
Fs = 100;
fb = cwtfilterbank('SignalLength',dataWndL,...
'SamplingFrequency',Fs,...
'VoicesPerOctave',12);
r = size(Data,1);
for ii = 1:r
cfs = abs(fb.wt(Data(ii,:)));
im = ind2rgb(im2uint8(rescale(cfs)),jet(128));
imgLoc = fullfile(fullfile(parentDir,dataDir,caseDir,refFolder),char(Labels(ii)));
if exist(imgLoc,'dir')
else
mkdir(imgLoc)
end
imFileName = strcat(char(Labels(ii)),'_',num2str(ii),'.jpg');
imwrite(imresize(im,[224 224]),fullfile(imgLoc,imFileName),'jpg');
end
disp([refFolder ' completed!!'])
end