Login  Register

Enchance Contrast Question

Posted by fmerchant on Jan 13, 2015; 9:44pm
URL: http://imagej.273.s1.nabble.com/Enchance-Contrast-Question-tp5011208.html

 Using the site below the description for Contrast Stretching in the Enhance Contrast menu item is as follows

http://homepages.inf.ed.ac.uk/rbf/HIPR2/stretch.htm

For example for 8-bit graylevel images the lower and upper limits might be 0 and 255. Call the lower and the upper limits a and b respectively.

The simplest sort of normalization then scans the image to find the lowest and highest pixel values currently present in the image. Call these c and d. Then each pixel P is scaled using the following function:

    Pout = (Pin - c) (b-a/d-c) + a

Values below 0 are set to 0 and values about 255 are set to 255.

How do I call Enhance Contrast, with user-defined values for c and d in the formula above?

Thanks,
Fatima