petercorke / petercorke/machinevision-toolbox-python
FiducialCollection.estimatePose: ids/cornerss zip misaligns after ID filtering
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 219
- フォーク
- 30
- 平均マージ
- 12日 23時間
- マージ済み PR(30日)
- 5
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ImageFiducials.py の FiducialCollection.estimatePose から始め、検出されたコーナーと ID がどのようにフィルタリングされるかを確認します。複数のボードまたは余分なマーカー ID に対する回帰テストを追加し、フィルタリング後のコーナーと ID の対応関係が維持され、既存のテストスイートが通過することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- opencv, python
- 領域
- computer-vision
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 76/100