snake_evolve — SEGMENTATION contour op

• Data kinds: image2d × pairs → table

• Call: import fullseye as fs; fs.ledger.snake_evolve(image, init_points, *, alpha: 'float' = 0.1, beta: 'float' = 0.1, gamma: 'float' = 1.0, external: 'str' = 'edge', w_line: 'float' = 0.0, w_edge: 'float' = 1.0, sigma: 'float' = 1.0, kappa: 'float' = 1.0, gvf=None, gvf_mu: 'float' = 0.2, max_px_move: 'Optional[float]' = None, n_iter: 'int' = 300, spline_order: 'int' = 3, tol: 'float' = 0.0, resample_every: 'int' = 0, record_every: 'int' = 0) -> 'Dict[str, object]' (to call the implementation directly, import segcontour; segcontour.snake_evolve(image, init_points, *, alpha: 'float' = 0.1, beta: 'float' = 0.1, gamma: 'float' = 1.0, external: 'str' = 'edge', w_line: 'float' = 0.0, w_edge: 'float' = 1.0, sigma: 'float' = 1.0, kappa: 'float' = 1.0, gvf=None, gvf_mu: 'float' = 0.2, max_px_move: 'Optional[float]' = None, n_iter: 'int' = 300, spline_order: 'int' = 3, tol: 'float' = 0.0, resample_every: 'int' = 0, record_every: 'int' = 0) -> 'Dict[str, object]'; from the registry, opssegmentation.get("snake_evolve"))

Usage

Semi-implicit update of the discrete snake (Kass–Witkin–Terzopoulos 1988): x_t = (A + γI)^(-1)(γ x_(t-1) − f_x) (eqs. (19)(20)) (snake_evolve).

Points init_points (N, 2) = [row, col] of a closed snake (periodic boundary), N ≥ 5. Internal energy E_int = ½ Σ (α |v_(i+1) − v_i|² + β |v_(i+1) − 2v_i + v_(i−1)|²) = ½ xᵀ A x (implicit). The external force (explicit) is chosen by external:

"edge" = potential P = w_line · G_σ*I + w_edge · |∇(G_σ*I)|², E_ext = −κ Σ P(v_i) (Kass's E_line and E_edge), "potential" = use image directly as P (to pass the same P as the 2nd (independent) implementation), "gvf" = the force itself is −κ (v, u) (GVF; pass the return of gvf_field to gvf, or build it internally with gvf_mu), "none" = external force 0. P is brought to the point positions by an interpolating spline of order spline_order (values and derivatives consistent). Giving max_px_move limits the move per 1 iteration to max_px_move · tanh(Δ) (same as skimage; the proximal-gradient property is lost). If resample_every > 0, the points are re-spaced evenly by arc length every k iterations (prevents points thinning out when entering concavities; energy monotonicity is broken at that moment). Points are clamped to the image range [0, H−1] × [0, W−1].

Returns: points (N, 2), mask (inside the polyline), energy / energy_internal / energy_external (per iteration, first = initial; with GVF the external energy is undefined, so total and external are NaN), n_increase (number of iterations in which the energy increased, None for GVF), max_increase, lipschitz (maximum over the grid of the spectral norm of the Hessian matrix of κP = an estimate of the Lipschitz constant of the external-force gradient), gamma_ge_lipschitz (if γ ≥ L, the descent lemma guarantees monotone non-increase), radius_factor (closed form of the shrink γ/(γ + λ_1) of a circle in 1 iteration with external force 0), history (points every record_every), n_iter, converged.

Detailed usage guide

• halcon_segmentation family guide

Background guides (the physics and conventions behind this op)

• active_contours_and_level_sets — Variational and active contours, level sets — which contour stops where, and what it guarantees

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_active_contours — py -3.11 examples/poc_active_contours.py

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

class_ndim_norm

Same category (contour)

gvf_field · chan_vese_energy · chan_vese_evolve · morph_chan_vese · morph_geodesic_ac · edge_stop_g · level_set_reinit · drle_evolve


*Provenance: segcontour.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.