Reading Text Once, Moving It for Free: Codec Motion as Per-Word Geometry

Most videos already contain a rough record of how things move. Compressed formats such as H.264 store most frames not as images but as instructions: "copy this 16×16 block from the previous frame, shifted by this much, then add this small correction." Those shifts are called motion vectors, and the corrections are called residuals. Both can be read from the file almost for free. Earlier work has used them to speed up video object detection and segmentation. Nobody has used them for video text spotting, the task of finding, tracking, and reading every word that appears in a video. Text is a hard case. The vectors are computed over blocks that are wider than a character stroke, and the encoder picks them to save bits, not to report true motion. Warping fine character features with them would smear the text.

We propose to use codec motion only for geometry and never for appearance. A word on a sign or storefront is almost always a flat object. Its motion between frames is therefore well described by a single planar transformation, a homography: a 3×3 matrix that maps one view of a plane to another. We fit one robust homography per word from all the motion vectors that fall inside it, so that the noise of individual blocks averages out. We move the word's outline forward using that fit. The residual energy inside the moved outline then gives a free signal of whether the move is still trustworthy, and when the signal fires, the system runs the full text spotter on that frame. Recognition happens on the clearest crop of each word, which is held in a small, fixed memory for each word track. The claim is that this matches per-frame spotters on tracking accuracy while running the full spotter on a small fraction of frames. It also predicts in advance where the approach fails: very small words and fast pans.

Core Claim

Codec motion vectors are too coarse to carry the appearance of text, but accurate enough to carry the planar geometry of a word once outlier vectors are rejected. Residuals inside the propagated outline reliably signal when that geometry has drifted. Together these let an expensive end-to-end spotter run only at chosen frames without losing track identity.

The quantitative expectation is easy to state. Suppose each block's vector has an independent error of spread $\sigma$, and a word covers $n$ blocks. A fit with a few parameters then has corner error that shrinks roughly as $\sigma/\sqrt{n}$; this is ordinary least-squares averaging. A long word spanning ten blocks should therefore be propagated far more accurately than any single block's vector would suggest. A word covering one or two blocks gains almost nothing. The method should rely on the trigger, rather than on propagation, for small text, and the experiments test exactly this split.

Relation to Prior Work

Three compressed-domain systems motivate and supply parts of the method. Fast Object Detection in Compressed Video (MMNet) runs a deep detector on I-frames, the fully stored anchor frames. It warps the detector's feature maps forward along motion vectors and corrects them with a residual-fed LSTM, reaching 73.0% mAP on ImageNet VID at 40–55 FPS. Accelerating Video Object Segmentation with Compressed Video (CoVOS) runs heavy segmenters on keyframes and propagates masks with soft vector warping and residual-triggered correction. Compressed Video Prompt Tuning uses residuals as an attention mask that filters blocky vectors for action classification.

All three propagate dense appearance, either features or masks, and all three report or imply trouble with small objects. That is precisely the regime of characters. We borrow their residual-as-reliability idea, but apply it to a decision (re-detect or not) rather than to dense feature correction. CodingHomo supplies our geometric step. It fits homographies from codec vectors and rejects vectors that disagree with the dominant plane or carry large residuals, cutting error by 17.14% in low-texture scenes. It works on whole frames and is limited by the encoder's search range of roughly ±16 pixels. We apply the same outlier rejection per word instance, and we treat the search-range limit as a predictable failure that the trigger must catch.

On the text side, YORO shows that reading each track once, from its best-quality crop, cuts recognition cost by 71×. Its detector, however, still warps features with explicit optical flow, so the cost of motion estimation remains. We keep the "recognize once" principle and replace optical flow with codec geometry. TransDETR and GloTSFormer are the strongest end-to-end video spotters in the file. Both process every RGB frame. GloTSFormer also shows that matching outlines by overlap fails under fast motion, and fixes this by matching words as 2D Gaussians compared with the Wasserstein distance. We use these spotters as the keyframe engine and reuse GloTSFormer's Gaussian matching when a triggered re-detection must be linked back to propagated tracks. The ICDAR 2021 Scene Video Text Spotting competition motivates the work: detection F-score 0.8502 collapsed to 0.5308 end-to-end, mostly because of blur and broken tracks.

