normalize
Top  Previous  Next

normalize ( integer Input, integer Output, integer Strength )

Use this function to enhance the contrast of an image by normalizing its histogram. Pixel values are linearly scaled to the full dynamic range of the intensity scale of the image. You can clip the dark and bright tails of the histogram in order to exclude scattered noise pixels from the rescaling.

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.  
 
Strength  
 
A positive integer indicating the percentage of dark and bright pixels on both ends of the histogram that are excluded from normalization. Increasing this value will increase the contrast of the image.  
 
Error flags

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

Example

This set of statements continuously grabs and normalizes an image. The strength can be adjusted in real time with a custom control:  
 
Control(0).SetTitle("Normalize")  
Control(0).SetRange(0,20)  
Control(0).value=1  
do  
grabIm  (0)  
normalize(0, 1, Control(0).value)  
loop