Feature Request: General λ-connected (lambda-connected) segmentation (beyond flood_fill())
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- computer-vision
Direzione di ricerca
Iniziare esaminando le interfacce esistenti di cv2.floodFill() e skimage flood/flood_fill(), quindi determinare se questa funzionalità di segmentazione debba appartenere al repository di packaging di opencv-python o a OpenCV upstream. Il lavoro sarà completato quando saranno concordati un’API lambda-connected e l’ambito dell’implementazione, e sarà stato verificato che restituisca la maschera booleana proposta senza sostituire il comportamento esistente di flood-fill.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Title: Feature Request: General λ-connected (lambda-connected) segmentation
Summary
Both cv2.floodFill() and skimage.segmentation.flood()/flood_fill() implement region-growing using a purely local, pairwise similarity rule — a pixel is added if it differs from an already-included neighbor by less than a fixed tolerance. This is fast and simple, but it inherits a well-known weakness: gradient leakage. A smooth intensity gradient can chain together pixels that are locally similar at every step but globally very different, causing the region to "leak" past intended boundaries.
Proposed addition
Implement λ-connected segmentation, a formal generalization of region-growing based on fuzzy connectedness theory. Instead of a local pairwise test, connectivity between two pixels is defined by the strongest path between them — specifically, the maximum over all paths of the minimum pairwise similarity along that path (a max-min / bottleneck-path formulation). Two pixels are λ-connected if this path strength is ≥ λ.
Why this is a natural fit
• It's a strict generalization: setting λ's degree function to a simple local threshold and ignoring the path constraint collapses back to today's flood_fill() behavior — so it wouldn't replace existing functionality, only extend it.
• It directly addresses flood-fill's most common failure mode (leakage through gradients) without requiring users to switch to a heavier method like GrabCut or a full DL segmentation model.
• Efficient implementation is well understood: this is equivalent to a maximum-capacity/bottleneck shortest-path problem, solvable with a Dijkstra-like or Kruskal-like (max-spanning-forest) approach in effectively linear-ish time for practical image sizes — no need for iterative PDE solvers.
• It would sit naturally alongside existing skimage.segmentation tools (flood, watershed, random_walker, chan_vese) as another region-growing option, giving users a controlled way to compare "naive" vs. "leak-resistant" region growing on the same image.
• Related lambda-connectedness methods already have precedent in imaging toolkits (e.g., Leadtools lambda-connectedness segmentation), so this isn't an unprecedented ask — it would bring scikit-image/OpenCV's region-growing toolbox to parity with a well-established technique in medical/scientific imaging.
python
cv2.segmentation.lambda_connected(image, seed, lam, connectivity=1, degree_func='intensity_diff')
Returns a boolean mask, mirroring flood()'s existing interface for easy comparison in the same script.
References
• L. Chen, Cheng, H.D. and Zhang, J., 1994. Fuzzy subfiber and its application to seismic lithology classification. Information Sciences-Applications, 1(2), pp.77-95.
• L. Chen, "The lambda-connected segmentation and the optimal algorithm for split-and-merge segmentation," Chinese J. Computers, Vol. 14, pp. 321–331, 1991.
- Lingua principale
- Python
- Stelle
- 5.4k
- Fork
- 1k
- Merge medio
- 22h 17m
- PR unite (30g)
- 3
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opencv/opencv-python
-
[DOC] README file Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
opencv/opencv-python#1217 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
opencv/opencv-python#1165 · 2 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
opencv/opencv-python#1272 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
opencv/opencv-python#1268 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
opencv/opencv-python#1267 ·
Tutte le issue di opencv/opencv-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
zostera/django-bootstrap4#894 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
use-agent-os/agent-os#3276 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NousResearch/hermes-agent#117848 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zilliztech/memsearch#759 ·