Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
opencv, python

调研方向

从 ImageFiducials.py 中的 FiducialCollection.estimatePose 开始,检查检测到的角点和 ID 是如何被过滤的。为多个板或多余的标记 ID 添加回归测试覆盖,然后验证过滤后的角点和 ID 仍保持对应关系,并且现有测试套件通过。

由索引模型根据 Issue 内容生成。

描述

tech-debt

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.

主要语言
Python
星标
220
派生
30
平均合并
12 天 23 小时
30 天内合并 PR
5

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

petercorke/machinevision-toolbox-python 的其他 Issue

查看 petercorke/machinevision-toolbox-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。