median
Top  Previous  Next

median ( integer Input, integer Output, integer Size )

Use this function to apply the median filter to an image or selection. The median filter replaces the target pixel with the median value in its neighborhood. As a result, the impulse noise on an image gets reduced without degrading edges or intensity gradients

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.  
 
Output  
 
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Size  
 
An odd integer between 1 and 2*Overscan+1 specifying the size of the square kernel used for calculating the median. The Overscan setting is defined in ImageWarp Preferences.  
 
Error flags

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

Example

This set of statements applies an impulse noise to a sample image and then suppresses the noise using the median filtration.  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
genImpulse (1,1,50)  
median (1,1,3)