graph_cut_binary — SEGMENTATION graph op

• Data kinds: image2d → table

• Call: import fullseye as fs; fs.ledger.graph_cut_binary(image, *, lam: 'float' = 1.0, mu_bg: 'Optional[float]' = None, mu_fg: 'Optional[float]' = None, contrast_sigma: 'Optional[float]' = None, seeds=None, connectivity: 'int' = 4) -> 'Dict[str, object]' (to call the implementation directly, import seggraph; seggraph.graph_cut_binary(image, *, lam: 'float' = 1.0, mu_bg: 'Optional[float]' = None, mu_fg: 'Optional[float]' = None, contrast_sigma: 'Optional[float]' = None, seeds=None, connectivity: 'int' = 4) -> 'Dict[str, object]'; from the registry, opssegmentation.get("graph_cut_binary"))

Usage

Binary graph cut (Boykov–Jolly 2001): minimises E = Σ_p D_p(x_p) + λ Σ w_pq [x_p ≠ x_q] exactly by max-flow / min-cut (graph_cut_binary).

The data term is D_p(0) = (I_p − μ_bg)², D_p(1) = (I_p − μ_fg)² (omitting μ uses the isodata means of the 2 groups). Edge weights are w_pq = exp(−(I_p − I_q)²/(2σ²)) / dist(p, q) (contrast_sigma = σ; omitted, 1/dist = Potts). seeds is a labels2d with 1 = background seed, 2 = object seed (hard-constrained with Boykov–Jolly's K = 1 + max_p Σ_q λ w_pq, not counted in the energy).

Returns: mask (object = True), energy = data + smooth, cut_value / flow_value (converted back to real values = integer value / scale + constant) and cut_value_int / flow_value_int (gate max flow = min cut), quantization_bound (upper bound on the gap to the real-valued minimum caused by integerisation; 0 for integer input).

Detailed usage guide

• halcon_segmentation family guide

Background guides (the physics and conventions behind this op)

• graph_hierarchy_and_thresholds — Segmentation from graph, hierarchy and threshold theorems — what is exact, and where the partition breaks down

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_graph_hierarchy_segmentation — py -3.11 examples/poc_graph_hierarchy_segmentation.py

Ops the type connects to (they accept table as input)

class_ndim_norm

Same category (graph)

alpha_expansion · statistical_region_merging · max_tree · area_opening_attr · quasi_flat_zones · alpha_tree · hierarchical_watershed · ultrametric_contour_map


*Provenance: seggraph.py — SEGMENTATION operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.