equalize
Top  Previous  Next

equalize ( integer Input, integer Output [, integer Mode =0 ] )

Use this function to enhance the contrast and dynamic range of an image by analyzing its cumulative histogram and modifying it to match a specified shape.

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.  
 
Mode  
 
An enumerated integer that describes the shape of the recalculated cumulative histogram. Must be one of the following values:  
 
EQ_UNIFORM=0 - the histogram is distributed equally across the intensity scale. This mode produces a high contrast image with the highest possible dynamic range.  
EQ_LOGARITHM=1 - the histogram is concentrated at the low end of the scale. This mode increases the contrast in the light areas of the image.  
EQ_EXPONENT=2 - the histogram is concentrated at the high end of the scale. This mode increases the contrast in the dark areas of the image.  
EQ_BELL=3 - the histogram is concentrated at the center of the intensity scale. This mode increases the contrast in the light and dark areas of the image.  
Default: EQ_UNIFORM  
 
Error flags

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

Example

This set of statements demonstrates different modes of the histogram equalization:  
 
setCurDir("samples")  
loadIm (1,"sample8.iwd")  
equalize (1, 2, EQ_UNIFORM)  
equalize (1, 3, EQ_LOGARITHM)  
equalize (1, 4, EQ_EXPONENT)  
equalize (1, 5, EQ_BELL)