0% found this document useful (0 votes)
70 views80 pages

Dip Unit 1

Digital image processing techniques are used to improve digital images, process them for different applications, and extract useful information from them. A digital image is a finite set of digital values that represent a two-dimensional image. Digital image processing focuses on improving images for human interpretation and processing images for storage, transmission, and machine analysis. The field has grown significantly since the 1920s, with early applications in newspaper printing and space exploration. Today, digital image processing is widely used for tasks like medical imaging, industrial inspection, law enforcement, and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views80 pages

Dip Unit 1

Digital image processing techniques are used to improve digital images, process them for different applications, and extract useful information from them. A digital image is a finite set of digital values that represent a two-dimensional image. Digital image processing focuses on improving images for human interpretation and processing images for storage, transmission, and machine analysis. The field has grown significantly since the 1920s, with early applications in newspaper printing and space exploration. Today, digital image processing is widely used for tasks like medical imaging, industrial inspection, law enforcement, and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Digital Image Processing:

Introduction
Introduction

•“One picture is worth more than ten thousand


words”
•Anonymous
References
• “Digital Image Processing”, Rafael C.
Gonzalez & Richard E. Woods,
Addison-Wesley, 2002
– Much of the material that follows is taken from this
book
Contents
– What is a digital image?
– What is digital image processing?
– History of digital image processing
– State of the art examples of digital image
processing
– Fundamental Steps in digital image processing
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
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
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)
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
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:
Output: Image Output: Attributes Understanding
Examples: Noise removal, Examples: Object Examples: Scene
image sharpening recognition, understanding,
segmentation autonomous navigation
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
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
reproduced images digital image Early 15 tone digital image
History of DIP (cont…)
•1960s: Improvements in computing technology
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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
in other space missions
including the Apollo landings A picture of the moon taken by
the Ranger 7 probe minutes
before landing
History of DIP (cont…)
•1970s: Digital image processing begins to be
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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 image
Tomography (CAT) scans
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
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


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

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


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
Examples: GIS (cont…)
•Night-Time Lights of the
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

World data set


– Global inventory of
human settlement
– Not hard to imagine
the kind of analysis
that might be done
using this data
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
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
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
Examples: HCI
•Try to make human computer
interfaces more natural
– Face recognition
– Gesture recognition
Electromagnetic (EM) energy spectrum

Major uses
Gamma-ray imaging: nuclear medicine and astronomical observations
X-rays: medical diagnostics, industry, and astronomy, etc.
Ultraviolet: lithography, industrial inspection, microscopy, lasers, biological
imaging,and astronomical observations
Visible and infrared bands: light microscopy, astronomy, remote sensing, industry
Microwave band: radar
Radio band: medicine (such as MRI) and astronomy
Light and EM Spectrum

► The colors that humans perceive in an object are


determined by the nature of the light reflected from
the object.

e.g. green objects reflect light with wavelengths primarily in the


500 to 570 nm range while absorbing most of the energy at
other wavelength

Weeks 1 & 2 28
Fundamental Steps in digital image processing

Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
Fundamental Steps in digital image processing

Image Acquisition
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
Fundamental Steps in digital image processing

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
Fundamental Steps in digital image processing

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
Fundamental Steps in digital image processing

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
Fundamental Steps in digital image processing

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
Fundamental Steps in digital image processing

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
Fundamental Steps in digital image processing

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
Fundamental Steps in digital image processing

Image Compression
Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
Fundamental Steps in digital image processing

Colour Image Processing


Image Morphological
Restoration Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representation
Problem Domain
& Description
Colour Image Image
Processing Compression
Digital image representation

• Monochrome image (or simply image) refers


to a 2-dimensional light intensity function
f(x,y)
• x and y denote spatial coordinates
• the value of f(x,y) at (x,y) is proportional to
the brightness (or gray level) of the image at
that point
Digital image

• A digital image is an image f(x,y) that has been


discretized both in spatial coordinates and in
brightness
• Considered as a matrix whose row and column
indices represent a point in the image
• The corresponding matrix element value represents
the gray level at that point
• The elements of such an array are referred to as:
– image elements
– picture elements (pixels or pels)
• What is Digital Image Processing?
Digital Image f(x,y)
— a two-dimensional function
x and y are spatial coordinates
The amplitude of f is called intensity or gray level at the point (x, y)

Digital Image Processing


— process digital images by means of computer, it covers low-, mid-, and high-
level processes
low-level: inputs and outputs are images
mid-level: outputs are attributes extracted from input images
high-level: an ensemble of recognition of individual objects

Pixel
— the elements of a digital image
A Simple Image Formation Model

f ( x , y ) = i ( x , y ) r ( x, y )

f ( x, y ) : intensity at the point (x, y)


i ( x, y ) : illumination at the point (x, y)
(the amount of source illumination incident on the scene)
r ( x, y ) : reflectance/transmissivity at the point (x, y)
(the amount of illumination reflected/transmitted by the object)
where 0 < i( x, y) <  and 0 < r ( x, y) < 1
Some Typical Ranges of illumination

• Illumination
Lumen — A unit of light flow or luminous flux
Lumen per square meter (lm/m2) — The metric unit of measure for
illuminance of a surface

– On a clear day, the sun may produce in excess of 90,000 lm/m2 of illumination
on the surface of the Earth

– On a cloudy day, the sun may produce less than 10,000 lm/m2 of illumination
on the surface of the Earth

– On a clear evening, the moon yields about 0.1 lm/m2 of illumination

– The typical illumination level in a commercial office is about 1000 lm/m2

Weeks 1 & 2 44
Some Typical Ranges of Reflectance

• Reflectance

– 0.01 for black velvet

– 0.65 for stainless steel

– 0.80 for flat-white wall paint

– 0.90 for silver-plated metal

– 0.93 for snow


Image Sampling and Quantization

Digitizing the
coordinate
values
Digitizing the
amplitude
values
Image Sampling and Quantization
Representing Digital Images
Representing Digital Images
The representation of an M×N numerical array
 f (0, 0) f (0,1) ... f (0, N − 1) 
 f (1, 0) f (1,1) ... f (1, N − 1) 
f ( x, y ) =  
 ... ... ... ... 
 
 f ( M − 1, 0) f ( M − 1,1) ... f ( M − 1, N − 1) 

The representation of an M×N numerical array in


MATLAB
 f (1,1) f (1, 2) ... f (1, N ) 
 f (2,1) f (2, 2) ... f (2, N ) 
f ( x, y ) =  
 ... ... ... ... 
 
 f ( M ,1) f ( M , 2) ... f (M , N )
Representing Digital Images

• Discrete intensity interval [0, L-1], L=2k


where k is the No. of bits required to represent one
pixel. For 8 bit image, L=28 =256. It means for 8 bit
image, there are total 256 gray levels. The range of
gray levels is called as dynamic range of the image.
• The number b of bits required to store a M × N
digitized image
b=M×N×k
• Thus Quantization increases with increase in number
of gray levels.
Spatial and Intensity Resolution

• Spatial resolution
— A measure of the smallest discernible detail in an image
— stated with line pairs per unit distance, dots (pixels) per unit
distance, dots per inch (dpi)

• Intensity resolution
— The smallest discernible change in intensity level
— stated with 8 bits, 12 bits, 16 bits, etc.
Spatial and Intensity Resolution

Weeks 1 & 2 52
Spatial and Intensity Resolution

Weeks 1 & 2 53
Spatial and Intensity Resolution

Weeks 1 & 2 54
Basic Relationships Between Pixels

• Neighborhood

• Adjacency

• Connectivity

• Paths

• Regions and boundaries


Basic Relationships Between Pixels

• Neighbors of a pixel p at coordinates (x,y)

➢ 4-neighbors of p, denoted by N4(p):


(x-1, y), (x+1, y), (x,y-1), and (x, y+1).

➢ 4 diagonal neighbors of p, denoted by ND(p):


