crt_displacement — RESIDUE image op

• 데이터 종류: image2d × image2d → table

• 호출: import fullseye as fs; fs.ledger.crt_displacement(image0, image1, periods=(5.0, 7.0, 9.0, 11.0, 13.0, 16.0), sigma_px=40.0, max_disp=40.0, axis='x', refine=2) -> 'dict'(구현을 직접 호출하려면 import residue; residue.crt_displacement(image0, image1, periods=(5.0, 7.0, 9.0, 11.0, 13.0, 16.0), sigma_px=40.0, max_disp=40.0, axis='x', refine=2) -> 'dict', 원장에서 가져오려면 opsresidue.get("crt_displacement"))

사용법

여러 파장 대역의 위상으로부터 국소 변위를 구하고, 중국인의 나머지 정리로 위상 접힘을 푼다 -> dict.

> 아래 상세 설명은 원문입니다 —— 요약과 제목은 번역되어 있습니다.

A band of wavelength p measures the local shift only modulo p, so any single-band phase method breaks at |d| = p/2 (motionmag.phase_displacement reports this as wrap_limit_px). Bands at *coprime* wavelengths each break there too, but together they fix d over the least common multiple — 693 px for 7/9/11 — so the limit becomes max_disp, the search half-width.

image1 is image0 with its content moved by d(y, x) along axis ("x" = columns, "y" = rows; positive towards increasing index) — image1 = np.roll(image0, +d) gives +d. Note that filters_freq.phase_correlation_fft(image0, image1) uses the *opposite* sign (it returns -d); flip one when swapping methods. For each wavelength a Gaussian band-pass (analytic, one-sided, spatial std sigma_px) gives a local phase and a *local* wavelength (measured, not nominal — see _band_measure); their phase differences are residues of d; amplitude products are the weights; every pixel is solved by the phasor-agreement search

of residue_crt. refine iterations then warp image1 back by the current estimate and add the (now small, wrap-free) weighted residual.

Returns {"d", "weight", "margin", "residual", "valid", "wrap_limit_single_px"}. valid = enough contrast in the bands *and* a margin above 0.05; a pixel that fails is still returned but should not be trusted.

Where it applies: textured regions that each move (nearly) rigidly by a large amount — measured on two regions of the public scikit-image textures moving +20 / -15 px, pixels farther than 1.5 sigma_px from the region boundary are off by more than 1 px on 2 % (grass) / 5 % (gravel) / 6 % (brick), where the best pyramid Lucas-Kanade (3-6 levels) is off on 49 / 50 / 67 %.

Where it does not: within ~1.5 sigma_px of a motion boundary; where the displacement changes inside the window (a 6 px field with gradient 0.07 is already off on half the pixels — a band narrow enough to keep the local frequency stable needs a window too wide to follow the field); flat regions (weight and valid say where); occlusions. A single global translation is better served by phase correlation. Numbers: examples/poc_residue_crt.py.

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

• poc_residue_crt — py -3.11 examples/poc_residue_crt.py

타입이 이어지는 다음 연산자(table 를 입력으로 받는 것)

—

같은 카테고리(image)

harmonic_rotation


*Provenance: residue.py — RESIDUE 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.