IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Complex Image MultiplicationSee full documentation
reImg,imImgcomplexMultiplyImgImg (inReImg1,inImImg1,inReImg2,inImImg2)

Detailed Description

Multiplication between two complex images.

The algorithm returns a complex image defined by OutImgRe and OutImgIm.

A complex image is defined by two classical images. For instance, $OutComplexImg = OutImgRe + j*OutImgIm$, where $OutImgRe$ is the real part of the complex image $OutComplexImg$ and $OutImgIm$ is its imaginary part.

For two complex input images, InImg1 and InImg2, the output images OutImgRe and OutImgIm are given by :

\begin{eqnarray*} OutImgRe[i] & = & (InImg1Re[i] + InImg2Re[i]) - (InImg1Im[i] + InImg2Im[i])\\ OutImgIm[i] & = & (InImg1Re[i] + InImg2Im[i]) + (InImg1Im[i] + InImg2Re[i]) \end{eqnarray*}

The input complex images are usually calculated from a discrete Fourier transform.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening input images
inImg1 = PyIPSDK.loadTiffImageFile(inputImg1Path)
inImg2 = PyIPSDK.loadTiffImageFile(inputImg2Path)
# computes forward discrete fourier 2d calculation on input images
fDF2dImg1Re, fDF2dImg1Im = itrans.forwardDiscreteFourierTransform2dImg(inImg1)
fDF2dImg2Re, fDF2dImg2Im = itrans.forwardDiscreteFourierTransform2dImg(inImg2)
# multiplication of one complex image by the other
outImgRe, outImgIm = arithm.complexMultiplyImgImg(fDF2dImg1Re, fDF2dImg1Im, fDF2dImg2Re, fDF2dImg2Im)

Example of C++ code :

Example informations

Header file

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

Code Example

// read input image from specified path
ImagePtr pInImg1 = loadTiffImageFile(in1Path);
ImagePtr pInImg2 = loadTiffImageFile(in2Path);
// Compute forward discrete fourier transform on input images
ForwardDFTImg forwardDFTImg1 = forwardDiscreteFourierTransform2dImg(pInImg1);
ForwardDFTImg forwardDFTImg2 = forwardDiscreteFourierTransform2dImg(pInImg2);
// Compute multiplication of two complex images
ComplexImg complex = complexMultiplyImgImg(forwardDFTImg1._pImg1, forwardDFTImg1._pImg2, forwardDFTImg2._pImg1, forwardDFTImg2._pImg2);