(x-1, y-1), (x+1, y+1), (x+1,y-1), and (x-1, y+1).

➢ 8 neighbors of p, denoted N8(p)


N8(p) = N4(p) U ND(p)
Basic Relationships Between Pixels

• Adjacency
Let V be the set of intensity values

➢ 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).
Basic Relationships Between Pixels

• Adjacency
Let V be the set of intensity values
➢ m-adjacency: Two pixels p and q with values from V are m-
adjacent if
(i) q is in the set N4(p) or q is in the set ND(p) AND
(ii) the set N4(p) ∩ N4(q) has no pixels whose values are from V.
➢ In other words, m-adjacency can be defined as:
(i) Two pixels are said to be m-connected if A is a 8-neighbor of B , their gray
level meet the same predetermined criteria AND
(ii) 4 neighbors of A do not intersect with 4 neighbors of B.
Basic Relationships Between Pixels

• Path
➢ A (digital) path (or curve) from pixel p with coordinates (x0, y0) to pixel q with
coordinates (xn, yn) is a sequence of distinct pixels with coordinates

(x0, y0), (x1, y1), …, (xn, yn)

Where (xi, yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n.

➢ Here n is the length of the path.

➢ If (x0, y0) = (xn, yn), the path is closed path.

➢ We can define 4-, 8-, and m-paths based on the type of adjacency used.
Examples: Adjacency and Path
V = {1, 2}

0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1

Weeks 1 & 2 60
Examples: Adjacency and Path
V = {1, 2}

0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1
8-adjacent

Weeks 1 & 2 61
Examples: Adjacency and Path
V = {1, 2}

0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1
8-adjacent m-adjacent

Weeks 1 & 2 62
Examples: Adjacency and Path
V = {1, 2}

0 1 1
1,1 1,2 1,3 0 1 1 0 1 1
0 2 0
2,1 2,2 2,3 0 2 0 0 2 0
0 0 1
3,1 3,2 3,3 0 0 1 0 0 1
8-adjacent m-adjacent

The 8-path from (1,3) to (3,3): The m-path from (1,3) to (3,3):
(i) (1,3), (1,2), (2,2), (3,3) (1,3), (1,2), (2,2), (3,3)
(ii) (1,3), (2,2), (3,3)

Weeks 1 & 2 63
Basic Relationships Between Pixels

• Connected in S
Let S represent a subset of pixels in an image. Two pixels p with
coordinates (x0, y0) and q with coordinates (xn, yn) are said to be
connected in S if there exists a path

(x0, y0), (x1, y1), …, (xn, yn)

Where i,0  i  n,( xi , yi )  S

Weeks 1 & 2 64
Basic Relationships Between Pixels

Let S represent a subset of pixels in an image

• For every pixel p in S, the set of pixels in S that are connected to p is called a
connected component of S.

• If S has only one connected component, then S is called Connected Set.

• We call R a region of the image if R is a connected set

• Two regions, Ri and Rj are said to be adjacent if their union forms a connected
set.
• Regions that are not to be adjacent are said to be disjoint.

Weeks 1 & 2 65
Basic Relationships Between Pixels

• Boundary (or border)

➢ The boundary of the region R is the set of pixels in the region that have one
or more neighbors that are not in R.
➢ If R happens to be an entire image, then its boundary is defined as the set of
pixels in the first and last rows and columns of the image.

• Foreground and background

➢ An image contains K disjoint regions, Rk, k = 1, 2, …, K. Let Ru denote the


union of all the K regions, and let (Ru)c denote its complement.
All the points in Ru is called foreground;
All the points in (Ru)c is called background.

Weeks 1 & 2 66
Question 1

• In the following arrangement of pixels, are the two regions (of


1s) adjacent? (if 8-adjacency is used)

1 1 1
Region 1
1 0 1
0 1 0
0 0 1 Region 2

1 1 1
1 1 1

Weeks 1 & 2 67
Question 2

• In the following arrangement of pixels, are the two parts (of 1s)
adjacent? (if 4-adjacency is used)

1 1 1
Part 1
1 0 1
0 1 0
0 0 1 Part 2

1 1 1
1 1 1

Weeks 1 & 2 68
• In the following arrangement of pixels, the two regions (of 1s)
are disjoint (if 4-adjacency is used)

1 1 1
Region 1
1 0 1
0 1 0
0 0 1 Region 2

1 1 1
1 1 1

Weeks 1 & 2 69
• In the following arrangement of pixels, the two regions (of 1s)
are disjoint (if 4-adjacency is used)

1 1 1
foreground
1 0 1
0 1 0
0 0 1 background

1 1 1
1 1 1

Weeks 1 & 2 70
Question 3

• In the following arrangement of pixels, the circled point is part


of the boundary of the 1-valued pixels if 8-adjacency is used,
true or false?

0 0 0 0 0
0 1 1 0 0
0 1 1 0 0
0 1 1 1 0
0 1 1 1 0
0 0 0 0 0

Weeks 1 & 2 71
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)

