IPSDK 4.1.0.2
IPSDK : Image Processing Software Development Kit
L2 Norm (Euclidian) of 2 images
imagel2Norm2Img (inImg1,inImg2)

Detailed Description

Computation of L2 (euclidian) norm of two images algorithm.

This algorithm allows to compute L2 norm (euclidian norm) of two images. Given two input images $InImg1$ and $InImg2$, output image values are defined by :

\[ OutImg[i] = \sqrt{InImg1^2[i]+InImg2^2[i]} \]

Here is an example of a L2 norm computation applied to two floating point grey level input images :

l2Norm2Img.png
See also
http://en.wikipedia.org/wiki/Norm_%28mathematics%29#Euclidean_norm

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening of input images
inImg1 = PyIPSDK.loadTiffImageFile(inputImg1Path)
inImg2 = PyIPSDK.loadTiffImageFile(inputImg2Path)
# computation of L2 norm of the 2 input images
outImg = arithm.l2Norm2Img(inImg1, inImg2)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/L2Norm2Img/L2Norm2Img.h>

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath);
// compute gradient on input image
GradientXYImg gradientXY = gaussianGradient2dImg(pInImg, 3.0f);
// compute norm on previous gradients
ImagePtr pOutImg = l2Norm2Img(gradientXY._pXGradImg, gradientXY._pYGradImg);