Skip to content
AI360Xpert
Beta

Endpoint Error Optical Flow

The pixel distance between predicted and true motion vectors, averaged into one flow accuracy number.

Endpoint error measures the pixel gap between predicted and true flow arrows, then averages over the image
Endpoint error measures the pixel gap between predicted and true flow arrows, then averages over the image

Why Does This Exist?

Flow predicts one motion arrow per pixel. Judging arrows needs one distance that matches eyes: how far is the tip off. Endpoint error takes Euclidean distance between predicted (up,vp)(u_p, v_p) and true (ut,vt)(u_t, v_t) vectors, then averages, giving flow one headline.

This page gives the formula, one recomputed arrow and misread traps. Robust variants live with outlier rates beside EPE.

Think of It Like This

Two darts on the same board

Truth sticks a dart, prediction sticks another. Endpoint error is the ruler between the two tips.

Average that ruler over every throw and you grade the whole game.

How It Actually Works

Per pixel, EPE=(up−ut)2+(vp−vt)2\text{EPE} = \sqrt{(u_p - u_t)^2 + (v_p - v_t)^2} in pixels. Mean EPE averages over valid pixels. Small-camera-motion scenes score low easily, large motions dominate means, so reports add outlier shares above thresholds like 3 pixels.

Worked arrow example

Take truth (5,0)(5, 0) and prediction (3,4)(3, 4). Gaps are −2-2 and 44. Squared sum is 4+16=204 + 16 = 20. EPE is 20≈4.472\sqrt{20} \approx 4.472 pixels. One diagonal miss costs more than its axis parts suggest.

Code

Per-vector gap plus a tiny mean.

import numpy as np

def epe(p: np.ndarray, t: np.ndarray) -> float:    return round(float(np.sqrt(((p - t) ** 2).sum())), 3)

print(epe(np.array([3.0, 4.0]), np.array([5.0, 0.0])))# -> 4.472

Gaps minus 2 and 4 give about 4.472 pixels.

Watch Out For

Reading mean EPE without outlier share

A few huge sky or occlusion gaps can rule the mean while most pixels sit tight. The symptom is a bad headline on a mostly good field. Fix it by reporting outlier rate beside the mean.

The Quick Version

  • EPE is Euclidean gap between predicted and true flow vectors in pixels.
  • Toy (3,4)(3,4) versus (5,0)(5,0) gives 20≈4.472\sqrt{20} \approx 4.472.
  • Mean EPE averages over valid pixels, lower is better.
  • Use it as the flow headline with outlier rates beside it.
  • Large motions dominate, so slice by speed.