A spatial normalization kernel.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+Beta
- tvOS 10.0+
- Metal Performance Shaders
The spatial normalization for a feature channel applies the kernel over local regions which extend spatially, but are in separate feature channels (i.e., they have the shape
1 x kernel width x kernel height).
For each feature channel, the function computes the sum of squares of
X inside each rectangle,
N2(i,j). It then divides each element of
X as follows:
kh are the values of the kernelWidth and kernelHeight properties, respectively. It is your responsibility to ensure that the combination of the values of the
alphakernelWidthkernelHeight properties does not result in a situation where the denominator becomes zero (in such situations the resulting pixel-value is undefined).