OpenCV image of normalization (normalize)

What image normalization

More simply the value of the matrix is ​​in some way within a certain interval is changed to a

Image normalization role

  1. Currently able to understand is normalized to a range of easy to deal with, you can expect expert guidance of

opencv document presentation

C++: void normalize(InputArray src, InputOutputArray dst, double alpha=1, double beta=0, int norm_type=NORM_L2, int dtype=-1, InputArray mask=noArray() )
C++: void normalize(const SparseMat& src, SparseMat& dst, double alpha, int normType)

Python: cv2.normalize(src[, dst[, alpha[, beta[, norm_type[, dtype[, mask]]]]]]) → dst

Parameters: 
src – input array.
dst – output array of the same size as src .
alpha – norm value to normalize to or the lower range boundary in case of the range normalization.
beta – upper range boundary in case of the range normalization; it is not used for the norm normalization.
normType – normalization type (see the details below).
dtype – when negative, the output array has the same type as src; otherwise, it has the same number of channels as src and the depth =CV_MAT_DEPTH(dtype).
mask – optional operation mask.

norm_type have NORM_INF, NORM_MINMAX, NORM_L1 and NORM_L2 four.
1, in NORM_MINMAX mode, alpha represents the minimum value after normalization, beta denotes the maximum value after normalization.
2, at NORM_L1, NORM_L2, NORM_INF mode, alpha denotes performed after a normalization of the respective norm value matrix, beta is not used.
3, sparse matrix normalized only supports non-zero pixels

NORM_MINMAX

Numeric array is panning or zooming to a specified range, the linear normalization.

$$ dst(i, j) = \frac{(src(i, j) - min(src(x, y))) * (beta - alpha)}{max(src(x, y)) - min(src(x, y))} + alpha $$

NORM_INF

Denominator L∞ norm, i.e. maximum absolute value of the matrix elements (Chebyshev distance)

NORM_L1

L1- norm denominator, i.e., the absolute value of the matrix element and (Manhattan distance)

NORM_L2

L2- norm of the denominator, i.e., each element of the matrix and the Euclidean distance

Guess you like

Origin www.cnblogs.com/huluwa508/p/11356196.html