Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Blobs: build the blob hierarchy as a pgraph graph instead of hand-rolled parent/children + exporters

Đang mở
#128 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
computer-vision

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

tech-debt

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), with Blob instances 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.children stay 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 in tests/test_image_blobs.py (node labels, ordering, attributes in GraphML/ELK).
  • Must work with both pgraph 0.6.x (no Vertex, edges() is a set, no exporters module) and 1.0, or the minimum pgraph version has to be raised in pyproject.toml. The exporters exist only in 1.0.
  • Filtering a Blobs set 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).

Ngôn ngữ chính
Python
Star
224
Fork
31
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
19

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của petercorke/machinevision-toolbox-python

Tất cả issue của petercorke/machinevision-toolbox-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.