MATLAB File Help: cv.norm Index
cv.norm

Calculates an absolute array norm, an absolute difference norm, or a relative difference norm.

nrm = cv.norm(src1)
nrm = cv.norm(src1, src2)
nrm = cv.norm(..., 'OptionName', optionValue, ...)

Input

Output

Options

The functions norm calculate an absolute norm of src1 (when there is no src2):

       { ||src1||_Linf = max(abs(src1(:)))     , if NormType='Inf'
norm = { ||src1||_L1   = sum(abs(src1(:)))     , if NormType='L1'
       { ||src1||_L2   = sqrt(sum(src1(:).^2)) , if NormType='L2'

or an absolute or relative difference norm if src2 is there:

       { ||src1 - src2||_Linf = max(abs(src1(:) - src2(:)))       , if NormType='Inf'
norm = { ||src1 - src2||_L1   = sum(abs(src1(:) - src2(:)))       , if NormType='L1'
       { ||src1 - src2||_L2   = sqrt(sum((src1(:) - src2(:)).^2)) , if NormType='L2'

or:

       { ||src1 - src2||_Linf / ||src2||_Linf , if NormType='Inf' && Relative=True
norm = { ||src1 - src2||_L1 / ||src2||_L1     , if NormType='L1'  && Relative=True
       { ||src1 - src2||_L2 / ||src2||_L2     , if NormType='L2'  && Relative=True

When the mask parameter is specified and it is not empty, the norm is calculated only over the region specified by the mask.

A multi-channel input arrays are treated as a single-channel, that is, the results for all channels are combined.

See also