varmodel_fit — SPC variation op

• 데이터 종류: video → table

• 호출: import fullseye as fs; fs.ledger.varmodel_fit(stack, spread='moderated', far=0.001, align='check', max_misalign_px=0.5, spread_floor=0.0, mask=None)(구현을 직접 호출하려면 import varmodel; varmodel.varmodel_fit(stack, spread='moderated', far=0.001, align='check', max_misalign_px=0.5, spread_floor=0.0, mask=None), 원장에서 가져오려면 opsspc.get("varmodel_fit"))

사용법

양품 스택에서 픽셀별 변동 모델(중심·산포·대역 반폭 k)을 학습 (table).

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

stack is (n, H, W) or a list of equal 2-D images, all good. spread chooses the estimator (SPREADS): std (mean / per-pixel sample std, needs n >= 3), pooled (mean / one std for all valid pixels — few samples, homoscedastic noise), moderated (mean / empirical-Bayes shrinkage of every pixel's variance toward a prior estimated from all pixels, Smyth 2004 — few samples, heteroscedastic noise; the default) or mad (median / 1.4826 MAD — robust to a few defective images hidden in the "good" set, needs n >= 5). far is the declared two-sided per-pixel false-alarm rate; k follows from it (see varmodel_band_k) and is never tuned on defects.

Alignment: align="check" measures every sample's translation (varmodel_alignment) and REFUSES the stack if any exceeds max_misalign_px; align="translate" registers the samples to the median by a Fourier shift (all-pass, so white noise keeps its variance), re-checks the residual against max_misalign_px and marks the wrapped border invalid. A stack without structure (alignment["observable"] False) is neither refused nor shifted; its band is then only an intensity threshold on the overall variation. Stochastic textures, whose every sample shows a different pattern, are therefore not a variation-model problem (on DAGM 2007 Class1 it scores at chance — see the PoC).

spread_floor (>= 0, image units) lower-bounds the spread (8-bit data has pixels whose good samples are all equal); any remaining zero spread is refused. mask (H, W) bool limits the inspected area. Returns center, spread, k, far, n, df, spread_kind, lower / upper (the band), valid (bool), n_floored, d0 / s0 (the prior's degrees of freedom and scale: 0 for std / mad; for pooled and a fully pooled moderated prior d0 = valid pixels x (n - 1)), k_source, mc_far_rel_se and alignment (the offset report, after registration if any).

Raises ValueError on an empty / malformed / non-finite stack, too few samples, an unknown spread / align, far outside its range, a misaligned stack, a mask of the wrong shape, or zero spread left after the floor.

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

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

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

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

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

• poc_good_sample_variation_model — py -3.11 examples/poc_good_sample_variation_model.py

• poc_patch_anomaly — py -3.11 examples/poc_patch_anomaly.py

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

msa_anova_table · msa_gauge_rr · msa_bias_linearity · msa_attribute_agreement · gum_standard_uncertainty · gum_propagate · gum_expanded · gum_monte_carlo

같은 카테고리(variation)

varmodel_alignment · varmodel_band_k · varmodel_calibrate · varmodel_score


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

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