pub fn figure_ground_ratio(img: &CaptureImage, eps: u8) -> f32Expand description
Which of the frame’s large tone populations is the figure: coverage
against NO_GROUND over coverage against modal_ground.
modal_ground finds the frame’s majority tone, and that is the right
reference exactly while the majority tone is the ground. A mass stacked past
the additive ceiling until it clips to one tone is its own modal band, so
every statistic conditioned on that reference is then handed the mass’s
leftovers — its fringe — rather than the mass. No ground estimator can see
that, because the majority tone is the majority tone either way; the question
is about the band’s role, and this is the reading of it.
A scene drawing light onto darkness has the same reference under both lenses,
so the two coverages coincide and the ratio sits at 1.0. A frame whose modal
band is its figure departs from that band almost nowhere and from black almost
everywhere, so the denominator collapses while the numerator stays near 1.0
and the ratio climbs without bound.
Both terms are coverages of one frame under two references, so this is a ratio
of one kind of quantity rather than a comparison of two (ADR-0074). Unlike
boundary_density it is an areal share on both sides and carries no
resolution binding: the two frozen blot anchors read 27.58 / 1.2718 at 96×96
and 27.70 / 1.2734 at 192×192.
f32::INFINITY when the frame does not depart from its own modal band at
all — the maximal reading of the modal band is the figure, which keeps the
function monotone in the direction it classifies.