Vous êtes sur la page 1sur 70

Prof.

Hansa Shingrakhia

Introduction

One picture is worth more than ten

thousand words

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/

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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

What is a Digital Image?


(cont)
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

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

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

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
Output: Image

Input: Image
Output: Attributes

Input: Attributes
Output: Understanding

Examples: Noise
removal, image
sharpening

Examples: Object
recognition,
segmentation

Examples: Scene
understanding,
autonomous navigation

In this course we will


stop here

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

History of Digital Image


Processing
Early 1920s: One of the first

applications of digital imaging was in the


newspaper industry
The Bartlane cable picture

Early digital image

transmission service
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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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
by the Ranger 7 probe
Such techniques were used
in other space missions
A picture of the moon taken
including the Apollo landings by the Ranger 7 probe
minutes before landing

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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
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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Examples: Image
Enhancement
One of the most common uses of DIP

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 Hubbles
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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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

Edge Detection Image

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Examples: GIS
Geographic Information Systems
Digital image processing techniques are

used extensively to manipulate satellite


imagery
Terrain classification
Meteorology

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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

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

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

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

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

Key Stages in Digital Image


Processing
Image
Restoration

Morphological
Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Image Aquisition
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Image Enhancement
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Image Restoration
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Morphological
Processing
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Segmentation
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Object Recognition
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Key Stages in Digital Image


Processing:
Representation
& Morphological
Description
Image
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Key Stages in Digital Image


Processing:
Image Compression
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Key Stages in Digital Image


Processing:
Colour Image
Processing
Image
Morphological
Restoration

Processing

Image
Enhancement

Segmentation

Image
Acquisition

Object
Recognition

Problem Domain

Representation
& Description

Colour Image
Processing

Image
Compression

Summary
We have looked at:
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

Next time we will start to see how it all

works

Image digitization
Why do we need digitization?
What is digitization?
How to digitize the image?

Why Digitization?
Theory of real numbers: Between any

two given points there are infinite


number of points.
An image should be represented by
infinite numbers of points.
Each such image point may contain one
of the infinitely many possible intensity
values needing infinite number of bits.
So such representation is not possible in
any digital computer

What is desired?
An image to be represented in the

form of a finite 2-D matrix.

Image as a matrix of
numbers

What is digitization?
Image representation in 2D finite matrix-

Sampling
Each matrix element represented by one of the
finite set of discrete values
Quantization
Matrix element called pixels.
Some relationships exist among pixels.

Aliasing and Moir Pattern


All signals (functions) can be shown to be made up of a

linear combination sinusoidal signals (sines and cosines) of


different frequencies. (Chapter 4)
For physical reasons, there is a highest frequency
component in all real world signals.
Theoretically,
if a signal is sampled at more than twice its highest
frequency component, then it can be reconstructed
exactly from its samples.
But, if it is sampled at less than that frequency (called
undersampling), then aliasing will result.
This causes frequencies to appear in the sampled signal
that were not in the original signal.
The Moir pattern shown in Figure 2.24 is an example.
The vertical low frequency pattern is a new frequency
not in the original patterns.

Aliasing and Moir Pattern


The effect of aliased frequencies

Zooming and Shrinking Digital Images


Zooming: increasing the number of

pixels in an image so that the image


appears larger
Nearest neighbor interpolation

For example: pixel replication--to repeat


rows and columns of an image
Bilinear interpolation
Smoother
Higher order interpolation

Image shrinking: subsampling

Zooming and Shrinking Digital Images

Nearest neighbor
Interpolation
(Pixel replication)

Bilinear
interpolation

Relationships between
pixels
On completion the students will be able to

1. what is pixels neighborhood & different


types of neighborhood.
2. Explain what is meant by connectivity.
3. Learn connecting component labeling
algorithm.
4. Explain what is adjacency & different
type of adjacency.
5. Learn different distance measures.

Neighborhood of a pixel

P=N4(p)

Diagonal & 8-neighbors

ND(p)

N8(p)=P=N4(p) ND(p)

Neighbors of a pixel

There are three kinds of neighbors of a


pixel:

N4(p) 4-neighbors: the set of horizontal and


vertical neighbors
ND(p) diagonal neighbors: the set of 4 diagonal
neighbors
N8(p) 8-neighbors:
union
and
O
O of 4-neighbors
O
O O O
diagonal neighbors

X
O

Adjacency and
Connectivity
Let V: a set of intensity values used to

define adjacency and connectivity.


In a binary image, V = {1}, if we are
referring to adjacency of pixels with value 1.
In a gray-scale image, the idea is the same,
but V typically contains more elements, for
example, V = {180, 181, 182, , 200}
If the possible intensity values 0 255, V set
can be any subset of these 256 values.

Adjacency:

Two pixels that are neighbors and have the


same grey-level (or some other specified
similarity criterion) are adjacent

Pixels can be 4-adjacent, diagonally adjacent,


8-adjacent, or m-adjacent.
m-adjacency (mixed adjacency):

Two pixels p and q of the same value (or


specified similarity) are m-adjacent if either
(i) q and p are 4-adjacent, or
(ii) p and q are diagonally adjacent and do
not have any common 4-adjacent
neighbors.
They cannot be both (i) and (ii).

An example of adjacency:

Path:

The length of the path

Closed path
Connectivity in a subset S of an image

Two pixels are connected if there is a path


between them that lies completely within S.
Connected component of S:

The set of all pixels in S that are connected to


a given pixel in S.
Region of an image
Boundary, border or contour of a region
Edge: a path of one or more pixels that separate
two regions of significantly different gray levels.

Distance measures

Distance function: a function of two points, p


and q, in space that satisfies three criteria
( a ) D ( p, q ) 0
(b) D( p, q ) D(q, p ), and
(c ) D ( p , z ) D ( p , q ) D ( q , z )

The Euclidean distance De(p, q)


De ( p, q ) ( x s ) 2 ( y t ) 2

The city-block (Manhattan) distance D4(p, q)


D4 ( p, q ) | x s | | y t |

The chessboard distance D8(p, q)


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

Distance Measures
Dm distance:

is defined as the shortest m-path


between the points.
In this case, the distance between two
pixels will depend on the values of the
pixels along the path, as well as the
values of their neighbors.

Distance Measures
Example:

Consider the following arrangement of


pixels and assume that p, p2, and p4
have value 1 and that p1 and p3 can
have can have a value of 0 or 1
Suppose that we consider
the adjacency of pixels
values 1 (i.e. V = {1})

Distance Measures
Cont. Example:

Now, to compute the Dm between


points p and p4
Here we have 4 cases:
Case1: If p1 =0 and p3 = 0
The length of the shortest m-path
(the Dm distance) is 2 (p, p2, p4)

Distance Measures
Cont. Example:

Case2: If p1 =1 and p3 = 0
now, p1 and p will no longer be
adjacent (see m-adjacency definition)
then, the length of the shortest
path will be 3 (p, p1, p2, p4)

Distance Measures
Cont. Example:

Case3: If p1 =0 and p3 = 1
The same applies here, and the
shortest m-path will be 3 (p, p2, p3, p4)

Distance Measures
Cont. Example:

Case4: If p1 =1 and p3 = 1
The length of the shortest m-path will
be 4 (p, p1 , p2, p3, p4)

Vous aimerez peut-être aussi