You are on page 1of 87

Digital Image Processing:

Introduction

Course Website: http://www.comp.dit.ie/bmacnamee


2
of
36
Introduction

“One picture is worth more than ten thousand


words”
Anonymous
3
of
36
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:
homepages.inf.ed.ac.uk/rbf/BOOKS/VERNON/
4
of
36
Contents
This lecture will cover:
– What is a digital image?
– What is digital image processing?
– History of digital image processing
– State of the art examples of digital image
processing
– Key stages in digital image processing
5
of
36
What is a Digital Image?
A digital image is a representation of a two-
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

dimensional image as a finite set of digital


values, called picture elements or pixels
6
of
36
What is a Digital Image? (cont…)
Pixel values typically represent gray levels,
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

colours, heights, opacities etc


Remember digitization implies that a digital
image is an approximation of a real scene

1 pixel
7
of
36
What is a Digital Image? (cont…)
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
8
of
36
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
of
36
What is DIP? (cont…)
The continuum from image processing to
computer vision can be broken up into low-,
mid- and high-level processes
Low Level Process Mid Level Process High Level Process
Input: Image Input: Image Input: Attributes
Output: Image Output: Attributes Output: Understanding
Examples: Noise Examples: Object Examples: Scene
removal, image recognition, understanding,
sharpening segmentation autonomous navigation

In this course we will


stop here
10
of
36
History of Digital Image Processing
Early 1920s: One of the first applications of
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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
11
of
36
History of DIP (cont…)
Mid to late 1920s: Improvements to the
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Bartlane system resulted in higher quality


images
– New reproduction
processes based
on photographic
techniques
– Increased number
of tones in Improved
digital image Early 15 tone digital
reproduced images image
12
of
36
History of DIP (cont…)
1960s: Improvements in computing
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

technology and the onset of the space race


led to a surge of work in digital image
processing
– 1964: Computers used to
improve the quality of
images of the moon taken
by the Ranger 7 probe
– Such techniques were used
A picture of the moon taken
in other space missions by the Ranger 7 probe
including the Apollo landings minutes before landing
13
of
36
History of DIP (cont…)
1970s: Digital image processing begins to
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

be used in medical applications


– 1979: Sir Godfrey N.
Hounsfield & Prof. Allan M.
Cormack share the Nobel
Prize in medicine for the
invention of tomography,
the technology behind
Computerised Axial Typical head slice CAT
Tomography (CAT) scans image
14
of
36
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 enhancement/restoration
– Artistic effects
– Medical visualisation
– Industrial inspection
– Law enforcement
– Human computer interfaces
15
of
36
Examples: Image Enhancement
One of the most common uses of DIP
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

techniques: improve quality, remove noise


etc
16
of
36
Examples: The Hubble Telescope
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
of
36
Examples: Artistic Effects
Artistic effects are
used to make
images more
visually appealing,
to add special
effects and to make
composite images
18
of
36
Examples: Medicine
Take slice from MRI scan of canine heart,
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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 Edge Detection Image


19
of
36
Examples: GIS
Geographic Information Systems
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

– Digital image processing techniques are used


extensively to manipulate satellite imagery
– Terrain classification
– Meteorology
20
of
36
Examples: GIS (cont…)
Night-Time Lights of
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

the World data set


– Global inventory of
human settlement
– Not hard to imagine
the kind of analysis
that might be done
using this data
21
of
36
Examples: Industrial Inspection
Human operators are
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

expensive, slow and


unreliable
Make machines do the
job instead
Industrial vision systems

are used in all kinds of


industries
Can we trust them?
22
of
36
Examples: PCB Inspection
Printed Circuit Board (PCB) 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
are used
23
of
36
Examples: Law Enforcement
Image processing
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

techniques are used


extensively by law
enforcers
– Number plate
recognition for speed
cameras/automated
toll systems
– Fingerprint recognition
– Enhancement of
CCTV images
24
of
36
Examples: HCI
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
25
of
36
Key Stages in Digital Image Processing

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
26
of
Key Stages in Digital Image Processing:
36 Image Aquisition
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
27
of
36
Image Acquisition
Imaging sensor & capability to digitize the
signal collected by the sensor

– Video camera
– Digital camera
– Conventional camera & analog-to-digital
converter
28
of
Key Stages in Digital Image Processing:
36 Image Enhancement
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
29
of
36
Enhancement (Preprocessing)
To improve the image to ensure the success
of further processes

e.g. enhancing contrast


removing noise
identifying information-rich areas
30
of
Key Stages in Digital Image Processing:
36 Image Restoration
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
31
of
36
Image Restoration
• To Improve the Appearance of an Image
32
of
Key Stages in Digital Image Processing:
36 Morphological Processing
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
33
of
36
Morphological Processing
• It is the tools for Extracting the Image
Components.
• It is useful in the representation and
Description of shape.
34
of
Key Stages in Digital Image Processing:
36 Segmentation
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
35
of
36
Segmentation
To partition the image into its constituent parts
(objects)

– Autonomous segmentation (very difficult)


• Can facilitate or disturb subsequent processes

– Output (representation):
• Raw pixel data, depicting either boundaries or whole regions
(corners vs. texture for example)
• Need conversion to a form suitable for computer processing

– (Description)
36
of
Key Stages in Digital Image Processing:
36 Object Recognition
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
37
of
36
Recognition & Interpretation
• To assign a label to an object based on
information provided by the descriptors

• To assign meaning to a group of


recognized objects
38
of
Key Stages in Digital Image Processing:
36 Representation & Description
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
39
of
36
Representation & Description
Feature selection (description) deals with
extracting:

– features that result in quantitative information


of interest
or

– features that are important for differentiating


one class of objects from another
40
of
Key Stages in Digital Image Processing:
36 Image Compression

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
41
of
36
Image Compression
• It is the technique for reducing the storage
required to save an Image
(or)
• reducing the bandwidth required to
transmit it.
42
of
Key Stages in Digital Image Processing:
36 Colour Image Processing

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
43
of Color Image Processing:
36

 Color is a powerful descriptor that often


simplifies object identification and extraction
from a scene.
• Human can discern thousands of color
shades and intensities, compared to about
only two dozen shades of gray.
44
of Components of Image Processing System
36
45
of
36

HUMAN VISUAL
PERCEPTION
46
of
36
Human Visual Perception
47
of
36
The Human Eye
Diameter of Human Eye: 20 mm

3 membranes enclose the eye


– Cornea & sclera
– Choroid
– Retina
48
of
36
The Choroid
• The choroid contains blood vessels for
eye nutrition and is heavily pigmented to
reduce extraneous light entrance and
backscatter.

• It is divided into the ciliary body and the


iris diaphragm, which controls the amount
of light that enters the pupil (2 mm ~ 8
mm).
49
of
36
The Lens
• The lens is made up of fibrous cells and is
suspended by fibers that attach it to the
ciliary body.

• It is slightly yellow and absorbs approx.


8% of the visible light spectrum.
50
of
36
The Retina
• The retina lines the entire posterior
portion.

• Discrete light receptors are distributed


over the surface of the retina:

– cones (6-7 million per eye) and


– rods (75-150 million per eye)
51
of
36
Cones
• Cones are located in the fovea and are
sensitive to color.

• Each one is connected to its own nerve


end.

• Cone vision is called photopic (or bright-


light vision).
52
of
36
Rods
• Rods are giving a general, overall picture
of the field of view and are not involved in
color vision.

• Several rods are connected to a single


nerve and are sensitive to low levels of
illumination (scotopic or dim-light vision).
53
of
36
Receptor Distribution
• The distribution of receptors is radially
symmetric about the fovea.

• Cones are most dense in the center of the


fovea while rods increase in density from
the center out to approximately 20% off
axis and then decrease.
54
of Cones & Rods
36
55
of
36
The Fovea
• The fovea is circular (1.5 mm in diameter)
but can be assumed to be a square
sensor array (1.5 mm x 1.5 mm).

• The density of cones: 150,000


elements/mm2 ~ 337,000 for the fovea.

• A CCD imaging chip of medium resolution


needs 5 mm x 5 mm for this number of
elements
56
of
36
Image Formation in the Eye
• The eye lens (if compared to an optical
lens) is flexible.

• It gets controlled by the fibers of the ciliary


body and to focus on distant objects it
gets flatter (and vice versa).
57
of
36
Image Formation in the Eye
• Distance between the center of the lens
and the retina (focal length):
– varies from 17 mm to 14 mm (refractive power
of lens goes from minimum to maximum).

• Objects farther than 3 m use minimum


refractive lens powers (and vice versa).
58
of
36
Image Formation in the Eye
Example: 15 x
=
– Calculation of retinal image of an object100 17
x = 2.55mm
59
of
36
Image Formation in the Eye
• Perception (Understanding of sensory
information) takes place by the relative
excitation of light receptors.

• These receptors transform radiant energy


into electrical impulses that are ultimately
decoded by the brain.
60
of
Brightness Adaptation &
36
Discrimination

• Range of light intensity levels to which


HVS (human visual system) can adapt: on
the order of 1010.

• Subjective brightness (i.e. intensity as


perceived by the HVS) is a logarithmic
function of the light intensity incident on
the eye.
61
of
Brightness Adaptation &
36
Discrimination

• The HVS cannot operate over such a


range simultaneously.

• For any given set of conditions, the current


sensitivity level of HVS is called the
brightness adaptation level.
62
of
Brightness Adaptation &
36
Discrimination

• The eye also discriminates between


changes in brightness at any specific
adaptation level.
∆I c
→ Weber ratio
I
Where: Ic: the increment of illumination
discriminable 50% of the time and
I : background illumination
63
of
Brightness Adaptation &
36
Discrimination

• Small values of Weber ratio mean good


brightness discrimination (and vice versa).

• At low levels of illumination brightness


