Compare grey values in two images
#include "dip_math.h"
dip_Error dip_Compare ( in1, in2, out, selector )
binary, integer, float
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.
Data type | Name | Description |
dip_Image | in1 | First input |
dip_Image | in2 | Second input |
dip_Image | out | Output |
dipf_Select | selector | Select flag |
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 |
Select, Threshold, Equal, Greater, Lesser, NotEqual, NotGreater, NotLesser, SelectValue, NotZero
DIPlib on-line documentation | Function reference | Global function index