With the enhancements to the ImageTools package, we can easily manipulate the pixel intensities of the images. Starting with the already loaded image, we can plot the histogram of the pixels.
By applying the function to all the pixels in the image, we adjust the histogram of the image. Note that by applying this operator, the pixel intensities no longer fit between 0 and 1. We must therefore also use the FitIntensity command to rescale the pixel intensities to fit between 0 and 1.
|
Click the button above to see the effect of the transformation. The original, as well as the transformed image is shown.
|
|
|
We can plot the histogram of the original image and the modified image.
Similarly, we can apply the exponential operator. To intensify the effect of the exponential operators, we multiply the pixel intensity by 5 before applying the operator.
|
Click the button above to see the effect of both transformations. The original as well as the two transformed images are shown.
|
|
|
We would like to take the image modified by the exponential operator and adjust the histogram so that the occurrence of all intensity levels are equally likely. First, we create a cumulative histogram of the image.
Now we want to use this cumulative histogram as a function that maps the intensity levels. We use the Spline version of the CurveFitting command to build a function from the histogram points.
Then we apply the function to the image and plot the histogram for both the distorted image and the equalized image.
Execute the command below to view the altered image.
|
Click the button above to see the effect of the histogram equalization.
|
|
|