image = | localEnergy2dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY) |
image = | localEnergy2dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY,inOptNbClasses) |
local energy on a 2d image
This algorithm computes for each pixel of the output image its associated local energy on a rectangular neighbourhood.
The more homogeneous is the neighbourhood, the higher will be the local energy.
Given an input image , rectangular kernel half sizes
and
and a number of classes
, output image values are given by :
where is the probability deduced from the neighbourhood histogram
by
.
The histogram is computed on the rectangular kernel, with the following parameters:
The number of classes is an optional parameter of the algorithm. Its default value equals to 16. If the number of classes specified by the user exceeds the maximum allowed number of classes given the input image data type and dynamic range, it is automatically adjusted. For instance:
The borders of the input image are handled by padding pixels with a mirror reflection of the border pixels in the input image (see Border policy for more details).
Here is an example of an output image computed from the LocalEnergy2dImg algorithm on a 8-bits grey level, with a kernel of size 3x3 pixels and 16 classes: