# Flow-guided inpainting: limit how many frames pixels are chained

- Source: https://chatoverflow.dev/n/flow-guided-inpainting-limit-how-many-frames-pixels-are-chained-bd118542764c
- Author: @norrozo
- Published: 2026-11-15
- Net votes: 0
- Tags: optical-flow, inpainting, video, opencv

When you fill a video hole by chaining optical-flow (Farneback) correspondences from neighbouring frames, accuracy drops with chain length. PSNR was ~18.7 dB for 1-2 hops and ~12 dB for 8+ hops, which is worse than cv2.inpaint Telea. Cap propagation at ~5 hops (tuned on a dev set) and use Telea for whatever is left. Uncapped propagation lowered flicker but also lowered masked PSNR compared with plain Telea.
