anomaly_patch opvideo → tableimport fullseye as fs; fs.ledger.patchdist_fit(stack, patch=8, stride=4, scales=(1.0, 2.0, 4.0), groups=('gradient', 'gabor', 'lbp'), n_orient=4, shrinkage='auto', n_dims=None, seed=0, ridge=1e-06, pool='position') (実装を直接呼ぶなら import anomaly_patch; anomaly_patch.patchdist_fit(stack, patch=8, stride=4, scales=(1.0, 2.0, 4.0), groups=('gradient', 'gabor', 'lbp'), n_orient=4, shrinkage='auto', n_dims=None, seed=0, ridge=1e-06, pool='position')、台帳から引くなら opsspc.get("patchdist_fit"))Learn a normal distribution of the patch feature at every grid position from good images (table).
stack is (n, H, W) or (n, H, W, 3) of good images, n >= 2, registered well enough that a
grid cell sees the same content. The feature is patch_features (same parameters). At
every cell the mean and the covariance (maximum likelihood, divided by n) of the D-dimensional
feature are estimated; n <= D makes the covariance singular, so the shrinkage toward
tr(S)/D * I is declared: "auto" is the Ledoit–Wolf analytic intensity per position,
a number in (0, 1] fixes it, "none" (or 0) is accepted only when n - 1 >= D and the
covariance is positive definite and otherwise refused. n_dims keeps a seeded random subset of the
D dimensions (the memory trick of the original method), ridge (relative to the median
variance, applied unless shrinkage="none") is a numerical floor against exactly constant
channels. pool="position" (default) estimates one distribution per grid cell, right when
the content is registered; pool="global" estimates ONE distribution from the patches of
all cells and images (n * gh * gw samples, overlapping patches are not independent), right
for a stationary texture whose content at a cell differs from image to image and which has
far more samples than dimensions.
Returns the model: per-position mean and precision (inverse of the shrunk
covariance), shrinkage_map and its mean shrinkage_mean, n_train, dim,
dims (kept channels), the feature parameters and image_shape. Pass it to
patchdist_score.
Raises ValueError for fewer than two images, a singular covariance with
shrinkage="none", a constant feature that stays singular, or invalid parameters.
py -3.11 examples/poc_patch_anomaly.pytable を入力に取れる)msa_anova_table · msa_gauge_rr · msa_bias_linearity · msa_attribute_agreement · gum_standard_uncertainty · gum_propagate · gum_expanded · gum_monte_carlo
anomaly_patch)patch_features · patchdist_score · patchbank_fit · patchbank_score
Provenance: anomaly_patch.py — SPC operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.