CHAPTER – 1
Digital Image Fundamentals
1
“One picture is worth more than ten
thousand words”
Anonymous
2
CONTENTS
Image Fundamentals
A simple image model
Fundamental steps in DIP
Elements of visual perception
Image sensing and acquisition
Image Sampling and quantization
Basic relationship between pixels
3
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
Images were transferred by Early digital image
submarine cable between London
and New York
Pictures were coded for cable
transfer and reconstructed at the
receiving end on a telegraph printer
7
HISTORY OF DIP (CONT…)
Mid to late 1920s: Improvements to the
Bartlane system resulted in higher quality
images
New reproduction
processes based
on photographic
techniques
Increased number Improved
of tones in digital image
reproduced images Early 15 tone digital image
8
HISTORY OF DIP (CONT…)
1960s: Improvements in computing
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 A picture of the moon
by the Ranger 7 probe taken by the Ranger 7
probe minutes before
Such techniques were used landing
in other space missions
including the Apollo landings
9
HISTORY OF DIP (CONT…)
1970s: Digital image
processing begins to 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
Typical head slice CAT image
Computerised Axial
Tomography (CAT) scans
11
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
10
WHAT IS AN IMAGE ? - THE VECTOR REPRESENTATION
Object-oriented representation
Does not show information of individual pixel,
but information of an object (circle, line, square,
etc.)
Circle (100, 20, 20)
Line (xa1, ya1, xa2, ya2)
Line (xb1, yb1, xb2, yb2)
Line (xc1, yc1, xc2, yc2)
Line (xd1, yd1, xd2, yd2)
9
COMPARISON
Bitmap Vector
Can represent images Can only represent
with complex simple line drawings
variations in colors, (CAD), shapes,
shades, shapes. shadings, etc.
Larger image size Efficient
Fixed resolution Flexible
Easier to implement Difficult to implement
10
WHAT IS AN IMAGE? - THE BITMAP REPRESENTATION
Also called “raster or pixel maps” representation
An image is broken up into a grid
y
Gray level
x
pixel
Original picture Digital image
f(x, y) I[i, j] or I[x, y] 1
1
WHAT IS A DIGITAL IMAGE?
A digital image is a representation of a two-
dimensional image as a finite set of digital values,
called picture elements or pixels
12
WHAT IS A DIGITAL IMAGE CONTD..
Pixel values typically represent gray levels, colours,
heights, opacities etc
Remember digitization implies that a digital image is an
approximation of a real scene
1 pixel
13
WHAT IS A DIGITAL IMAGE CONTD..
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 14
WHAT IS A 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.
The continuum from image processing to computer vision
can be broken up into low-, mid- and high-level processes.
15
Low Level Mid Level High Level
Process Process Process
Input: Image Input: Image Input: Attributes
Output: Image Output: Attributes Output:
Understanding
Examples: Noise Examples: Object
removal, image recognition, Examples: Scene
sharpening segmentation understanding,
autonomous
navigation
16
WHY IMAGE PROCESSING?
Application
Fingerprint retrieval
Automatic target recognition
Industrial inspection
Medical imaging
and more …
Can commercial software do all the work?
17
A SIMPLE IMAGE MODEL
Image: a two-dimensional light-intensity function;
f(x, y) = i(x, y) r(x, y)
where,
illumination 0 < i(x, y) < ∞,
reflectance components 0 < r(x, y) < 1
- illumination: the amount of source light incident
on the scene being viewed
- reflectance: the amount of light reflected by the
objects in the scene
The interval [Lmin, Lmax]
: called the gray scale → [0, L]
18
EXAMPLES SHOWING THAT PERCEIVED BRIGHTNESS IS
NOT A SIMPLE FUNCTION OF INTENSITY.
19
EXAMPLE OF SIMULTANEOUS CONTRAST
: ALL THE SMALL SQUARES HAVE EXACTLY THE SAME INTENSITY, BUT THEY
APPEAR PROGRESSIVELY DARKER AS THE BACKGROUND BECOMES LIGHTER.
20
EXAMPLES: IMAGE ENHANCEMENT
One of the most common uses of DIP techniques: improve
quality, remove noise etc..
21
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.
22
EXAMPLES: ARTISTIC EFFECTS
Artistic effects are used
to make images more
visually appealing, to
add special effects and
to make composite
images.
23
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
Edge Detection Image 24
Original MRI Image of a Dog Heart
EXAMPLES: GIS
Geographic Information Systems
Digital image processing techniques are used extensively
to manipulate satellite imagery
Terrain classification
Meteorology
25
EXAMPLES: GIS (CONT…)
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
26
EXAMPLES: INDUSTRIAL INSPECTION
• 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?
27
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
28
EXAMPLES: LAW ENFORCEMENT
Image processing techniques
are used extensively by law
enforcers
Number plate
recognition for speed
cameras/automated toll
systems
Fingerprint recognition
Enhancement of CCTV
images
29
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
30
Original image of
Histogram Equalization Photoshop “Auto Contrast”
Mars and its moon Photoshop
APDG = 42.1 TEN = 12.1 APDG = 28.4 TEN = 22.0 result APDG = 72.9 TEN = 20.8
31
GLG in RGB space
GLG-RGB
APDG = 76.3 TEN = 27.0 GLG-HSI
APDG = 78.6 TEN = 26.6
From Zhiyu Chen’s preliminary proposal defense, January 2009
GOALS OF IMAGE PROCESSING
Image improvement
Improving the visual appearance of images to a
human viewer
Image analysis
Preparing images for measurement of the features
and structures present
32
WHAT TO LEARN?
Preprocessing – low level High-level IP
Image Improvement Image Analysis
Image Image
Enhancement Restoration Image
Segmentation
Image Image Image
Acquisition Compression Coding Representation
& Description
Morphological Wavelet Recognition &
Image Processing Analysis Interpretation
Knowledge Base 33
FUNDAMENTAL STEPS IN DIGITAL IMAGE PROCESSING
Morphologi
Image
cal
Restoration
Processing
Image Segmentati
Enhancement on
Image Object
Acquisition Recognition
Problem Domain Representation
& Description
Colour Image Image 34
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
IMAGE AQUISITION
Morphologic
Image
al
Restoration
Processing
Image Segmentati
Enhancement on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 35
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
IMAGE ENHANCEMENT
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image 36
Image Compression
Processing
KEY STAGES IN DIGITAL IMAGE PROCESSING:
IMAGE RESTORATION
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 37
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
MORPHOLOGICAL PROCESSING
Image Morphological
Restoration Processing
Image Segmentati
Enhancement on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 38
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
SEGMENTATION
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 39
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
OBJECT RECOGNITION
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 40
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
REPRESENTATION & DESCRIPTION
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 41
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
IMAGE COMPRESSION
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 42
Processing Compression
KEY STAGES IN DIGITAL IMAGE PROCESSING:
COLOUR IMAGE PROCESSING
Image Morphological
Restoration Processing
Image
Enhanceme Segmentati
nt on
Image Object
Acquisition Recognition
Representation
Problem Domain & Description
Colour Image Image 43
Processing Compression
IMAGE ACQUISITION
Video camera
Infrared camera
Range camera
Line-scan camera
Hyper spectral camera
Omni-directional camera
and more …
44
ELEMENTS OF VISUAL PERCEPTION
Digital Image Processing is built on foundation of
Mathematical and Probabilistic formulations
Human Intuition & analysis plays a key role in
choosing new technique over other.
Study of Human vision system is thus important.
45
STRUCTURE OF HUMAN EYE
46
ROD & CONE CELLS
47
DISTRIBUTION OF ROD & CONE CELLS
48
IMAGE SENSING AND ACQUISITION
Three principal sensor arrangement:
1) Image acquisition using a single sensor
49
IMAGE SENSING AND ACQUISITION
Image Acquisition using a single sensor:
50
IMAGE SENSING AND ACQUISITION
2) Image Acquisition using sensor strips:
51
IMAGE SENSING AND ACQUISITION
3) Image Acquisition using sensor arrays:
52
IMAGE SENSING AND ACQUISITION
53
IMAGE SENSING AND ACQUISITION
54
IMAGE SENSING AND ACQUISITION
Simple Image formation model:
o Images are denoted by 2-dimensional function of the form f( x, y).
o f at spatial co-ordinates ( x, y) is positive, finite scalar quantity
determined by source of the image.
0 < f( x, y) < ∞
o f( x, y) is characterized by two components:
o illumination: amount of source illumination incident on scene.
denoted by i( x, y)
o reflectance : amount of illumination reflected by the objects in
scene. denoted by r( x, y)
Thus, f(x,y) = i(x,y) r(x,y) where, 0 < i(x,y) < ∞ …... (1)
& 0(total absorption)< r( x, y) < 1(total reflectance) …… (2)
55
IMAGE SENSING AND ACQUISITION
Simple Image formation model:
o Let the gray level (intensity) of a monochromatic image at any co-
ordinate be denoted by:
l = f(x0, y0);
From equation (1) & (2) we get
Lmin ≤ l ≤ Lmax
where, Lmin should be positive & Lmax be finite.
We have, Lmin = imin rmin & Lmax = imax rmax
The interval [Lmin, Lmax] is called the gray (intensity) scale.
We shift this interval to interval [0, L-1],
where, l = 0 is black & l = L-1 is white on grey scale. 56
IMAGE SAMPLING & QUANTIZATION
57
IMAGE SAMPLING & QUANTIZATION
58
SAMPLING & QUANTIZATION
f (x, y): digitized both spatially and in
amplitude
Digitization of the spatial coordinates (x, y)
called image sampling
Amplitude digitization
: called gray-level quantization
Resolution: the degree of discernible detail of
an image depends strongly on the number of
samples and gray-levels.
59
SCANNING & SAMPLING
Scanning
Progressive scan Interlaced scan
Sampling
60
Case of interlaced scan
Case of progressive scan
SAMPLING & QUANTIZATION
The more parameters (the number of samples and
gray levels) are increased, the closer the digitized
array approximates the original image.
The digitization process requires decisions about
values for N, M, and the number of discrete gray
levels allowed for each pixel.
N = 2n, M = 2k and G = 2m
b=NMm
where, G: the number of gray levels
b: the number of bits required to store a
digitized image.
61
EFFECTS ACCORDING TO SPATIAL RESOLUTION &
NUMBER OF BITS
Effects of reducing spatial resolution ; pixel
replication
produced a checkerboard effect
Effectsproduced by decreasing the number of bits
used to represent the number of gray levels in an
image.
A 10241024 image displayed in 256, 128, 64, 32,
16, 8, 4, and 2 levels, respectively.
62
EFFECT OF REDUCING SPATIAL RESOLUTION:
(A) 10241024, 256-LEVEL DIGITAL IMAGE OF A ROSE
(B)~(F) RESULTS OF REDUCING THE SPATIAL RESOLUTION FROM N=1024 TO
N=512, 256, 128, 64, AND 32, RESPECTIVELY.
63
EFFECT OF DECREASING THE NUMBER OF BITS:
(A) 10241024, 256-LEVEL DIGITAL IMAGE OF A ROSE
(B)~(F) RESULTS OF REDUCING THE NUMBER OF BITS FROM M=7 TO M=1,
RESPECTIVELY.
64
SAMPLING & QUANTIZATION (3)
Isopreference curve correspond to images of equal
subjective quality
- the quality of the images tends to increase as N
and m are increased.
- a decrease in m generally increases the
apparent contrast of an image.
for images with a larger amount of detail only
a few gray levels are needed.
65
ISOPREFERENCE CURVES
66
SAMPLING & QUANTIZATION (4)
Non-uniform sampling and quantization
: depends on the characteristics of the image
- Fine sampling is required in the neighborhood of
sharp gray-level transitions, whereas coarse sampling
may be utilized in relatively smooth regions.
- When the number of gray levels must be kept small,
the use of unequally spaced levels in the quantization
process usually is desirable ( called tapered
quantization).
67
IMAGE SAMPLING & QUANTIZATION
Spatial & Intensity Resolution
Spatial Resolution:
dpi : (dots per inch)
Newspapers : 75 dpi
Magazines : 133 dpi
Glossy brochures : 175 dpi
Books : 2400dpi
68
IMAGE SAMPLING & QUANTIZATION
Intensity resolution: smallest discernible change in intensity level.
Image interpolation: process of using known data to estimate the
values at unknown locations.
Nearest neighbor interpolation: assigns intensity of nearest
neighbor in original image.
Bilinear interpolation: uses 4 nearest neighbors.
Bicubic interpolation: uses 16 nearest neighbors.
69
HIGH DEFINITION (HD)
Video Frame size in Pixels per
Scanning type Frame rate (Hz)
mode pixels (W×H) image
23.976, 24, 25, 29.97,
720p 1,280x720 921,600 Progressive
30, 50, 59.94, 60, 72
25 (50 fields/s), 29.97
1080i 1,920x1,080 1,036,800 Interlaced (59.94 fields/s), 30 (60
fields/s)
23.976, 24, 25, 29.97,
1080p 1,920x1,080 2,073,600 Progressive
30, 50, 59.94, 60
70
HIGH DEFINITION (HD)
72
BASIC RELATIONSHIPS BETWEEN PIXELS
• Neighborhood
• Adjacency
• Connectivity
• Paths
• Regions and boundaries
Neighbors of a Pixel
• Any pixel p(x, y) has two vertical and two horizontal neighbors, given by
(x+1, y), (x-1, y), (x, y+1), (x, y-1)
• This set of pixels are called the 4-neighbors of P, and is denoted by N4(P).
• Each of them are at a unit distance from P.
The four diagonal neighbors of p(x,y) are given by,
(x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1 ,y-1)
• This set is denoted by ND(P).
• Each of them are at Euclidean distance of 1.414 from P.
8-neighbors of a pixel p are its vertical horizontal and 4 diagonal neighbors denoted by73
N8(p)
ADJACENCY
Let V be set of gray levels values used to define adjacency.
• 4-adjacency: Two pixels p and q with values from V are 4-
adjacent if q is in the set N4(p).
• 8-adjacency: Two pixels p and q with values from V are 8-
adjacent if q is in the set N8(p).
• m-adjacency: Two pixels p and q with values from V are
madjacent
if,
– q is in N4(P).
– q is in ND(p) and the set [ ] is empty
(has no pixels whose values are from V).
74
CONNECTIVITY :
4-connected, if q is in the set N4(p)
b. 8-connected, if q is in the set N8(p)
c. m-connected, if
i. q is in N4(p) or
ii. q is in ND(p) and the set
is empty
Paths & Path lengths
A path from pixel p with coordinates
(x, y) to pixel q with coordinates (s, t)
is a sequence of distinct pixels with
coordinates: (x0, y0), (x1, y1), (x2, y2) …
(xn, yn), Here n is the length of the
path. 75
DISTANCE MEASURES
Given pixels p, q and z with coordinates (x, y), (s, t), (u, v)
respectively, the distance function D has following properties:
a. D(p, q) ≥0 , [D(p, q) = 0, iff p = q]
b. D(p, q) = D(q, p)
c. D(p, z) ≤D(p, q) + D(q, z)
The following are the different Distance
measures:
a. Euclidean Distance :
De(p, q) = [(x-s)2 + (y-t)2]
b. City Block Distance:
D4(p, q) = |x-s| + |y-t|
c. Chess Board Distance:
D8(p, q) = max(|x-s|, |y-t|)
76
DISCUSSION (Q&A)
77