{% extends "base.html" %} {% block title %} normalize {% endblock %} {% block description %}
Normalizes the norm or value range of an array.
{% endblock %} {% block signature %}cv2.normalize(src[, dst[, alpha[, beta[, norm_type[, dtype[, mask]]]]]]) → dst{% endblock %} {% block parameters %}
src
.norm_type
is used. Defaults to 1.
norm_type
NORM_INF, NORM_L1, or NORM_L2, this function normalizes the image so that \(\|\text{dst}\|_{L_p} = \text{alpha}\), where \(p\) = \(\infty\), 1, or 2, respectively. Defaults to 1.norm_type
NORM_MINMAX, alpha = \(\min_I\) dst(I).norm_type
NORM_MINMAX, beta = \(\max_I\) dst(I). Defaults to 0.cv2.NORM_*
): Normalization type. Defaults to NORM_L2. Choose from:
cv2.CV_*
): Output image depth. Default is -1 to use src1.depth()
, and this is used in this app.The functions normalize scale and shift the input array elements so that \(\|\text{dst}\|_{L_p} = \text{alpha}\), where \(p\) = \(\infty\), 1, or 2, when using norm_type
NORM_INF, NORM_L1, or NORM_L2. This is referred to as normalizing the norm.
When using norm_type
NORM_MINMAX, this function works to satisfy both alpha = \(\min_I\) dst(I) and beta = \(\max_I\) dst(I). This is referred to as normalizing the range.
To modify an entire image using the norm of only a subarray, use the functions norm()
and convertScaleAbs()
.