-
Notifications
You must be signed in to change notification settings - Fork 0
/
amplify_blood_circulation_changes.m
65 lines (48 loc) · 1.66 KB
/
amplify_blood_circulation_changes.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
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
clear ;
close all;
clc;
% Step
% This code applies spatial Gdown temporal function in order to amplify the
% color changes that blood circulation create on the face, so to make it
% visible.
% Define video paths
%video_path = '..\Forehead_Att\Forehead\';
%video_path = '..\Left_Cheek_Att\Left_Cheek\';
video_path = '..\Right_Cheek_Att\Right_Cheek\';
%day_subfolders = ['Day1\'; 'Day2\'; 'Day3\'];
day_subfolders = ['Right_out\'];
day_len = size(day_subfolders, 1);
person_subfolders = ['01\';'02\';'03\';'04\';'05\';'06\';'07\';'08\';'09\';'10\';'11\';'12\';'13\'];
person_len = size(person_subfolders, 1);
% Define out video path
%out_video_path = '..\Forehead_Amp\Forehead\';
%out_video_path = '..\Left_Cheek_Amp\Left_Cheek\';
out_video_path = '..\Right_Cheek_Amp\Right_Cheek\';
alpha = 120;
level = 4;
chromAttenuation = 1;
fl = 0.4;
fh = 4.0;
% For every day
for i=1:day_len
% For every person
for j=1:person_len
% Define video path
vpath = [video_path day_subfolders(i, :) person_subfolders(j, :)];
files = dir(vpath);
% For every video in vpath
for k=3:length(files)
% Load video
vfilename = [vpath files(k).name];
v = VideoReader(vfilename);
samplingRate = v.FrameRate;
% Construct video writer
[fpath, name, ext] = fileparts(files(k).name);
out_vfilename = [out_video_path day_subfolders(i, :) person_subfolders(j, :)];
tic
amplify_spatial_Gdown_temporal_ideal_Only_Amplification(vfilename,out_vfilename,alpha,level, ...
fl,fh,samplingRate, chromAttenuation);
toc
end
end
end