-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathevalFlowResults.m
30 lines (26 loc) · 887 Bytes
/
evalFlowResults.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
function [errList, aep] = evalFlowResults(subfolder)
% valuate current flow results on sintel
%% check params
% use sintel param
param = globalParam('sintel');
%% setup folder structure
gtFolder = fullfile(param.flowPath, 'Groundtruth');
resFolder = fullfile(param.flowPath, subfolder);
%% check all files
gtList = dir(fullfile(gtFolder, '*.flo'));
resList = dir(fullfile(resFolder, '*.flo'));
errList = zeros([1 length(gtList)]); aep = 0;
if length(gtList) ~= length(resList)
fprintf('Can not match flow results\n');
return;
end
parfor i=1:length(gtList)
% read all files
gtFlow = readFlowFile(fullfile(gtFolder, gtList(i).name));
resFlow = readFlowFile(fullfile(resFolder, gtList(i).name));
% end point error
err = sqrt(sum((gtFlow - resFlow).^2, 3));
errList(i) = mean(err(:));
end
aep = mean(errList);
fprintf('Optical flow average end point error %0.3f\n', aep)