Computes the L1 or L2 norm between two vectors or matrices.
Usage
norm(orgImage, testImage, mode = "L2")
Arguments
orgImage
A vector or a matrix.
testImage
A vector or a matrix of same size as orgImage.
mode
Defaults to mode="L2" to compute a L2 norm between orgImage and testImage. Alternative choice is "L1".
Value
Returns the L1 or L2 norm.
Details
If \(X\) and \(Y\) are vectors of length \(n\) or \((n_1,n_2)\)-matrices with \(n=n_1*n_2\) then the L1-norm and the L2-norm will be compute as follow: