2017-01-04 22:32:38 +00:00
|
|
|
clear
|
|
|
|
|
|
|
|
if(isunix)
|
|
|
|
executable = '"../../build/bin/FeatureExtraction"';
|
|
|
|
else
|
|
|
|
executable = '"../../x64/Release/FeatureExtraction.exe"';
|
|
|
|
end
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-11-24 17:16:15 +00:00
|
|
|
output = './processed_features/';
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-11-24 17:16:15 +00:00
|
|
|
in_file = '../../samples/2015-10-15-15-14.avi';
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-11-24 17:16:15 +00:00
|
|
|
command = sprintf('%s -f "%s" -out_dir "%s" -gaze -verbose', executable, in_file, output);
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-01-04 22:32:38 +00:00
|
|
|
if(isunix)
|
|
|
|
unix(command);
|
|
|
|
else
|
|
|
|
dos(command);
|
|
|
|
end
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
%% Demonstrating reading the output files
|
2017-11-24 17:16:15 +00:00
|
|
|
[~, out_filename,~] = fileparts(in_file);
|
2018-02-04 21:27:12 +00:00
|
|
|
out_filename = sprintf('%s/%s.csv', output, out_filename);
|
2017-11-24 17:16:15 +00:00
|
|
|
|
|
|
|
% First read in the column names
|
|
|
|
tab = readtable(out_filename);
|
|
|
|
column_names = tab.Properties.VariableNames;
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-11-24 17:16:15 +00:00
|
|
|
all_params = dlmread(out_filename, ',', 1, 0);
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-11-24 17:16:15 +00:00
|
|
|
gaze_angle_ids = cellfun(@(x) ~isempty(x) && x==1, strfind(column_names, 'gaze_angle_'));
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-11-24 17:16:15 +00:00
|
|
|
gaze = all_params(:,gaze_angle_ids);
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
plot(gaze(:,1), 'DisplayName', 'Left - right');
|
|
|
|
hold on;
|
|
|
|
plot(gaze(:,2), 'DisplayName', 'Up - down');
|
|
|
|
xlabel('Frame') % x-axis label
|
2017-11-24 17:16:15 +00:00
|
|
|
ylabel('Angle in radians') % y-axis label
|
2016-04-28 19:40:36 +00:00
|
|
|
legend('show');
|
|
|
|
hold off;
|