Segmentation interface curvature balance (source code)

= Segmentation interface curvature balance
{title2=$\beta\kappa=(c_j-g)^2-(c_i-g)^2$}

When grey values are fixed but region labels vary, a smooth interface satisfies $\beta\kappa=(c_j-g)^2-(c_i-g)^2$. The <curvature> uses the normal pointing out of region $i$, positive on an outward-oriented circle. It balances the change in data cost against the first variation of interface length. Fixing a full spatial <image signal> instead fixes its jumps and leaves no such boundary-relocation freedom.