Struct ChannelDifference
How much one channel of two images differs, on the 0 to 1 scale of the channel values, so 8-bit and 16-bit results line up.
public readonly record struct ChannelDifference : IEquatable<ChannelDifference>
- Implements
- Inherited Members
Examples
// Every cheap metric in one pass, per channel and overall, on the 0 to 1 scale; SSIM on request.
CompareResult result = Raster.Compare(expected, actual, new CompareOptions { Ssim = true, Fuzz = 0.02f });
Console.WriteLine($"PSNR {result.Overall.Psnr:F1} dB, SSIM {result.Overall.Ssim:F4}, {result.DifferentPixels} pixels off by more than 2%");
bool sameLook = result.Overall.Psnr >= 40;
Properties
Dssim
Gets the structural dissimilarity, (1 − Ssim) / 2, or NaN when SSIM was not computed.
public double Dssim { get; }
Property Value
Mae
Gets the mean absolute error: the average of |a − b|.
public double Mae { get; }
Property Value
Mse
Gets the mean squared error: the average of (a − b)².
public double Mse { get; }
Property Value
PeakError
Gets the largest |a − b| of any pixel (ImageMagick's PAE).
public double PeakError { get; }
Property Value
Psnr
Gets the peak signal-to-noise ratio in decibels, 10·log₁₀(1 / Mse), or +∞ when the channels are equal.
public double Psnr { get; }
Property Value
Rmse
Gets the root mean squared error, √Mse.
public double Rmse { get; }
Property Value
Ssim
Gets the structural similarity (Wang et al. 2004), 1 for equal channels, or NaN unless Ssim was set.
public double Ssim { get; }