Question

Matlab
Type in good notes on this for an exam(Include code where needed)

21 6. understand histogram equalization: 22 understand how to compute it 23 4 7. understand morphological image processing: 5

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Histogram equalization

The process of adjusting intensity values can be done automatically using histogram equalization. Histogram equalization involves transforming the intensity values so that the histogram of the output image approximately matches a specified histogram. By default, the histogram equalization function, histeq, tries to match a flat histogram with 64 bins, but you can specify a different histogram instead.

Notice how this curve reflects the histograms in the previous figure, with the input values mostly between 0.3 and 0.6, while the output values are distributed evenly between 0 and 1.

Adjust Intensity Values Using Histogram Equalization

This example shows how to use histogram equalization to adjust the contrast of a grayscale image. The original image has low contrast, with most pixel values in the middle of the intensity range. histeq produces an output image with pixel values evenly distributed throughout the range.

Read an image into the workspace.

I = imread('pout.tif');

Display the image and its histogram.

figure
subplot(1,2,1)
imshow(I)
subplot(1,2,2)
imhist(I,64)

Adjust the contrast using histogram equalization. In this example, the histogram equalization function, histeq, tries to match a flat histogram with 64 bins, which is the default behavior. You can specify a different histogram instead.

J = histeq(I);

Display the contrast-adjusted image and its new histogram.

figure
subplot(1,2,1)
imshow(J)
subplot(1,2,2)
imhist(J,64)

5000 4000 3000 2000 1000 50 100 150 200 250

Plot Transformation Curve for Histogram Equalization

This example shows how to plot the transformation curve for histogram equalization. histeq can return a 1-by-256 vector that shows, for each possible input value, the resulting output value. (The values in this vector are in the range [0,1], regardless of the class of the input image.) You can plot this data to get the transformation curve.

Read image into the workspace.

I = imread('pout.tif');

Adjust the contrast using histogram equalization, using the histeq function. Specify the gray scale transformation return value, T, which is a vector that maps graylevels in the intensity image I to gray levels in J.

[J,T] = histeq(I);

Plot the transformation curve. Notice how this curve reflects the histograms in the previous figure, with the input values mostly between 0.3 and 0.6, while the output values are distributed evenly between 0 and 1.

figure
plot((0:255)/255,T);

0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Add a comment
Know the answer?
Add Answer to:
Matlab Type in good notes on this for an exam(Include code where needed) 21 6. understand...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT