DIPlib Documentation - ©1995-2013 Quantitative Imaging Group, Delft University of Technology.

# Compare

Compare grey values in two images

## SYNOPSIS

dip_Error dip_Compare ( in1, in2, out, selector )

## DATA TYPES

binary, integer, float

## FUNCTION

This function can perform various pixel-by-pixel comparisons (smaller, smaller- equal, equal, not equal, greater-equal, greater) between `in1` ans `in2`. `out` contains the binary result. This is implemented with a call to `Select` whose `in3` and `in4` are set to binary true and false, respectively.

`in2` can be a 0D image for comparison of pixel values with a single scalar value. This leads to the functionality of `Threshold`, but with more options.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in1` | First input
`dip_Image` | `in2` | Second input
`dip_Image` | `out` | Output
`dipf_Select` | `selector` | Select flag

The `dipf_Select` flag can be one of:

Name | Description
`DIP_SELECT_LESSER` | `<`, Lesser than
`DIP_SELECT_LESSER_EQUAL` | `<=`, Lesser or equal
`DIP_SELECT_NOT_EQUAL` | `!=`, Unequal
`DIP_SELECT_EQUAL` | `==`, Equal
`DIP_SELECT_GREATER_EQUAL` | `>=`, Greater or equal
`DIP_SELECT_GREATER` | `>`, Greater

## SEE ALSO

`Select`, `Threshold`, `Equal`, `Greater`, `Lesser`, `NotEqual`, `NotGreater`, `NotLesser`, `SelectValue`, `NotZero`