splitComplex
Top  Previous  Next

splitComplex ( integer Input, integer Output1, integer Output2 )

Use this function to split a complex image into two floating point component images. Depending on the mode in which the complex image is displayed, it will be split to either the Cartesian components (Re and Im) or polar components (Amplitude and Phase). if the input image is not a complex one, the function will convert it into a complex image prior to performing the split operation.

Parameters
 
Input  
 
An integer between 0 and 116 specifying the input image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Output1, Output2  
 
Integers between 1 and 116 specifying the output frame numbers for the Real and Imaginary components in case the input image is in the Cartesian mode, or for the Amplitude and Phase components in case the input image is in the Polar mode. Values in the range of 100-116 correspond to hidden frames.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example

This set of statements grabs an image from the video device, applies the fast Fourier transform to it and splits the resulting complex image into the Amplitude and Phase components. Then the amplitude component is scaled up with the factor function, and both components merge back into a complex image. The inverse Fourier transform recreates the original image with an increased contrast.  
 
Inp=1  
Cmpl=100  
Amp=2  
Ph=3  
Out=4  
Koef=1.5  
GrabIm(Inp)  
fourier (Inp, Cmpl, M_DIRECT, F_FFT)  
splitComplex (Cmpl, Amp,Ph)  
factorIm (Amp,Amp,Koef,M_CLIP)  
mergeComplex (Amp,Ph,Cmpl,C_POLAR)  
fourier (Cmpl,Out,M_INVERSE,F_FFT)