discrimination is poor (rods) and it
improves significantly as background
illumination increases (cones).
64
of
Brightness Adaptation &
36
Discrimination

• The typical observer can discern one to


two dozen different intensity changes

– i.e. the number of different intensities a


person can see at any one point in a
monochrome image
65
of
Brightness Adaptation &
36
Discrimination

• Overall intensity discrimination is broad


due to different set of incremental changes
to be detected at each new adaptation
level.

• Perceived brightness is not a simple


function of intensity
– Scalloped effect, Mach band pattern
– Simultaneous contrast
66
of
Perceived Brightness
36
67
of Simultaneous Contrast
36
68
of Illusions
36
69
of
Brightness Adaptation &
36
Discrimination

• Overall intensity discrimination is broad


due to different set of incremental changes
to be detected at each new adaptation
level.

• Perceived brightness is not a simple


function of intensity
– Scalloped effect, Mach band pattern
– Simultaneous contrast
3. Image Sampling & Quantization

• To create a digital image, we need to


convert continuous sensed data into
digital form.
• This involves two processes: sampling
and quantization
• The basic idea behind sampling and
quantization is illustrated in Fig. 3.1.

Course Website: http://www.comp.dit.ie/bmacnamee


71
of
36
Image Sampling & Quantization

• Figure 3.1(a) shows a continuous image, f


(x, y), that we want to convert to digital
form.
• To convert it to digital form, we have to
sample the function in both coordinates and
in amplitude.
• An image may be continuous with respect
to the x‑ and y‑ co ordinates and also in
amplitude.
72
of
36
Image Sampling & Quantization

• Digitizing the coordinate values is called


sampling.

• Digitizing the amplitude values is called


quantization.
73
of
36

Fig 3.1 Generating a digital image (a) Continuous image. (b) A scan line from
A to B in the continuous image. (c) Sampling & quantisation. (d) Digital scan
line.
74
of
36
Image Sampling & Quantization
• The one-dimensional function shown in Fig. 3.1(b)
is a plot of amplitude (gray level) values of the
continuous image along the line segment AB in
Fig. 3.1(a).
• To sample this function, we take equally spaced
samples along line AB, as shown in Fig. 3.1(c).
• Location of each sample is given by a vertical tick
mark in the bottom part of the figure.
75
of
36
Image Sampling & Quantization

• The samples are shown as small white


squares superimposed on the function.
The set of these discrete locations gives
the sampled function.
• However, the values of the samples still
span (vertically) a continuous range of
gray level values.
• In order to form a digital function, the gray
level values also must be converted
(quantized) into discrete quantities.
76
of
36
Image Sampling & Quantization
• The right side of Fig. 3.1(c) shows the
gray‑level scale divided into eight discrete
levels, ranging from black to white.
• The vertical tick marks indicate the specific
value assigned to each of eight gray levels.
• The continuous gray levels are quantized
simply by assigning one of the eight
discrete gray levels to each sample.
77
of
36
Image Sampling & Quantization
• The assignment is made depending on
the vertical proximity of a sample to a
vertical tick mark.
• The digital samples resulting from both
sampling and quantization are shown in
Fig. 3.1(d) and Fig 3.2 (b).
78
of
36

Fig. 3.2 (a) Continuous image projected onto a sensor array.


(b) Result of image sampling and quantisation
79
of
36
3.2 Representing Digital Images

• The result of sampling and quantization is a


matrix of real numbers as shown in Fig.3.3,
Fig.3.4. and Fig 3.5.
• The values of the coordinates at the origin
are
(x,y) = (0,0).
• The next coordinate values along the first
row are (x,y) = (0,1).
• The notation (0,1) is used to signify the 2nd
sample along the 1st row.
80
of
36

Fig. 3.3. Coordinate convention used to represent


digital images
81
of
36
3.2 Representing Digital Images

Fig. 3.4. A digital image of size M x N


82
of
36
3.2 Representing Digital Images
• It is advantageous to use a more
traditional matrix notation to denote a
digital image and its elements.

Fig. 3.5 A digital image


83
of
36
• The number of bits required to store a
digitised image is

• b=MxNxk
Where M & N are the number of rows and
columns, respectively.
• The number of gray levels is an integer
power of 2:
• L = 2k where k =1,2,…24
• It is common practice to refer to the image
as a “k-bit image”
84
of
36
3.2 Representing Digital Images
85
of
36
3.2 Representing Digital Images
• The spatial resolution of an image is the physical size
of a pixel in that image; i.e., the area in the scene that
is represented by a single pixel in that image.
• Dense sampling will produce a high resolution image
in which there are many pixels, each of which
represents of a small part of the scene.
• Coarse sampling, will produce a low resolution image
in which there are a few pixels, each of which
represents of a relatively large part of the scene.
86
of
36

Fig. 3.6 Effect of resolution on image interpretation (a) 8x8


image. (b) 32x32 image © 256x256 image
87
of
36

Fig.3.7 Effect of quantisation on image interpretation. (a) 4


levels. (b) 16 levels. (c) 256 levels

You might also like