Oİ
Digital Image Processing
“One picture is wodh more than ten
thousand words”
Anonymous
Oİ
References
“Digital Image Processing”, Rafael C.
Gonzalez & Richard E. Woods,
Addison-Wesley, 2002
— Much of the material that follows is taken from
this book
, “Machine Vision: Automated Visual
„ Inspection and Robot Vision”, David
*“” Vernon, Prentice Hall, 1991
—Available online at:
homeoaoes.inf.ed.ac.uk/rbf/BOOKS/VERNON/
A digital image is a representation of a two-
dimensional image as a finite set of digital
values, called picture elements or pixels
Common image formats include:
—1 sample per point (B&W or Grayscale)
—3 samples per point (Red, Green, and Blue)
—4 samples per point (Red, Green, Blue, and “Alpha",
a.k.a. Opacity)
For most of this course we will focus on grey-scale
images
7
Oİ
What is Digital Image Processing*
Digital image processing focuses on two
major tasks
—Improvement of pictorial information for
human interpretation
— Processing of image data for storage,
transmission and representation for
autonomous machine perception
Some argument about where image
processing ends and fields such as image
analysis and computer vision start
9
O!
36
History of Digital Image Processing
Early 1920s: One of the first applications of
digital imaging was in the news-
paper industry
—The Bartlane cable picture
transmission service Early digital image
— Images were transferred by submarine cable
between London and New York
—Pictures were coded for cable transfer and
reconstructed at the receiving end on a
telegraph printer
Oİ
History of DIP (cont...)
1980s - Today: The use of digital image
processing techniques has exploded and
they are now used for all kinds of tasks in all
kinds of areas
—Image enhancemenLrestoration
—Artistic effects
—Medical visualisation
—Industrial inspection
—Law enforcement
—Human computer interfaces
One of the most common uses of DIP
techniques: improve quality, remove noise
etc
Launched in 1990 the Hubble
telescope can take images of
very distant objects
However, an incorrect mirror
made many of Hubble's
images useless
Image processing
techniques were
used to fix this
17
O!
36
Examples: Medicine
Take slice from MRI scan of canine heart,
and find boundaries between types of tissue
— Image with gray levels representing tissue
density
—Use a suitable filter to highlight edges
Original MRI Image of a Dog Heart
Geographic Information Systems
— Digitalimage processing techniques are used
extensively to manipulate satellite imagery
— Terrain classification
— Meteorology
Night-Time Lights of
the World data set
— Global inventory of
human settlement
— Not hard to imagine
the kind of analysis
that might be done
using this data
Human operators are
expensive, slow and
unreliable
Make machines do the
job instead
Industrial vision systems
are used in all kinds of
industries
Can we trust them?
Printed Circuit Board inspection
— Machine inspection is used to determine that
all components are present and that all solder
joints are acceptable
— Both conventional imaging and x-ray imaging
Image processing
techniques are used
extensively by law
enforcers
— Number plate
recognition for speed
cameras/automated
toll systems
— Fingerprint
recognition
— Enhancement of
CCTV images
Try to make human computer
interfaces more natural
—Face recognition
—Gesture recognition
Does anyone remember the
user interface from “Minority
Report”?
These tasks can be
extremely difficult
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Step-1
Object
Recognition
Representation
Problem Domain
& Description
Colour Image i Image
Processing I Compression
Image Acquisition
• In image processing, it is defined as the
action of retrieving an image from some
source, usually a hardware-based source for
processing.
• It is the first step in the workflow sequence
because, without an image, no processing is
possible.
• The image that is acquired is completely
unprocessed.
Image Acquisition
• In this step we get the image in digital form. This is done
using sensing materials like sensor strips and sensor
arrays and electromagnetic wave light source.
• The light source falls on an object and it gets reflected
or transmitted which gets captured by the sensing
material.
• The sensor gives the output image in voltage waveform
in response to electric power being supplied to it.
• The example of a situation where reflected light is
captured is a visible light source. Whereas, in X-ray light
sources transmitted light rays are captured.
• The incoming energy is transformed into a voltage by the
combination of input electrical power and sensor material
that is responsive to a particular type of energy being
detected.
• The output voltage waveform is the response of the
sensor(s) and a digital quantity is obtained from each
sensor by digitizing its response.
Fig: Single image sensor
This is an inexpensive
method and we can
obtain high-resolution
images with high
precision control.
However, the downside
of this method is that it is
slow.
Advantage: Since sensor array is 2D, a complete image can be obtained by focusing
the energy pattern onto the surface of the array.
• The image captured is the analog image as the output is continuous.
• To digitize the image, we use sampling and quantization where discretize
the image.
• Sampling is discretizing the image spatial coordinates whereas
quantization is discretizing the image amplitude values.
Image Morphological
Restoration Processing
Step-2
Segmentation
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image i Image
Processing Compression
2. Image Enhancement
Image Enhancement (cont.)
Examples of Image Enhancement
• Image enhancement is the
manipulation of an image
for its specific purpose and
objectives.
• This is majorly used in
photo beautification
applications.
• These are performed using
filters.
• The filters are used to
minimize noise in an image.
• Each filter is used for a
specific situation.
• Correlation operation is
done between filters and
input image matrix to
obtain enhanced output
image in.
More examples of Image Enhancement
Step-3
Morphological
Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image ‹ Image
Processing Compression
Aspect Image Enhancement Image Restoration
Improve visual quality Reconstruct the
Goal
for viewers. original image.
Subjective appearance Objective correction
Focus
improvement. of degradations.
Knowledge of Required (e.g., blur
Not required.
Degradation kernel, noise model).
Mathematical and
Simple filters and
Techniques Used model-based
transformations.
methods.
Brightening a dark Removing motion blur
Example
photo. from a photo.
• This step deals with improving the appearance of an image and is an
objective operation since the degradation of an image can be attributed to a
mathematical or probabilistic model.
• For example, removing noise or blur from images.
Step-4
Image
Restoration
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image ‹ Image
Processing Compression
4. Morphological Processing
• The word ‘Morphology’ generally represents a branch of
biology that deals with the form and structure of animals and
plants.
• However, we use the same term in ‘mathematical
morphology’ to extract image components useful in
representing region shape, boundaries, etc.
• How it works
➢ Structuring element: A set of pixels that is applied to an image
to perform a morphological operation
➢ Input and output images: The input and output images are the
same size
➢ Pixel values: The value of a pixel in the output image is based
on a comparison of the corresponding pixel in the input image
with its neighbors
Morphological Processing (cont.)
• Basic operations in Morphological Processing:
1. Dilation: Adds pixels to the boundaries of objects, making
them appear larger
2. Erosion: Removes pixels from the boundaries of objects,
making them smaller
3. Opening: A combination of erosion followed by dilation,
which removes small objects or noise
4. Closing: A combination of dilation followed by erosion,
which fills in small holes and connects close boundaries
5. Gradient: The difference between dilation and erosion,
which highlights object boundaries
• Applications pattern recognition, image segmentation, feature
extraction, noise reduction, and image enhancement.
Image Morphological
Restoration Processing
Step-5
Image
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image i Image
Processing Compression
5. Image Segmentation
• Image segmentation is a fundamental technique in digital image
processing and computer vision.
• It involves partitioning a digital image into multiple segments (regions or
objects) to simplify and analyze an image by separating it into meaningful
components, Which makes the image processing more efficient by
focusing on specific regions of interest.
A typical image segmentation task goes through the following steps:
1. Groups pixels in an image based on shared characteristics like colour,
intensity, or texture.
2. Assigns a label to each pixel, indicating its belonging to a specific
segment or object.
3. The resulting output is a segmented image, often visualized as a mask or
overlay highlighting the different segments.
Why do we need Image Segmentation?
• Image segmentation is crucial in computer vision tasks
because it breaks down complex images into
manageable pieces.
• It's like separating ingredients in a dish.
• By isolating objects (things) and backgrounds (stuff),
image analysis becomes more efficient and accurate.
• This is essential for tasks like self-driving cars
identifying objects or medical imaging analyzing
tumours.
• Understanding the image's content at this granular
level unlocks a wider range of applications in
computer vision.
Aspect Image Classification Object Detection Image Segmentation
Assign a label or category Identifies and locates Divide the image into
Purpose to the whole image multiple objects meaningful regions
Bounding boxes around Pixel-wise segmentation
Output Single label or category
detected objects masks
High-level classification of Detection of objects with Detailed segmentation of
Focus the entire image localization objects and background
Typically, more complex
Complexity Simpler and faster Moderate complexity and computationally
intensive
Image search, content Self-driving cars, facial Medical imaging,
Applications filtering recognition autonomous robots
Cars & pedestrians in a Separating tumor from
Examples "Cat" for a picture of a cat
traffic scene healthy tissue in an X-ray
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Step-6
Image
Acquisition
Representation
Problem Domain
& Description
Colour Image ‹ Image
Processing Compression
6. Feature extraction for Object Detection
• Feature extraction is a critical step in image
processing and computer vision, involving the
identification and representation of distinctive
structures within an image.
• This process transforms raw image data into
numerical features that can be processed while
preserving the essential information.
• These features are vital for various downstream
tasks such as object detection, classification, and
image matching.
.
31 Key ln Digital mage Processing
36 Description
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Step-7
Problem Domain
Colour Image ‹ Image
Processing Compression
7. Image Representation and Description
• In digital image processing, "image representation
and description" refers to the process of converting a
raw image into a structured format that computers can
analyze and interpret, by extracting meaningful
features and describing the characteristics of an
image, like its shape, color, texture, and other visual
elements, to enable further processing and analysis
like object recognition or image
segmentation; essentially, it's about translating visual
data into a format suitable for computer
manipulation.
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain
& Description
Colour Image • I
Processing
Step-8
8. What is image compression?
• Image compression is a process that makes image
files smaller.
• Image compression most often works either by
removing bytes of information from the image, or
by using an image compression algorithm to
rewrite the image file in a way that takes up less
storage space.
• Compressing an image is an effective way to
ensure that the image loads quickly when a user
interacts with a website or application.
• It is an important part of image optimization.
Lossy image compression retains the
most significant information for the
image without keeping every single
pixel.
A "lossless" image compression uses
mathematical algorithms to rewrite
an image file without removing any
information.
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Object
Acquisition Recognition
Representation
Problem Domain Step-9 & Description
Image
Compression
9. Color image processing
• Color image processing is an area that has been
gaining in importance because of the significant
increase in the use of digital images over the internet.
• Color image processing is the process of manipulating
and enhancing images that contain visible light data.
• It involves using mathematical systems to represent
colors as numerical values.
Color models
➢ RGB: An additive color model that uses red, green, and blue light to create
colors. Each pixel in an RGB image is defined by the amount of red, green,
and blue in it.
➢ HIS: A color model that uses hue, saturation, and intensity to represent
colors. HSI is popular with artists because it represents colors similarly to
how the human eye sees them.
➢ CMYK: A color model that uses cyan, magenta, yellow, and black to
represent colors.
Color image processing techniques
➢ Histogram equalization: A technique used to improve image quality
➢ Color space conversion: A technique used to improve image quality and
maintain data correlation
➢ Pseudo-color processing: A technique that maps grayscale levels in a black
and white image to colors
➢ Color image processing applications Improving image quality, Making it
easier to identify features in an image, and Converting color images to
monochrome images.
Components of Digital Image
Processing System
Components of Digital Image Processing System