image opimage2d × image2d → tableimport fullseye as fs; fs.ledger.harmonic_rotation(image, reference, orders=(3, 4, 5), rings=((14, 24), (30, 40), (46, 56)), center=None, tol=0.05) -> 'dict' (実装を直接呼ぶなら import residue; residue.harmonic_rotation(image, reference, orders=(3, 4, 5), rings=((14, 24), (30, 40), (46, 56)), center=None, tol=0.05) -> 'dict'、台帳から引くなら opsresidue.get("harmonic_rotation"))Absolute in-plane rotation of image relative to reference over 360 degrees -> dict.
A feature with n-fold symmetry (n lobes, n holes, n slots) tells the
rotation only modulo 360/n degrees: its order-n circular harmonic has
phase n*theta. Features of several orders, each ambiguous alone, fix
theta uniquely whenever the orders have no common divisor (3 and 4: 360 /
gcd = 360). This op samples each annulus rings[i] (radii in px around
center, default the image centre), takes the order orders[i] angular
Fourier coefficient of image and reference, and solves the angle by
:func:residue_crt with the coefficient amplitudes as weights.
Returns {"angle_deg", "per_order_deg", "residual_deg", "margin", "suspect",
"amplitude"}. angle_deg is counter-clockwise on screen (rows down) — the
convention of scipy.ndimage.rotate — in [0, 360). suspect is the index of the ring whose residual is
worst relative to its period (or -1 if all are within tol) — a smudged,
occluded or broken feature shows up there before it corrupts the angle.
With >= 3 orders and only one corrupted, :func:residue_fault_locate gives a
hard decision; this op keeps the soft one.
Rotate greyscale images (interpolate, then threshold if needed): rotating a binary mask with nearest-neighbour sampling roughens the edges and biases the harmonics.
py -3.11 examples/poc_residue_crt.pytable を入力に取れる)—
image)Provenance: residue.py — RESIDUE operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.