Phase 4: ORB / homography overlap range (v0.4.0)

Abierto
#4 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
opencv, python

Línea de trabajo

Read blocked issue #3 first, then start with the new overlap.py and the pure selector in select.py. Trace the existing CLI parsing and output paths for selection.csv and manifest.json. Done means the listed ORB, homography, fallback, selector, bounded-search, precedence, and acceptance checks pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

ready-for-agent

What to build

This is the core product feature. Add overlap.py with pairwise overlap metrics between two analysis-resolution grayscale frames, each returning a float in [0,1] or None on failure:

  • orb (default): ORB features (orb_nfeatures), None if either frame has <20 keypoints, BFMatcher + Lowe ratio (match_ratio), overlap = good_matches / min(nA, nB).
  • homography: same matches, then RANSAC homography with a fixed direction — H maps the later/candidate frame B's keypoints into the earlier/last-kept frame A's coordinate space (findHomography(pts_B, pts_A, ...)), consistently built from the matcher's query/train assignment (comment which is which). Warp B's corners through H into A's space and compute IoU against A's rectangle as the overlap. Fall back to the ORB match ratio (with a metric-fallback flag) if homography fails — never silently return the wrong-direction value.
  • flow: crude proxy exp(-flow_accum / (0.35 * analysis_width)), fallback-only, never default.
  • none: skip geometric overlap.

Cache ORB descriptors per candidate index for one selection pass.

Add the greedy selector in select.py: pure function taking FrameScore list, config, and an injected overlap_fn(i, j) -> Optional[float] (no OpenCV captures, for testability). Seed = first frame at/above sharpness threshold (not forced to index 0; warn and use global sharpest if none pass). From the last-kept frame, build a candidate pool (frame_index - last <= search_expand_frames OR flow_accum(last→frame) <= 3 * flow_trigger), stop pool growth early after 8 consecutive measured frames below overlap_min - 0.15. Prefer the sharpest in-range candidate; else pick the candidate closest to target_overlap (tie-break: higher sharpness); if no candidate has a measurable overlap, fall back to sharpest in pool with reason fallback-match-failed.

Wire --overlap 70-80 / --overlap-min / --overlap-max / --target-overlap / --overlap-metric parsing (min/max override --overlap with a warning if both given) and make --mode overlap-greedy --overlap-metric orb the new default mode.

Acceptance criteria

  • Identical image pair scores overlap ≈ 1 (>0.8) under orb
  • Image vs itself shifted ~10% width scores high overlap (>0.6) under orb
  • Image vs random noise returns low overlap or None
  • Homography direction convention verified with an asymmetric shift (not just symmetric) — IoU reflects B being the frame that moved
  • Selector unit test with a fake overlap_fn and sharpness peaks at indices 0,7,8,15: with range 0.70–0.80 the selector picks the peak sitting in-range over a sharper 95%-overlap peak and a sharper 40%-overlap peak
  • --overlap 70-80 --mode overlap-greedy --preview fills overlap_with_prev for every selection except the seed, in selection.csv and manifest.json
  • --overlap vs explicit --overlap-min/--overlap-max precedence and warning behavior verified
  • Search pool early-stop and search_expand_frames/flow-accum bounding verified (bounded runtime on a long synthetic video)

Blocked by

  • #3
Lenguaje dominante
Python
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bmaltais/gs-frames

Todos los issues de bmaltais/gs-frames

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.