IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Computation of L1 (taxicab) norm of two images algorithm. More...

IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::l1Norm2Img (const image::ImageConstPtr &pInImg1, const image::ImageConstPtr &pInImg2, const image::ImagePtr &pOutImg)
 wrapper function for Computation of L1 (taxicab) norm of two images More...
 
IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::l1Norm2Img (const image::ImageConstPtr &pInImg1, const image::ImageConstPtr &pInImg2)
 wrapper function for Computation of L1 (taxicab) norm of two images More...
 

Detailed Description

Computation of L1 (taxicab) norm of two images algorithm.

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

\[ OutImg[i] = \lvert InImg1[i] \rvert + \lvert InImg2[i] \rvert \]

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

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg1 [Input] First image for processing operation X
ipsdk::imaproc::attr::InImg2 [Input] Second image for processing operation X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation promoteUnary (_pOutImg, _pInImg1, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperUnsigned)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg1,_pInImg2,_pOutImg) && 
ipsdk::imaproc::matchBufferType (_pInImg1,_pInImg2)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

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

Example of C++ code :

Example informations

Associated library

IPSDKIPLArithmetic

Header file

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 = l1Norm2Img(gradientXY._pXGradImg, gradientXY._pYGradImg);
See also
L1Norm2ImgLvl1
L1Norm2ImgLvl2
L1Norm2ImgLvl3

Function Documentation

◆ l1Norm2Img() [1/2]

IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::l1Norm2Img ( const image::ImageConstPtr pInImg1,
const image::ImageConstPtr pInImg2,
const image::ImagePtr pOutImg 
)

wrapper function for Computation of L1 (taxicab) norm of two images

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ l1Norm2Img() [2/2]

IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::l1Norm2Img ( const image::ImageConstPtr pInImg1,
const image::ImageConstPtr pInImg2 
)

wrapper function for Computation of L1 (taxicab) norm of two images

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure