← all work classical-computer-vision

Optical flow

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-3776AB?logo=python&logoColor=white)](https://www.python.org/)

Result

SrSceneLucas–KanadeLK pyramid (3)Horn–SchunckFarnebäck**DIS**
1man in striped shirt · texture 613.117 px0.765 px3.324 px1.667 px**0.307 px**
2bighorn on rock · texture 693.320 px0.247 px3.392 px0.226 px**0.208 px**
3stone archway · texture 733.579 px0.428 px3.720 px0.777 px**0.200 px**
4carved mask on thatch · texture 853.672 px0.250 px3.730 px0.331 px**0.227 px**

The finding

Where each method dies

Plain LK's answer is 1 pixel. At 1 px it scores 0.221 against a control of 1.118 — it is working. At 2 px it scores 1.524 against 2.236, which is two thirds of the way to having found nothing, and by 4 px it is indistinguishable from the control. The textbook's "one to two pixels" is right, and the useful half of the range is the first one.

DIS does not break anywhere in this sweep. Its error at 32 px (0.238) is lower than plain LK's at 1 px. It is also faster than Farnebäck.

### Each pyramid level roughly doubles the tractable motion

The largest displacement still handled with an EPE below half the displacement:

The 2^L story holds from level 1 onward. The first level buys a factor of 4, not 2 — the coarse level halves the displacement *and* blurs away the fine structure the linearisation was tripping over, so it gets paid twice. A 4-level pyramid takes a method that dies at 1 px and carries it to 32.

---

Figures

flow.png
flow

Elsewhere

Code and full results on GitHub (code private)

Every number is read from the file the run produced. github.com/hammasbuilds · kaggle.com/muhammadhammas13