petercorke / petercorke/machinevision-toolbox-python

test_image_reshape.py: warp/undistort/interp2d tests are empty stubs

Aperta
#53 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

tech-debt
Lingua principale
Python
Stelle
220
Fork
30
Merge medio
12g 23h
PR unite (30g)
5

Descrizione

Found 2026-08-03 while auditing warpAffine/warpPerspective/remap-based methods for OpenCV 4/5 numeric-drift issues (see #44). `tests/test_image_reshape.py`'s `test_warp`, `test_warp_affine`, `test_warp_perspective`, `test_undistort`, and `test_interp2d` are all empty stubs (`# Add test cases for the decimate method` / `pass`) -- zero real assertions, for five distinct methods in `ImageReshape.py` that wrap `cv2.warpAffine`/`cv2.warpPerspective`/`cv2.remap`/`cv2.undistort`.

`test_rotate` (same file) does have real coverage and was specifically checked against a real OpenCV 5.0.0.93 install as part of #44 -- its one exact-equality assertion (`rotate(0)`, an identity transform) is confirmed safe on both versions, no drift. But the five methods above have no coverage at all to check.

Fix

Write real tests for each: a known input + expected transform (e.g. `warp_affine` with a translation matrix, `undistort` with known distortion coefficients on a synthetic pattern), asserting geometric correctness with a tolerance rather than exact pixel equality -- OpenCV's own migration notes describe revised interpolation between versions 4 and 5, so any assertion here should tolerate small numeric drift by construction, not just by accident.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia in tests/test_image_reshape.py e confronta gli stub vuoti test_warp, test_warp_affine, test_warp_perspective, test_undistort e test_interp2d con i metodi corrispondenti in ImageReshape.py. Usa gli input e le trasformazioni sintetici suggeriti nell’issue, quindi aggiungi asserzioni basate su tolleranze per la correttezza geometrica. Il lavoro è completato quando ogni metodo ha una copertura reale senza dipendere dall’uguaglianza esatta dei pixel tra le versioni di OpenCV.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
computer-vision, testing
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
72/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.