The fourth direction, conditioning each frame on earlier ones as long-video generators do, shapes the memory design. LongLive keeps the first frame's tokens as a permanent anchor, an "attention sink," alongside a short local window. It recomputes the cache when the prompt changes. Deep Forcing shows that a plain first-in-first-out window loses context and drifts, and it evicts tokens that receive little attention. Geometry propagated frame after frame is itself an autoregressive rollout, and its errors compound the way generated frames do. Our analogue of the sink is a per-track anchor holding the most legible crop seen so far. Our analogue of recaching is the residual-triggered re-detection that resets accumulated geometric drift. These are generative systems, so we borrow only the design pattern and claim no transfer of results.

Research Program

The system wraps a frozen, pretrained end-to-end spotter, TransDETR in the main experiments and GloTSFormer as a second host. At any frame where the full spotter has run, each detected word yields an oriented outline and a recognition embedding. At each later frame, the system reads motion vectors and residuals straight from the bitstream. For each track it collects the vectors whose blocks overlap the current outline and fits a homography by iteratively reweighted least squares. Blocks are down-weighted when they have high residual or zero-vector "skip" status, or when they disagree with the plane. This is CodingHomo's rejection logic restricted to one word. The outline is then moved by the fitted homography.

A small trigger model decides whether to invoke the full spotter on the current frame. Its inputs per track are:

  • residual energy inside the moved outline, normalized by area;
  • the fit's inlier ratio;
  • the number of blocks covered;
  • frames elapsed since the last anchor;
  • whether any vector sits at the edge of the encoder's search range;
  • residual energy outside all tracks, which flags newly appearing text.

The trigger is a gradient-boosted classifier or a two-layer MLP. It is trained to predict whether propagated corners have drifted beyond a set threshold relative to what the full spotter would output. It is calibrated so that a single knob trades compute for accuracy.

When the spotter runs, its detections are matched to propagated tracks with Gaussian Wasserstein matching. The matched outline is re-anchored and the track's recognition anchor is updated if the new crop scores higher. Legibility is scored with the spotter's recognition confidence, a simplification of YORO's teacher-student quality scorer. The final transcript per track is decoded from that anchor, plus a short window of recent crops when the anchor is stale.

The analysis program has two parts. First, we measure propagation error against per-frame spotter outlines and against ground-truth polygons. The error is broken down by:

  • word size in blocks;
  • frames since anchor;
  • encoder quantization parameter (QP);
  • whether the frame is a P-frame or a B-frame;
  • camera speed.

This tests the $\sigma/\sqrt{n}$ prediction and finds where geometric propagation breaks. Second, we measure trigger calibration: how often it fires, and how often it misses real drift.

All benchmark videos are re-encoded with a fixed open-source H.264 encoder at several QP settings and two group-of-pictures lengths. This removes codec lock-in from the comparison. Ground-truth annotations are unchanged because frame timing is preserved. A causal configuration using only P-frames is also reported, so that no method uses future frames, which CoVOS's bidirectional scheme requires.

Baselines

The naive reference point is keyframe-only spotting with held outlines. The host spotter runs on I-frames, and every outline stays fixed until the next one. It uses the same spotter weights and the same encoded videos, with no tuning. It sets the floor for what codec motion must add. Any useful method must clearly beat it on MOTA and IDF1 at an identical keyframe budget.

The accuracy ceiling is the host spotter run on every decoded frame. This is TransDETR as published, which reports 72.8% IDF1 and 47.7% MOTA on ICDAR2015 Video at roughly 10–16.7 FPS according to TransDETR. GloTSFormer, the strongest reported tracker in the file, reports 56.0 MOTA on ICDAR2015 Video at 20 FPS on a V100 (GloTSFormer). On LSVTD/SVTS, the strongest reported results are 0.5372 average tracking accuracy (ATA) and a 0.5308 end-to-end sequence F-score from the Tencent-OCR entry in the ICDAR 2021 competition. No reported result was found on Lacuna for YORO's numeric IC15 accuracy.

We rerun both hosts on our re-encoded videos rather than quoting published numbers, because compression changes the input. Wall-clock time includes RGB decoding, since CVPT reports that decoding alone can cost about 10× more than reading the compressed stream. Beating this baseline means coming within one MOTA point and one IDF1 point of the per-frame host while invoking the full spotter on at most a quarter of frames. It also means at least doubling end-to-end throughput on the same GPU.

