Brows: traced ring, quantised raise

A brow at 320x200 is fourteen pixels wide and three tall. Its shape carries
almost nothing at that size; its height above the eye carries the expression,
and a brow raise is the most legible beat on a face. So the ring is traced and
the height is quantised - the split the eyes already got, where the lid is a
traced feature and the iris a quantised primitive.

The decomposition is the point. The traced ring already contains the real
height, so adding a quantised raise on top would move the brow twice. The
height is measured OUT of the ring, quantised, and put back, so the shape that
renders is his at a height that snaps between a few levels and holds.

Measured at both ends rather than as one number, because raise and tilt are
different expressions out of one mechanism: both ends up is surprise, inner up
alone is worry, inner down is anger. They share a dwell - the gaze quantiser,
renamed quantizeSnap now that it has two callers - so the brow hits its pose in
one frame instead of crawling into it with one end arriving before the other.

Measured against the eye's corner midpoint, never its lid. Same trap the gaze
origin has and worth avoiding twice: brows and lids move together constantly,
so a brow that jumped on every blink would read as a tic. Rest pose from the
take median rather than the neutral frame, for the reason gaze learned the hard
way - that frame is picked by minimum mouth aperture and says nothing about the
brows.

Two correspondences resolved from geometry, not declared: which ring is which
brow, and which end is the outer one. The second matters more - backwards, the
tilt mirrors and worry renders as its own opposite, which reads as a directed
performance choice rather than a bug and would never be questioned. Which EDGE
is upper is deliberately left unresolved: it traverses the same ring the other
way, an even-odd fill has no winding, and both ends still land on fixed slots.

Also fixes a bug from the exposure work: the live render applied exposure to
the plate and the mouth but not to the eyes, so on 2s the preview and the
export disagreed. A preview that disagrees with the export is the one bug this
tool cannot afford. perfIndex now exists as a named thing so the two paths
cannot drift apart again.

91 -> 105 assertions. Ground truth on all four synthetic brow poses, tilt
separating worry from anger by sign, a blink not faking a raise, and a shared
dwell never emitting a half-raised brow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-09-24 18:11:25 -04:00
parent 2e4406d579
commit 03df81fa0b
8 changed files with 419 additions and 26 deletions

View file

@ -95,3 +95,34 @@ export const EYE_L_LIDS = [386, 374];
// the geometry instead.
export const IRIS_A = [468, 469, 470, 471, 472];
export const IRIS_B = [473, 474, 475, 476, 477];
// ---- brows ----
//
// Each brow is two five-point chains, an upper edge and a lower edge, which
// close into a ten-point ring: out along one edge from the outer end to the
// inner, back along the other.
//
// WHICH EDGE IS UPPER IS DELIBERATELY NOT DECLARED, and unlike the iris it does
// not need to be. Swapping them traverses the same ring the other way round,
// and an even-odd fill has no winding, so the shape is identical either way.
// What the ring guarantees instead is that the two ENDS land on fixed slots:
// 0 and 9 are one end, 4 and 5 the other. Averaging a pair therefore gives the
// brow's height at that end whichever edge is on top, which is all the raise
// and tilt measurement needs.
//
// Which end is the OUTER one is resolved from geometry in pipeline.js, because
// getting it backwards mirrors the tilt - inner-up "worried" would render as
// outer-up - and that is a expression error, not a glitch, so it would read as
// a directed performance choice rather than as a bug.
export const BROW_A_RING = [
70, 63, 105, 66, 107,
55, 65, 52, 53, 46,
];
export const BROW_B_RING = [
300, 293, 334, 296, 336,
285, 295, 282, 283, 276,
];
// The slots at each end of a brow ring, as pairs to average.
export const BROW_END_0 = [0, 9];
export const BROW_END_1 = [4, 5];