-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMindy.m
69 lines (63 loc) · 1.43 KB
/
Mindy.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
66
67
68
69
% Silent Piano
temp = load('template.mat');
vid = VideoReader(fullfile('videos','TwoHanded.mov'));
figure(1);
vidWidth = vid.Width;
vidHeight = vid.Height;
original = readFrame(vid);
f = original;
map = createMap(original, vidHeight);
[ x, y, fs ] = stabilize_frame( f, temp, 2 );
<<<<<<< HEAD
vid.CurrentTime = 2;
% createMap(f)
=======
vid.CurrentTime = 1;
>>>>>>> 13dc5187b26fff6d26caa76e790be875e8d6204e
m = 2;
count = 1;
figure
while hasFrame(vid)
fprev = f;
fprevs = fs;
f = readFrame(vid);
[ x, y, fs ] = stabilize_frame( f, temp, 2 );
nh = noHandsFilter(f);
nhf = nh(3:718,3:1278);
diff = abs(fs-fprevs);
%se = ones(4,1);
bwd = im2bw(diff,.2);
d = bwd.*nhf;
d1 = sum(d);
% for i = 1:floor(1276/m)
% d2(1,i) = d1(1,m*i-1)+ d1(1,m*i); %2 col each bin
% %d2(1,i) = d1(1,m*i-1)+ d1(1,m*i-2)+ d1(1,m*i); %3 col each bin
% end
% subplot(2,1,1);
% imshow(fs);
% subplot(2,1,2);
%imshow(d1);
plot(d1);
ylim([0, 200]);
str = sprintf('%f ',count);
title(str);
drawnow;
count = count +1;
end
<<<<<<< HEAD
% for i = 1:26
% H = map{i,2};
% Hnew = H(3:718,3:1278);
% a(1,i) = sum(sum(d.*Hnew));
% end
=======
for i = 1:26
H = map{i,2};
Hnew = H(3:718,3:1278);
a(1,i) = sum(sum(d.*Hnew));
end
>>>>>>> 13dc5187b26fff6d26caa76e790be875e8d6204e
% m = [7;1;4;4;12;2;6;10;2];
% [temp,originalpos] = sort( m, 'descend' );
% n = temp(1:3);
% p=originalpos(1:3);