Class StructuralSimilaritySettings
Settings used by the structural similarity algorithm when comparing images, including the threshold under which two images are considered dissimilar, the gaussian weight which is applied to pixels within each SSIM comparison window, and the size of the SSIM comparison window, and handling of linear space images.
Implements
Inherited Members
Namespace: UnityEngine.TestTools.Graphics
Assembly: UnityEngine.TestTools.Graphics.dll
Syntax
public class StructuralSimilaritySettings : ITextureComparisonSettings
Constructors
StructuralSimilaritySettings(float)
Creates settings and ensures MinimumIndexMeasure is set and valid (Between 0 and 1).
Declaration
public StructuralSimilaritySettings(float minimumIndexMeasure)
Parameters
| Type | Name | Description |
|---|---|---|
| float | minimumIndexMeasure | A value between 0 and 1, where 1 indicates perfect similarity. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | MinimumIndexMeasure must be between 0 and 1. |
Properties
ColorSpaceHandling
Specifies how luminance calculations should handle different color spaces.
Declaration
public LumaColorSpaceMode ColorSpaceHandling { get; init; }
Property Value
| Type | Description |
|---|---|
| LumaColorSpaceMode |
Remarks
This property controls whether linear color space images are accepted, and how color space conversions are applied during luminance computation.
GaussianWeight
The Gaussian sigma/weight used for the SSIM windowing function. Default is 1.5. Must be positive.
Declaration
public float GaussianWeight { get; init; }
Property Value
| Type | Description |
|---|---|
| float |
LumaCalculations
List of luma calculations to use when measuring PSNR. Each instance contains the reference values and the values for which similarity to reference is measured. Provide this if you want to reuse luma calculations across different comparison algorithms (i.e. PSNR and SSIM).
Declaration
public List<LumaPipelineResult> LumaCalculations { get; init; }
Property Value
| Type | Description |
|---|---|
| List<LumaPipelineResult> |
MinimumIndexMeasure
A value between 0 and 1, where 1 indicates perfect similarity (i.e. identical image).
Declaration
public float MinimumIndexMeasure { get; init; }
Property Value
| Type | Description |
|---|---|
| float |
WindowSize
Gets the side-length of the sliding window used in comparison. Must be a positive odd value. Throws ArgumentOutOfRangeException if negative, zero, or even.
Declaration
public int WindowSize { get; init; }
Property Value
| Type | Description |
|---|---|
| int |