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