Weeks 1 & 2 73
Distance Measures
The following are the different Distance measures:

a. Euclidean Distance :
De(p, q) = [(x-s)2 + (y-t)2]1/2

b. City Block Distance:


D4(p, q) = |x-s| + |y-t|

c. Chess Board Distance:


D8(p, q) = max(|x-s|, |y-t|)

Weeks 1 & 2 74
Question 5

• In the following arrangement of pixels, what’s the value of the


chessboard distance between the circled two points?

0 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

Weeks 1 & 2 75
Question 6

• In the following arrangement of pixels, what’s the value of the


city-block distance between the circled two points?

0 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

Weeks 1 & 2 76
Question 7

• In the following arrangement of pixels, what’s the value of the


length of the m-path between the circled two points?

0 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

Weeks 1 & 2 77
Question 8

• In the following arrangement of pixels, what’s the value of the


length of the m-path between the circled two points?

0 0 0 0 0
0 0 1 1 0
0 0 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

Weeks 1 & 2 78
Introduction to Mathematical Operations in DIP

• Array vs. Matrix Operation

 a11 a12   b11 b12 


A=  B=
 a21 a22  
 21 22 
b b
Array
product
operator
 a11b11 a12b12 
A .* B =  
Array product

Matrix
 21 21 22 22 
a b a b
product
operator
 a11b11 + a12b21 a11b12 + a12b22  Matrix product
A*B= 
+ a b a b +
 21 11 22 21 21 12 22 22 
a b a b

Weeks 1 & 2 79
Introduction to Mathematical Operations in DIP

• Linear vs. Nonlinear Operation

H  f ( x, y )  = g ( x, y )
H  ai fi ( x, y ) + a j f j ( x, y ) 
Additivity
= H  ai fi ( x, y ) + H  a j f j ( x, y ) 
= ai H  fi ( x, y ) + a j H  f j ( x, y )  Homogeneity

= ai gi ( x, y ) + a j g j ( x, y )
H is said to be a linear operator;
H is said to be a nonlinear operator if it does not meet the above
qualification.
Weeks 1 & 2 80
Arithmetic Operations

• Arithmetic operations between images are array


operations. The four arithmetic operations are denoted as

s(x,y) = f(x,y) + g(x,y)


d(x,y) = f(x,y) – g(x,y)
p(x,y) = f(x,y) × g(x,y)
v(x,y) = f(x,y) ÷ g(x,y)

Weeks 1 & 2 81
Statistical Properties
• 1. Histogram
• 2. Histogram Equalization
• 3. Mean [Brightness or Average gray level of
the image]
• 4. Standard Deviation [Contrast (C=1 : High
cont & C=0 : low Cont)]
Image statistics
M −1 N −1

 f ( x, y)
y =0 x =0
• MEAN  =
N *M
M −1 N −1

 ( f ( x , y ) −  ) 2

• VARIANCE 2 = y =0 x =0

N *M

• STANDARDEVIATION = var iance

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy