Constant Variance Enhancement

In many applications, the local image variance is a good measure of local contrast. Areas with low variance are essentially flat and have low contrast, while areas with high variance are often near edges and have high contrast. Constant variance enhancement is one approach which utilizes this fact to increase image contrast. For each point in the image, the output pixel is defined to be: out = GM + (in - LM) * (GS / LS), where GM and GS are the global mean and standard deviation for the image, and LM and LS are the local mean and standard deviation in an N by N neighborhood of the output pixel. The program cve implements constant variance enhancement and has two parameters which control the degree of enhancement (-n for neighborhood size, and -g for contrast gain factor). Local image statistics can also be output with the -m or -s switches. (see code)

Command Usage

cve [options] infile outfile
    [-d]    Print debugging information
    [-m]    Output local mean
    [-s]    Output local standard deviation
    [-n #]  Size of local neighborhood
    [-g #]  Contrast gain factor (between 0..1)

Example

cve -n 5 input.im cve0.im
disp input.im cve0.im
cve -n 10 input.im cve1.im
cve -n 20 input.im cve2.im
disp cve1.im cve2.im
cve -m -n 20 input.im cve3.im
cve -s -n 20 input.im cve4.im
disp cve3.im cve4.im