normalize_norm¶
-
menpo.feature.normalize_norm(pixels, mode='all', error_on_divide_by_zero=True)[source]¶ Normalize the pixels to be mean centred and have unit norm. The
modeparameter selects whether the normalisation is computed across all pixels in the image or per-channel.- Parameters
pixels (
Imageor subclass or(C, X, Y, ..., Z)ndarray) – Either the image object itself or an array with the pixels. The first dimension is interpreted as channels. This means an N-dimensional image is represented by an N+1 dimensional array.mode (
{all, per_channel}, optional) – Ifall, the normalization is over all channels. Ifper_channel, each channel individually is mean centred and normalized in variance.error_on_divide_by_zero (bool, optional) – If
True, will raise aValueErroron dividing by zero. IfFalse, will merely raise a warning and only those values with non-zero denominators will be normalized.
- Returns
pixels (
Imageor subclass or(X, Y, ..., Z, C)ndarray) – A normalized copy of the image that was passed in.- Raises
ValueError – If any of the denominators are 0 and
error_on_divide_by_zeroisTrue.