void normalize(
InputArray src, OutputArray dst, //输入输出
double alpha = 1, double beta = 0, //α,β,确定变化的范围
int norm_type = NORM_L2, //变化类型
int dtype = -1,
InputArray mask = noArray() ) //掩码,确定哪些部分参与变化
归一化公式:
1、normType = NORM_MINMAX
the values of the array are rescaled and translated so that they are linearly mapped into the interval between αandβ;数组的数字直接被线性转换成α,β之间的值;
2、normType = NORM_INF (infinity)
the array src is rescaled such that the magnitude of the absolute value of the largest entry is equal to α;
数组最大项的绝对值放大到α;
3、 normType = NORM_L1, NORM_L2the array is rescaled so that the norm equals the value ofα;
其中,函数norm的功能是计算norm(范数)的绝对值
Thefunctions norm calculate an absolute norm of src1 (when there is no src2 ):
1、线性函数转换,表达式如下:(对应NORM_MINMAX)
if mask(i,j)!=0
dst(i,j) = (src(i,j) - min(src)) * (b' - a') / (max(src) - min(src)) + a'
else
dst(i,j) = src(i,j)
其中b' = MAX(alpha,beta ) , a' = MIN(alpha,beta );
2. 当norm_type!=NORM_MINMAX:
if mask(i,j) != 0
dst(i,j) = src(i,j) *alpha / norm (src,norm_type,mask)
else
dst(i,j) = src(i,j)
https://blog.csdn.net/Michael__Corleone/article/details/75213123
https://blog.csdn.net/Michael__Corleone/article/details/75213123