ssim_map — IMGMETRICS fidelity op

• Data kinds: image2d × image2d → image2d

• Call: import fullseye as fs; fs.ledger.ssim_map(a, b, data_range=None, win_size=11, sigma=1.5, K1=0.01, K2=0.03, channel_axis=None, crop_border=True) (to call the implementation directly, import imgmetrics; imgmetrics.ssim_map(a, b, data_range=None, win_size=11, sigma=1.5, K1=0.01, K2=0.03, channel_axis=None, crop_border=True); from the registry, opsimgmetrics.get("ssim_map"))

Usage

The SSIM map (before averaging) — to see *where* the two differ, as a picture.

If channel_axis is given, it computes per channel and returns the mean map.

Computation: local mean mu and variance / covariance are taken with a Gaussian window of σ = sigma cut to width win_size (mirror at the boundary), and per pixel ((2 mu_a mu_b + C1)(2 s_ab + C2)) / ((mu_a^2 + mu_b^2 + C1)(s_a + s_b + C2)). C1 = (K1 dr)^2, C2 = (K2 dr)^2, dr is data_range. The variance is population variance (no n/(n-1) correction). Its mean is ssim.

• data_range: automatic for integer dtypes; for float it is inferred as 1.0 only when in [0, 1], otherwise it must be given (the contract of data_range_of; violations give MetricContractError).

• win_size: an odd number of at least 3. Each spatial axis must be at least this long.

• crop_border=True (default) drops a border of window radius (win_size-1)//2, so the return value is (H - 2p, W - 2p). A small image with nothing left after dropping is an exception. With False it has the same shape as the input, but the border includes the effect of mirror padding.

• Return value: a float64 map. 1 means a local match; it can be negative (inverted structure).

• Failure: shape mismatch / empty / non-finite / sigma <= 0 / an even win_size or one below 3.

Detailed usage guide

• image_difference_metrics family guide

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)

• image_quality_metrics — py -3.11 examples/image_quality_metrics.py

• poc_iqa_tid2013 — py -3.11 examples/poc_iqa_tid2013.py

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

mse · rmse · psnr · ssim · ms_ssim · image_entropy · joint_entropy · mutual_information

Same category (fidelity)

mse · rmse · psnr · ssim · ms_ssim


*Provenance: imgmetrics.py — IMGMETRICS 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.