<< Chapter < Page | Chapter >> Page > |
Since and need to be integers in [link] , the evaluation of needs to be rounded to the nearest integer.
The pixel transformation shown in [link] is not a one-to-one function. However, [link] still may be used to give insight into the effect of the transformation. Since theregions and map to the single points 0 and 255, we might expect "spikes" at the points 0 and 255 in theoutput histogram. The region of the output histogram will be directly related to the input histogram through [link] .
First, notice from that the region of the output is being mapped from the region of the input. Then notice that will be a constant scaling factor throughout the entire region of interest. Therefore, the output histogram shouldapproximately be a stretched and rescaled version of the input histogram, with possible spikes at the endpoints.
Write a Matlab function that will perform the pixel transformation shown in [link] . It should have the syntax
output = pointTrans(input, T1, T2)
.
Download the image file narrow.tif and read it into Matlab.Display the image, and compute its histogram. The reason the image appears "washed out" is that it has a narrow histogram.Print out this picture and its histogram.
Now use your
pointTrans
function to spread out the histogram using
and
. Display the new image and its histogram.
(You can open another figure window using the
figure
command.)
Do you notice a difference in the "quality" of the picture?
pointTrans
.Download the file dark.tif for the following section.
The light intensity generated by a physical device is usually a nonlinear function of the original signal. For example, a pixel that hasa gray level of 200 will not be twice as bright as a pixel with a level of 100. Almost all computer monitors havea power law response to their applied voltage. For a typical cathode ray tube (CRT),the brightness of the illuminated phosphors is approximately equal to the applied voltage raised to a power of 2.5.The numerical value of this exponent is known as the gamma ( ) of the CRT. Therefore the power law is expressed as
where is the pixel intensity and is the voltage applied to the device.
If we relate [link] to the pixel values for an 8-bit image, we get the following relationship,
where is the original pixel value, and is the pixel intensity as it appears on the display.This relationship is illustrated in [link] .
Notification Switch
Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?