If your gray levels extend the range between 0 and 255 in either direction you need 16 bit at least (image type int).
Then you can write your routine according to your formula,
with
a: lowest grayvalue of your input image
b: highest grayvalue of your input image
c: lowest value of stretched (output) image
d: highest value of stretched (output) image
Angelika
(hope it helps, not completely sure if I understand your question)
Gesendet: Dienstag, 13. Januar 2015 um 22:44 Uhr
Von: fmerchant <
[hidden email]>
An:
[hidden email],
[hidden email]
Betreff: Enchance Contrast Question
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.htmFor 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
--
View this message in context:
http://imagej.1557.x6.nabble.com/Enchance-Contrast-Question-tp5011208.html[
http://imagej.1557.x6.nabble.com/Enchance-Contrast-Question-tp5011208.html]
Sent from the ImageJ mailing list archive at Nabble.com.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html[
http://imagej.nih.gov/ij/list.html]
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html