Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#128 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
computer-vision

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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).

Vorherrschende Sprache
Python
Sterne
224
Forks
31
Ø Merge
1 T. 6 Std.
Gemergte PRs (30 T.)
19

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus petercorke/machinevision-toolbox-python

Alle Issues in petercorke/machinevision-toolbox-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.