divIm
Top  Previous  Next

divIm ( integer Input1, integer Input2, integer Output [, integer Normalize =1])

Use this function to divide one image by another on a pixel-by-pixel basis. The following formula is used for calculating the intensity of the target pixel:

divim

If one or both images are of the complex type, the complex arithmetic is applied:

If the input images differ in types, they will be automatically converted to the type that forces conformity between the images. If the images or selections are different sizes, one or both of them will be clipped to match the minimal horizontal and vertical dimension of the images or selected regions of interests.

Parameters
 
Input1  
An integer between 0 and 116 specifying the frame number of the first input image. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Input2  
 
An integer between 0 and 116 specifying the frame number of the second input image whose pixels will be used as divisors. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Output  
 
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Normalize  
 
An optional boolean integer that defines the post-processing mode.  
 
FALSE=0 – no post-processing will be performed  
TRUE=1 - pixel values in the output image to be linearly scaled to the full intensity range of the image.  
Default: FALSE  
 
Error flags

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

Example

This set of statements divides one sample images to another and normalizes the result:  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
loadIm (2,"sample15.iwd")  
divIm (1,2,3,M_NORMALIZE)