0% found this document useful (0 votes)
4 views8 pages

Image Histogram Techniques in MATLAB

The document provides an overview of image processing techniques using MATLAB, specifically focusing on image histograms, histogram equalization, and histogram matching. It includes code snippets for reading, displaying, and processing images, demonstrating how to enhance image quality and match histograms between images. Key examples include histogram equalization for both grayscale and color images, as well as a method for histogram matching.

Uploaded by

ayhamjahgh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views8 pages

Image Histogram Techniques in MATLAB

The document provides an overview of image processing techniques using MATLAB, specifically focusing on image histograms, histogram equalization, and histogram matching. It includes code snippets for reading, displaying, and processing images, demonstrating how to enhance image quality and match histograms between images. Key examples include histogram equalization for both grayscale and color images, as well as a method for histogram matching.

Uploaded by

ayhamjahgh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Table of Contents

image histogram ................................................................................................................................. 1


histogram Equalisation ......................................................................................................................... 2
histogram Equalisation for color image ................................................................................................... 4
histogram matching ............................................................................................................................. 6

image histogram
im = imread('[Link]');
figure,imshow(im)
figure,imhist(im)

1
histogram Equalisation
eq_im = histeq(im);
figure,imshow(eq_im)
figure,imhist(eq_im)

2
3
histogram Equalisation for color image
I = imread('office_2.jpg');
figure,imshow(I)
figure,imhist(I)
eq_im = histeq(I);
figure,imshow(eq_im)
figure,imhist(eq_im)

4
5
histogram matching
ref = imread('office_2.jpg');
I = imread('office_4.jpg');
montage({I,ref})
title('Input Image (Left) vs Reference Image (Right)');
B = imhistmatch(I,ref);
figure,imshow(B)

6
7
Published with MATLAB® R2022a

Common questions

Powered by AI

Histogram equalization is crucial in medical imaging, such as enhancing X-ray images, where clear visualization of patient anatomy is vital for accurate diagnosis. By equalizing these images, enhanced contrast allows better differentiation of tissue types and structures, aiding in identifying abnormalities or conditions.

Histogram matching, also known as histogram specification, aims to transform the histogram of an input image to match the histogram of a reference image. It is implemented by first reading both input and reference images, then using a function like 'imhistmatch' to match their histograms, resulting in an output where the distribution of pixel intensities of the input resembles that of the reference.

The effectiveness of histogram equalization is determined by the initial intensity distribution of the image, the desired level of contrast enhancement, and the presence of noise. If the original histogram already contains significant contrast, equalization may lead to over-amplification of noise or artifacts. It's most effective when the initial distribution is concentrated around similar intensities.

Applying histogram equalization on images with wide intensity ranges can result in undesirable artifacts such as increased noise and graininess. This occurs because equalization spreads out intensity values over the entire range, potentially exaggerating minor tones into visible noise. This technique can also reduce the subtlety of gradients by disproportionally emphasizing certain ranges.

The function 'imhist' is used to calculate and display the histogram of an image, which provides a visual representation of the distribution of pixel intensities. This is crucial for analyzing the image's contrast and brightness distributions, facilitating further processes like enhancement or matching. It involves calling 'imhist' after reading an image, helping visualize these intensity distributions.

Histogram matching is preferred over equalization when a specific appearance is desired, as it enables matching the intensity distribution of the input image to a reference image, ensuring consistency in visual qualities like exposure and contrast. This technique is essential in applications requiring standardization or particular color tones across images, unlike equalization which merely enhances contrast.

When applying histogram equalization to color images, it generally involves more complexity compared to grayscale images. In color images, each channel (e.g., RGB) can undergo equalization separately or the luminance channel can be equalized in color spaces like YCbCr to maintain color balance while enhancing contrast. The procedure involves reading the image, equalizing using 'histeq', and then displaying the equalized result.

Yes, histogram matching can alter the artistic quality by changing the tonal and color balance to mimic the reference image, potentially shifting the mood or emphasis of an image. This technique can either enhance or detract from the image's original artistic intention, depending on the choice of reference histogram and context.

Histogram equalization is a technique for adjusting image intensities to enhance contrast. It involves spreading out the most frequent intensity values in an image. For grayscale images, the process is applied by reading the image using a function such as 'imread', displaying it using 'imshow', and then utilizing 'histeq' to perform the equalization which adjusts pixel intensity distribution.

MATLAB's 'histeq' function simplifies histogram equalization by automatically redistributing pixel intensities, enhancing image contrast efficiently. After reading an image, applying 'histeq' equalizes the intensity values with minimal manual intervention, making it a streamlined tool for adjusting contrast automatically.

You might also like