User's Guide

DIFF

Performs a comparison between two images

Function:

Performs a comparison between two images. Multiple pairs of images may also be compared to determine their equivalency. Each pair of images must have identical sizes but can be of different data types. The first image of a pair is taken as the reference image to which the second is compared.

A table summarizing the comparison results is output to the user's terminal, printer, or to a specific disk file. The number of points equal to each other is listed, as well as the number of points above and below the corresponding reference values. Also, the mean difference between images and variance of the difference are calculated and listed for above and below reference-valued points.

Parameters:

IN
Input images. The input images may be BYTE, INTEGER*2, INTEGER*4, or REAL*4 data, and may belong to any user. Single- and multi-band images may be specified. Window and band options may be used.

PRINT(TERM)
Output destination. The destination of the output.


  = TERM:      Terminal.  Output is sent to the
               user's terminal.
  = LP:        Line printer.  Output is sent to
               the printer defined by $PRINTER.
  = Filename:  User supplied filename.  Output
               is sent to the user supplied file
               with the extension ".prt".

COMPOPT(SIMPLE)
Comparison option. Performs either a simple pixel-by-pixel difference or a relative pixel-by-pixel difference.


  = SIMPLE:    Simple comparison  
  = RELATIVE:  Relative comparison

LISTOPT(BRIEF)
List option. Determines the type of listing generated. If a long listing is desired, each pixel that is different is listed along with a summary of differences for each line.


  = BRIEF:  Brief listing
  = LONG:   Long listing

TOLVAL(0.0)
Tolerance value. The tolerance of which the pixel values must be "greater than" in order to be considered different.

Examples:

  1. LAS> diff in="in1,in2" print=term compopt=simple listopt=brief tolval=0.0

    DIFF performs the SIMPLE comparison between the two input images, which must be of the same size. The first image is used as the reference and is output to the terminal.

  2. LAS> diff in="file1(10,10,400,300:1-3,7) file2(20,30,400,300:2-4,6)" print=term compopt=relative listopt=long tolval=2.0

    A pairwise RELATIVE comparison is performed between the images. Bands 1 through 3 of FILE1 are compared to bands 2 through 4 of FILE2, and band 7 of FILE1 is compared to band 6 of FILE2. The indicated windows are used on the images. A comparison table is printed to the line printer for each pair of bands. Only pixel values which differ more than two values will be considered different.

Description/Algorithm:

The SIMPLE comparison performs a pixel-by-pixel difference for each band of the images:

COMP(x,y) = IMG1(x,y) - IMG2(x,y)

The RELATIVE comparison performs an pixel-by-pixel relative difference using the formula:


		    IMG1(x,y) - IMG2(x,y) 
        COMP(x,y) = ---------------------
		         IMG1(x,y)

Totals are kept of the number of pixels below, equal to, and above the corresponding pixels in the reference image. The mean and variance are calculated from totals of the differences.

If the LONG listing is desired then, in addition to the brief report, each line and sample is printed along with a summary of each line indicating the number of values that are less-than, equal-to, and greater-than for that line.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [diff-fatal] Fatal error encountered

    A fatal error was encountered during processing. Processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  2. [diff-size] Sizes of the two images differ

    The specified inputs have different sizes or different size windows applied to them. Comparison images or windows should have the same number of lines and samples.

User Note:

  1. The execution time is based upon the size, data type, and number of differences found in the comparison.