patchdist_score — SPC anomaly_patch op

• Data kinds: image2d × table → table

• Call: import fullseye as fs; fs.ledger.patchdist_score(image, model, smooth=4.0) (to call the implementation directly, import anomaly_patch; anomaly_patch.patchdist_score(image, model, smooth=4.0); from the registry, opsspc.get("patchdist_score"))

Usage

Score one image against a per-position normal distribution: the Mahalanobis distance per patch (table).

model comes from patchdist_fit; image must have the training images' shape. The grid of distances sqrt((x - mu)' P (x - mu)) is interpolated (bilinear, between patch centres) to the image size and smoothed by a Gaussian of smooth px (0 = no smoothing). Returns map (H, W; higher = more anomalous), grid (the raw distances), image_score (the maximum of the smoothed map) and smooth.

Raises ValueError for a model that is not a patchdist_fit result, a different image shape, or a negative / non-finite smooth.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• (none yet)

Ops the type connects to (they accept table as input)

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

Same category (anomaly_patch)

patch_features · patchdist_fit · patchbank_fit · patchbank_score


*Provenance: anomaly_patch.py — SPC operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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