Professional Documents
Culture Documents
Department of Mechatronics Engineering: Experiment No.: 02 Experiment Name
Department of Mechatronics Engineering: Experiment No.: 02 Experiment Name
Department of Mechatronics Engineering: Experiment No.: 02 Experiment Name
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.
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.
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.
Output:
\
Fig: Reading, converting into RGB, and Plotting Images
Converting an image into grayscale:
Code:
Output:
Fig: Histogram
Thresholding Operation:
Code:
Output: