Image Difference Checker

Used in regression tests to test the created image with a reference image. The node will compare (depending on the dialog settings) the incoming images during execute and fails with an exception if they are not equal (or do not meet the expectations). In that case the node stays not executed and the test will fail.

In the node's dialog, you can adjust how individual the images are compared. The default is to check for exact equality. For certain images you can relax the comparison by using special checkers, e.g. by specifying a certain allowed percentage of difference.

Currently there are four different image checker available:

  • pHash, which first downscales the image to the given size, converts it to grayscale, computes a discrete cosinus transformation (DCT) and finally takes only the given left upper part of the matrix (the low frequencies in the picture). Finally the two small matrices from both images are compared.
  • dHash, which works similar to the above, but skips the DCT step and compares difference between neighbouring pixels in the downscaled images.
  • A histogram-based comparison. It computes histograms for each of the three color channels with a configurable number of equal-sized bins. Then the difference between all pairs of bins between the two images are summed up and normalized for a percentage value.
  • Full difference compares the complete images. For each pixel and each color channel (excluding the alpha channel for now) the differences between reference and test image are summed up and then divided by the maximum possible differences.
In all cases a percentage between 0 and 100 is computed and compared to the given threshold.

Input Ports

Icon
Freshly created image that is tested.
Icon
The reference image.

Output Ports

This node has no output ports

Popular Successors

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.