petercorke / petercorke/machinevision-toolbox-python

FiducialCollection.estimatePose: ids/cornerss zip misaligns after ID filtering

Aperta
#52 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 fixing the OpenCV 4/5 `ids` shape compat issue in the same method (see #44). `ImageFiducials.py`'s `FiducialCollection.estimatePose` does:

```python
cornerss = [
corners.T.squeeze()
for corners, id in zip(cornerss, ids)
if id in self._ids
]
ids = [id for corners, id in zip(cornerss, ids) if id in self._ids]
```

The second line's `zip(cornerss, ids)` pairs the already-filtered `cornerss` (reassigned on the line above) against the original, unfiltered `ids`. If any detected marker's ID isn't in `self._ids` (exactly the scenario the docstring calls out -- "filter the markers, useful if there are several ArUco boards in the scene"), the two lists have different lengths and `zip` silently pairs mismatched corners/ids from that point on. Only harmless when every detected marker happens to belong to this board (no actual filtering occurs), which is presumably why it hasn't been caught yet.

Fix

Compute the filtered `cornerss`/`ids` together in a single pass (e.g. one list comprehension producing tuples, then unzip), so both lists are always built from the same original, unfiltered pairing. Needs a test with multiple boards/extraneous marker IDs in view to catch a regression -- there's currently no coverage for the multi-board filtering case at all.

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 ImageFiducials.py, in FiducialCollection.estimatePose, e analizza come vengono filtrati gli angoli e gli ID rilevati. Aggiungi una copertura di regressione per più board o per ID di marker estranei, quindi verifica che gli angoli e gli ID filtrati rimangano allineati e che la suite di test esistente passi.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.