1 // Evaluate a .flo file against ground truth,
2 // outputting the average end-point error.
13 int main(int argc, char **argv)
15 Flow flow = read_flow(argv[1]);
16 Flow gt = read_flow(argv[2]);
19 for (unsigned y = 0; y < unsigned(flow.height); ++y) {
20 for (unsigned x = 0; x < unsigned(flow.width); ++x) {
21 float du = flow.flow[y * flow.width + x].du;
22 float dv = flow.flow[y * flow.width + x].dv;
23 float gt_du = gt.flow[y * flow.width + x].du;
24 float gt_dv = gt.flow[y * flow.width + x].dv;
25 sum += hypot(du - gt_du, dv - gt_dv);
28 fprintf(stderr, "Average EPE: %.2f pixels\n", sum / (flow.width * flow.height));