GeezerVison is showing github.com — oneEuro filter: filtered poses are not rigid (the 16 values are smoothed independently) · Issue #766 · webarkit/jsartoolkitNFT
oneEuro filter: filtered poses are not rigid (the 16 values are smoothed independently) #766DescriptionWhat happens
The tracker's oneEuro filter (src/tracker/filters/oneEuro.ts) gives all 16 pose values to one OneEuroFilter and smooths each value on its own. An average of rotation matrices is not a rotation, so a filtered pose's upper 3×3 drifts from orthonormal: its columns are no longer unit length or orthogonal, and its determinant moves away from 1. The renderer applies the result as a model matrix, so the content picks up a small scale and shear that follow the camera's motion.
The 'none' and 'native' filters keep the pose rigid.
Measured
Traces recorded with webarkit-studio's trace tools (webarkit/webarkit-studio#9), with @webarkit/jsartoolkit-nft 1.15.0. oneEuro.ts on master is the same file.
| Filter |
Source |
Column norms of R |
det(R) |
| none / native |
Node build, static photo, 32 frames |
1.0000 |
1.0000 |
| oneEuro (0.0001, 0.01, warm-up 5) |
Node build, static photo |
down to 0.9995 |
|
| oneEuro (same) |
browser, hand-held camera, 1452 frames, marker at 95–259 mm |
0.9893 to 1.0007 |
0.984 to 1.000 |
The more the camera moves, the further the pose drifts: about 1% scale on a hand-held camera.
It also skews measurements built on the pose. Our trace diff read the hand-held trace as 5.6°/frame of rotation jitter, because acos((tr(AᵀB) − 1) / 2) assumes a rotation (a pose compared with itself gave 5.6°). After orthonormalizing, the real jitter is 0.06°/frame.
Expected
The filtered pose's R is a rotation: orthonormal, with determinant +1.
Possible fixes
- Smallest change: re-orthonormalize R after filtering (Gram-Schmidt on the columns, or the polar decomposition), and keep filtering the translation as now. This changes the filtered output slightly, so existing users would see poses differ.
- Proper fix: filter the translation as a vector and the rotation in its tangent space, so the step is
log(R̂ₖ₋₁ᵀ Rₖ), as M4 step 4: One Euro filtering of the pose, with the rotation filtered in its tangent space webarkit#106 did for the nft-tracker. With the current package API this needs the lower-level step filter that Requirements for use as webarkit nft-tracker's One Euro core OneEuroFilter-ts#9 (item 5) asks for, or the module's own implementation.
Either way, a test could assert that every filtered pose has orthonormal columns and det ≈ 1 within a tolerance, on a moving sequence and not only a static one.
Related
Generated by Claude Code Activitykalwalt commented on Nov 2, 2026 Plan
Going with the proper fix (option 2), now that @webarkit/oneeurofilter-ts 0.3.0 has filterStep() (#773 bumped it on dev):
- Rotation: filtered on its tangent space. The step is
ω = log(R̂ᵀR), smoothed with filterStep(), then R̂ ← R̂ · exp(ω̂), with one polar iteration per step so rounding cannot drift R̂ over long runs.
- Translation: filtered as a vector with
filter().
- Parameters unchanged: one
minCutOff / beta pair, the D19 defaults, and warmUp. For small rotations the change of R's entries is about the angle in radians, the same scale as the tangent step, so existing configurations should behave close to today, without the scale and shear.
- Not kept: the old per-value filter. Filtered output will differ from 1.15.0, which the README, a D19 amendment and the PR will say.
Tests:
- every filtered pose has orthonormal columns and det(R) within 1e-9 of 1, on a moving sequence of 5,000 frames, and on the Node build's static photo where 0.9995 was measured;
- the translation matches the package's
filter();
- a rotation about a coordinate axis is filtered exactly as its angle.
Design and plan: specs/2026-11-02-oneeuro-tangent-space-{design,plan}.md, committed with the PR (fix: keep oneEuro-filtered poses rigid (#766)).
Generated by Claude Code
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|