pub struct ChromaStats {
pub mean_abs_dy: f32,
pub mean_dy: f32,
pub mean_abs_di: f32,
pub mean_abs_dq: f32,
pub mean_abs_dc: f32,
pub chroma_cos: f32,
pub sat1: f32,
pub sat2: f32,
pub chroma_rough: f32,
}Expand description
Chroma-plane statistics of the changed pixels, all normalized to 255. Separates recolors (coherent, smooth chroma movement) from content replacements (scattered chroma) on photographic edits where luminance correlation alone saturates.
Fields§
§mean_abs_dy: f32Mean |ΔY| (luminance delta magnitude).
mean_dy: f32Signed mean ΔY — a recolor often pushes luminance consistently in one direction, while a replacement balances out.
mean_abs_di: f32Mean |ΔI|.
mean_abs_dq: f32Mean |ΔQ|.
mean_abs_dc: f32Mean chroma-delta magnitude √(ΔI²+ΔQ²).
chroma_cos: f32Cosine between the chroma vectors of img1 and img2, weighted by their magnitudes. Near 1 = same hues, negative = coherent hue rotation.
sat1: f32Mean chroma magnitude (saturation) in img1.
sat2: f32Mean chroma magnitude in img2.
chroma_rough: f32Roughness of the chroma-delta field: mean |∇|Δc|| between adjacent changed pixels over the std of |Δc|. Low = smooth recolor, high = patchy replacement.