Image Processing Cold0goat
Image Processing Cold0goat
Faculty of Engineering
Department of Electrical and Electronic Engineering
Spring 2025
EE461-LAB
Date: 22nd/6/2025
Instructor: DR. SALAH SAWAN
Abstract:
This experiment focused on the application of MATLAB for digital image processing,
emphasizing the matrix-based representation and manipulation of images. The core of the
experiment involved exploring four primary image types: binary, grayscale, indexed, and RGB.
Standard image processing commands were utilized for reading, displaying, and converting
images between these types. Furthermore, the experiment involved introducing various
common noise types (salt & pepper, Gaussian, speckle, and Poisson) into images to analyze
their effects. Subsequently, noise removal techniques, including median, Gaussian, and
Wiener filters, were implemented and evaluated for their effectiveness in restoring the
corrupted images. The results showcase MATLAB's practical utility in handling and processing
digital images, underscoring the fundamental relationship between image representation and
manipulation techniques.
Introduction:
In the field of digital image processing, images are fundamentally represented as numerical
matrices, where each element corresponds to a pixel. The visual characteristics of an image,
such as its brightness, color, and structure, are defined by the arrangement and values of these
pixels. The specific structure of this matrix representation is dependent on the image type. This
experiment delves into these concepts, using MATLAB's extensive capabilities to perform a
range of image processing tasks. The primary goals included understanding how images are
represented as matrices, exploring different image and noise types, and applying filters to
restore image quality. This provides a foundational understanding of real-world image
processing applications.
Objectives:
• To grasp how images are represented as matrices and what that means for processing
them.
• To investigate different image formats, such as binary, grayscale, indexed, and RGB, and
how they can be converted.
• To analyse the impact of adding noise to images and assess various filtering methods for
image restoration.
• To become proficient in using MATLAB's image processing tools for real-world scenarios.
Theory:
➢ Image types
1. Binary Image: A binary image is composed of pixels with only two possible values, 0
(black) and 1 (white). Its matrix representation is a logical array of 0s and 1s. These
images are commonly used for tasks like segmentation and thresholding.
2. Grayscale Image: This image type represents shades of gray, with pixel values typically
ranging from 0 (black) to 255 (white) in an 8-bit format. It is represented by a matrix of
intensity values.
4. Indexed Image: An indexed image consists of a data matrix of integer values and a
colormap. The integers in the data matrix serve as indices to the colormap, which is a
matrix where each row is an RGB triplet defining a specific color.
➢ Noise types
Noise in digital images refers to unwanted variations in pixel values.
1. Salt & Pepper Noise: Appears as randomly scattered black and white pixels, often
caused by data transmission errors.
4. Poisson Noise: Also known as photon shot noise, it arises from statistical fluctuations
in the number of photons detected, especially in low-light conditions.
1. Median Filter: Replaces each pixel's value with the median value of its neighboring
pixels. It is highly effective at removing salt & pepper noise while preserving edges.
2. Gaussian Filter: Applies a weighted average to pixel neighborhoods, with weights
determined by a Gaussian distribution. It is effective for reducing Gaussian noise but
can cause slight blurring.
3. Wiener Filter: A more advanced filter that minimizes mean squared error by
considering local image statistics, making it effective for both Gaussian and speckle
noise.
Equipment:
1. Personal Computer with MATLAB R2023b installed.
3. Image enhancement.
5. Segmentation
9. Saving results.
➢ Mathematical operations
• Addition & Subtraction
Discussion:
The experimental results confirmed the fundamental principle that digital images
are represented and manipulated as matrices in MATLAB. The direct application
of matrix operations yielded predictable and tangible visual changes, establishing
a clear link between numerical data and image characteristics. For instance, the
addition or subtraction of a scalar value to an image matrix resulted in a uniform
increase or decrease in overall image brightness, respectively. This illustrates how
pixel-level manipulations directly impact the final visual output.
The exploration of binary, grayscale, and RGB image types highlighted their unique
matrix structures and the corresponding implications for processing. The
experiment demonstrated that handling a multi-channel RGB image, for example,
requires operations to be applied across three separate data matrices, one for
each color channel.
A critical part of the experiment was the simulation of real-world image corruption
through the introduction of various noise types. Each noise exhibited distinct
visual characteristics. Salt & pepper noise appeared as stark, isolated black and
white pixels scattered across the image, while Gaussian noise produced a more
uniform, grainy texture that affected the entire image. This step was crucial for
setting a baseline to evaluate the effectiveness of different noise removal
techniques.
Conclusion:
In conclusion, this experiment effectively demonstrated the practical application
of MATLAB for foundational image processing tasks. Key concepts such as image
representation in matrices, conversions between binary, grayscale, and RGB
formats, and the effects of various noise types were successfully explored. The
results confirmed that specific filtering techniques are required to effectively
restore corrupted images, validating the use of the median filter for salt & pepper
noise and the Gaussian and Wiener filters for other noise types. Overall, the
experiment validated MATLAB's robust capabilities for handling diverse image
processing challenges and provided essential, hands-on insights into the practical
relationship between image theory and its application.
References:
1. Lab sheet.