-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode_for_energy_image.m
33 lines (33 loc) · 1.21 KB
/
Code_for_energy_image.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
27
28
29
30
31
32
33
path='H:\Gait_IIT_BHU_Analysis\Pose_Energy_Image\data\Normalized_Silhouette_frames\';
save_path='H:\Gait_IIT_BHU_Analysis\Pose_Energy_Image\data\Normalized_Silhouette_frames_GEI\';
list = dir(path);
fName = {list.name};
[~,y1]=size(fName);
path
y1
tic;
for f_no=3:y1
listin = dir(char(strcat(path,fName(f_no),'\')));
fNamein = {listin.name};
[~,y2]=size(fNamein);
fName(f_no)
for ff_no=3:y2
listinin = dir(char(strcat(path,fName(f_no),'\',fNamein(ff_no),'\')));
fNameinin = {listinin.name};
[~,y3]=size(fNameinin);
path2=char(strcat(path,fName(f_no),'\',fNamein(ff_no),'\'));
sumimage=double(zeros(size((imread(char(strcat(path2,fNameinin(3))))))));
for fff_no=3:y3
image=(imread(char(strcat(path2,fNameinin(fff_no)))));
%image=imresize(image,size(sumimage));
sumimage=sumimage+double(image);
end
max1=max(sumimage(:));
energyimg=sumimage/max1;
if ~exist(char(strcat(save_path,fName(f_no),'\')),'dir')
mkdir(char(strcat(save_path,fName(f_no),'\')));
end
imwrite(energyimg,char(strcat(save_path,fName(f_no),'\',fNamein(ff_no),'.png')));
end
end
toc;