Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedDiffMetric ¶
CombinedDiffMetric returns a value in [0, 10] that represents how large the diff is between two images. Implements the MetricFn signature.
Types ¶
type Calculator ¶
type DiffMetrics ¶
type DiffMetrics struct { // NumDiffPixels is the absolute number of pixels that are different. NumDiffPixels int // CombinedMetric is a value in [0, 10] that represents how large the diff is between two // images. It is based off the MaxRGBADiffs and PixelDiffPercent. CombinedMetric float32 // PixelDiffPercent is the percentage of pixels that are different. The denominator here is // (maximum width of the two images) * (maximum height of the two images). PixelDiffPercent float32 // MaxRGBADiffs contains the maximum difference of each channel. MaxRGBADiffs [4]int // DimDiffer is true if the dimensions between the two images are different. DimDiffer bool }
DiffMetrics contains the diff information between two images.
func ComputeDiffMetrics ¶
func ComputeDiffMetrics(leftImg *image.NRGBA, rightImg *image.NRGBA) *DiffMetrics
ComputeDiffMetrics computes and returns the diff metrics between two given images.
Click to show internal directories.
Click to hide internal directories.