opencv学习1---normalize函数

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_L2

the 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值