The strongest motion-based competitor is an MMNet-style adaptation. Here the host spotter's backbone features are warped along raw block vectors, and a residual-fed recurrent module corrects them; the module is trained on the same data with the same epoch budget as our trigger. It represents the established compressed-domain recipe, and it is the direct test of our claim that appearance should not be propagated for text. We also run a YORO-style variant that uses learned optical flow for warping. This measures what explicit motion buys at its known cost.

Three ablations isolate the key ingredients. The first replaces the per-word homography with the mean vector translation inside the outline. The second removes residual and plane-based outlier rejection. The third replaces the residual trigger with a fixed-stride schedule that has the same average number of spotter calls. A fourth ablation replaces the per-track legibility anchor with a first-in-first-out crop window of equal memory, testing whether the sink-style anchor matters for transcription.

Why not just…?

Why not just shift each box by the average motion vector inside it? This is the most serious simple alternative, and on slow, mostly translating footage it may be nearly as good. Our bet is that it fails in three predictable places. It cannot represent rotation or perspective change, which matter for street and car-dashboard footage in LSVTD. It is corrupted by the zero-vector and false-match shortcuts that CodingHomo documents. And without a trigger it accumulates drift indefinitely. The translation ablation, stratified by camera motion and frames-since-anchor, settles this directly. If translation plus the trigger matches the full method, we will report that the homography is unnecessary and that the contribution is the trigger.

Why not just run the spotter every k frames and link detections with Gaussian Wasserstein matching, ignoring the bitstream? GloTSFormer shows that distribution matching survives zero-overlap motion, so this could compete. Its weakness is that between detections it has no position estimate at all. MOTA counts every frame, so any frame without an estimate becomes a miss, and a fixed stride wastes calls on static scenes while undersampling bursts of motion. The fixed-stride ablation at matched call budgets measures this. If the gap is small on IC15 but large on fast-motion LSVTD clips, the bitstream earns its place only in the motion-heavy regime, and we will say so.

Why not just warp features the way MMNet does? MMNet needed residuals to raise fast-object mAP from 27.7% to 43.1%, which shows how unreliable raw vectors are, and CoVOS reports degradation on small objects. Character strokes are far smaller than either system's targets. We expect feature warping to preserve detection reasonably well but hurt recognition. The decisive comparison is end-to-end word accuracy at matched spotter calls, reported separately from detection scores.

Why not just compute optical flow? YORO does, and accuracy may be slightly higher. However, MMNet reports that a flow network consumes the savings that temporal propagation was supposed to provide, and TVNet reaches only 12 FPS unbatched. We report the flow variant on the same accuracy-versus-throughput curve. The claim is a better trade-off, not higher peak accuracy.

Proposed Experiments

Experiments use ICDAR2015 Video and ICDAR2013 Video, scored with MOTA, IDF1, and end-to-end word accuracy, and LSVTD with the SVTS protocol, scored with detection F-score, ATA, and sequence-level spotting F-score. Each is re-encoded at three QP levels.

The main result is an accuracy-versus-throughput curve, traced by sweeping the trigger threshold, for both hosts and for every baseline above. Throughput is measured in total frames per second including decoding.

Four checks decide whether the core claim holds:

  1. Error versus word size. Propagation corner error should fall with word size in blocks roughly as $1/\sqrt{n}$. If it does not, the averaging argument is wrong and the per-word homography loses its justification.
  2. Search-range failures. The trigger should catch at least 90% of frames where vectors hit the encoder's search limit. If it does not, fast pans will silently break tracks.
  3. Robustness to compression. At the highest QP, where vectors become sparse, the method should degrade gracefully toward the fixed-stride baseline rather than below it.
  4. Recognition memory. Replacing the legibility anchor with a first-in-first-out window should measurably lower sequence-level spotting F-score on LSVTD clips with long occlusions. This would show that long-memory design from video generation transfers to a reading task.

If the method stays within a point of the per-frame host while calling it on a quarter of frames or fewer, codec motion will be shown to be a usable source of geometry for text. If only the trigger matters, the result is still useful, but narrower than claimed.