-
Notifications
You must be signed in to change notification settings - Fork 202
/
extracOpticalFlow.m
29 lines (25 loc) · 1.01 KB
/
extracOpticalFlow.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
function [] = extracOpticalFlow(index)
path1 = '/home/lmwang/data/UCF/ucf101_org/';
path2 = '/home/lmwang/data/UCF/ucf101_warp_flow_img/';
folderlist = dir(path1);
foldername = {folderlist(:).name};
foldername = setdiff(foldername,{'.','..'});
for i = index
if ~exist([path2,foldername{i}],'dir')
mkdir([path2,foldername{i}]);
end
filelist = dir([path1,foldername{i},'/*.avi']);
for j = 1:length(filelist)
if ~exist([path2,foldername{i},'/',filelist(j).name(1:end-4)],'dir')
mkdir([path2,foldername{i},'/',filelist(j).name(1:end-4)]);
end
file1 = [path1,foldername{i},'/',filelist(j).name];
file2 = [path2,foldername{i},'/',filelist(j).name(1:end-4),'/','flow_x'];
file3 = [path2,foldername{i},'/',filelist(j).name(1:end-4),'/','flow_y'];
file4 = [path2,foldername{i},'/',filelist(j).name(1:end-4),'/','flow_i'];
cmd = sprintf('./denseFlow -f %s -x %s -y %s -i %s -b 20',file1,file2,file3,file4);
system(cmd);
end
i
end
end