Department of Mechatronics Engineering: Experiment No.: 02 Experiment Name

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Department of Mechatronics Engineering

Rajshahi University of Engineering & Technology


Course No.: MTE 4104
Course Title: Digital image processing & Machine vision sessional

Experiment No.: 02
Experiment Name: Study of Histogram, Histogram Equalization, Image
Thresholding and Image Enhancement.

Submitted to
Md. Hafiz Ahmed
Lecturer
Department of Mechatronics Engineering
Rajshahi University of Engineering & Technology

Submitted by
Md.Naimur Asif Borno
1808009
Department of Mechatronics Engineering
Rajshahi University of Engineering & Technology
Experiment No:02
Experiment Name: Study of Histogram, Histogram Equalization, Image Thresholding, and
Image Enhancement.
Objective:
● To improve image processing skills.
● To comprehend the histogram.
● To carry out histogram equalization.
● To comprehend the enhancement and thresholding of images.
Introduction:
Image processing is the analysis, manipulation, and transformation of digital images using
mathematical algorithms and computer programming. It is used to enhance image quality, extract
useful information from them, and generate new images from old ones. Image processing can help
with medical imaging, security, surveillance, robotics, remote sensing, and other applications.

An image histogram is a graphical representation of the distribution of pixel values in an image in


image processing. For grayscale images, the histogram plots the number of pixels with a specific
intensity value, which typically ranges from 0 (black) to 255 (white).

The idea behind an image histogram is that the visual information in an image is contained in the
intensity values of its pixels. We can learn important information about the image by analyzing the
distribution of these intensity values, such as contrast, brightness, and overall tonality. The histogram
is created by counting the number of pixels in the image that have each intensity value and graphing
these values. e horizontal axis of the histogram represents the intensity values, while the vertical axis
represents the number of pixels with that intensity value.

Histogram equalization is an image processing technique that adjusts an image's contrast by


redistributing the image's pixel values so that they are more uniformly distributed across the available
range of intensities. The method is known as equalization because it seeks to make the image's
histogram more uniform or equal across the available range of intensities. Histogram equalization can
be useful for increasing the contrast of low-contrast images or highlighting specific features in an
image. It can also result in the amplification of noise in the image and may not always produce the
desired results.

Image thresholding is a fundamental image processing technique that uses pixel intensities to separate
the foreground and background regions of an image. The technique compares each pixel value in the
image to a threshold value, which is a predefined value that distinguishes between the foreground and
background. Image thresholding theory is based on the fact that the intensity values of pixels in an
image can be used to differentiate different regions of the image. In thresholding, every pixel of an
image is compared with a threshold value, and depending on whether the pixel value is above or
below the threshold, the pixel is classified as belonging to the foreground or the background.

Reading, converting into RGB, and Plotting Images:


Code:

Output:

\
Fig: Reading, converting into RGB, and Plotting Images
Converting an image into grayscale:
Code:

Output:

Fig: grayscale image.


Histogram:
Code:
Output:

Fig: Histogram
Thresholding Operation:
Code:
Output:

Fig: Image thresholding operation

Discussion and Conclusion:


The importance of incorporating image-processing technology into daily life cannot be overstated.
Image processing methods of various types are used to improve images for human interpretation and
information extraction. This experiment provided me with a clear picture of image processing
technology. Overall, image processing was performed perfectly in Python.

You might also like