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

# IDivergence

difference measure

## SYNOPSIS

dip_Error dip_IDivergence ( in1, in2, mask, out )

## DATA TYPES

binary, integer, float

## FUNCTION

Calculates the I-divergence between each pixel value of `in1` and `in2`. Optionally the `mask` image can be used to exclude pixels from the calculation by setting the value of these pixels in `mask` to zero.

The I-Divergence is defined as: `I(x,y) = x ln(x/y) - (x - y)` and is divied by the number of pixels. It is the -log of a possion distribution `p(x,y)=e^(-y)/x!-y^x` with the stirling approximation for `ln x!`. For x=0, the stirling approximation would fail, `y` is returned.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in1` | First input, Data:x
`dip_Image` | `in2` | Second input, Model:y
`dip_Image` | `mask` | Mask
`dip_Image` | `out` | Output

## LITERATURE

Why Least Squares and Maximum Entropy? An axiomatic approach to inference for linear inverse problems , I. Csiszar, The Annals of Statistics, 19, 2032-2066, 1991.

## SEE ALSO

`MeanError`, `MeanSquareError`, `RootMeanSquareError`, `MeanAbsoluteError`, `LnNormError`