sigma
Top  Previous  Next

sigma ( integer Input, integer Output, integer Size, floating Sigma )

Use this function to apply a non-linear smoothing to an image or selection. Those pixels in the neighborhood which differ from the target pixel by less than Sigma are averaged, and the resulting value replaces the original one. If all the differences are greater than Sigma, the target pixel remains unchanged. As a result, the noise gets reduced while the fine structure preserved.

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 neighborhood for filtering. The Overscan setting is defined in ImageWarp Preferences.  
 
Sigma  
 
A floating variable or constant specifying the filter's threshold. Only those pixels which differ from the central pixel by less than this value are taken for averaging. For better results Sigma should be close to the standard deviation of the noise distribution. You can determine it by acquiring a blank image under the same noise condition and measuring the standard deviation of the image.  
 
Error flags

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

Example

This set of statements applies a Gaussian noise to a sample image and then suppresses the noise using the Sigma filter.  
 
sig=10  
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
genNoise (1, 1, sig, NS_GAUSS)  
sigma (1, 2, 15, 2*sig)