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

• GPU: none (CPU reference implementation only)

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 terms are D_p(0) = (I_p − μ_bg)², D_p(1) = (I_p − μ_fg)² (if μ is omitted, it is the mean of two groups of isodata). The weight of the side is w_pq = exp(−(I_p − I_q)²/(2σ²)) / dist(p, q)(contrast_sigma = σ, omitting 1/dist = Potts). seeds is labels2d 1 = background species, 2 = object species. The constraint weight is 1 + max_p Σ_q λ w_pq + max_p |D_p(0)-D_p(1)| And it also exceeds the data term difference of free pixels (not counted as energy).

Returns: mask(object = True), energy = data + smooth, cut_value / flow_value(value converted to real number = integer value / scale + constant), cut_value_int / flow_value_int (maximum flow = minimum cut gate), quantization_bound (quantization of real numbers by integerization) Upper bound on the difference from the minimum, 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 · fisher_lda_score

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.