Blobs: build the blob hierarchy as a pgraph graph instead of hand-rolled parent/children + exporters
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
Start with src/machinevisiontoolbox/ImageBlobs.py and the existing test_graph_* tests in tests/test_image_blobs.py; compare the current graph output with the pgraph 1.0 exporters and check compatibility with pgraph 0.6.x. Decide how Blob.parent and Blob.children and filtering behave, then preserve the public signatures and output formats while replacing the hand-written exporters.
由索引模型根据 Issue 内容生成。
描述
Current state
Blobs (src/machinevisiontoolbox/ImageBlobs.py) represents the blob hierarchy with ad-hoc parent / children references on each Blob, built from OpenCV's findContours hierarchy array. Blobs.graph() (and dotfile()) then re-implements graph export by hand: DOT, Mermaid, fenced Mermaid, GraphML and ELK JSON, roughly 150 lines of string building.
pgraph is already a core dependency (it is only used by BundleAdjust today), and pgraph 1.0 ships exporters for exactly these formats (pgraph.exporters.dot/mermaid/graphml/elk, Graph.export(), Graph.dotfile()), plus rendering to images via GraphViz.
Proposal
- Build the blob tree as a
pgraph.DGraph(parent -> child edges), withBlobinstances as vertices (or vertices holding them). - Replace the hand-written exporters in
Blobs.graph()/dotfile()with the pgraph ones, keeping the public signatures and output formats. - Decide whether
Blob.parent/Blob.childrenstay as thin views over the graph or remain stored references (public API, so don't break it). - Gain for free: tree traversal, components, plotting and rendered images, and one place to fix export bugs.
Things to check
- Output compatibility with the existing
test_graph_*tests intests/test_image_blobs.py(node labels, ordering, attributes in GraphML/ELK). - Must work with both pgraph 0.6.x (no
Vertex,edges()is aset, no exporters module) and 1.0, or the minimum pgraph version has to be raised inpyproject.toml. The exporters exist only in 1.0. - Filtering a
Blobsset can leave dangling parent/child references (see the warning in the__getitem__/filter docs); a graph representation should either handle or make explicit this.
Related: pgraph test coverage review (BundleAdjust is currently the only pgraph user).
- 主要语言
- Python
- 星标
- 224
- 派生
- 31
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
petercorke/machinevision-toolbox-python 的其他 Issue
-
tech-debt
难度 2/5 1-3 小时 新手友好度 30/100
petercorke/machinevision-toolbox-python#147 ·
维护者通常 1 天内回复
-
Revert JupyterLite deps=False workaround once spatialmath #250 is released (review by 2026-10-28)未关闭tech-debt
难度 2/5 半天 新手友好度 20/100
petercorke/machinevision-toolbox-python#137 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 25/100
petercorke/machinevision-toolbox-python#125 ·
维护者通常 1 天内回复
-
tech-debt
难度 5/5 一周以上 新手友好度 25/100
petercorke/machinevision-toolbox-python#122 ·
维护者通常 1 天内回复
-
tech-debt
难度 5/5 一周以上 新手友好度 25/100
petercorke/machinevision-toolbox-python#119 ·
维护者通常 1 天内回复
查看 petercorke/machinevision-toolbox-python 的全部 Issue
相似的 Issue
-
Questions crashes on a real SQuAD2 no-answer prediction可能已有人在做 @HuaTNA 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)可能已有人在做 @yang00333 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
DOI-USGS/dataretrieval-python#454 ·
维护者通常 4 天内回复
-
area:core-platform effort:S priority:P3 status:in-review type:test
难度 2/5 1 小时以内 新手友好度 80/100
randomparity/kdive#3246 · 1 条评论 ·
维护者通常 1 天内回复
-
Requantification library converts m/z to mass with the hydrogen-atom mass instead of the proton mass未关闭bug
难度 1/5 1 小时以内 新手友好度 85/100
nf-core/metaboigniter#130 ·
维护者通常 1 天内回复
-
netbox status: needs owner type: documentation
难度 1/5 1 小时以内 新手友好度 75/100
netbox-community/netbox#23412 · 1 个 reaction ·
维护者通常 1 天内回复