Documente Academic
Documente Profesional
Documente Cultură
Contents
Jorma Kekalainen
Page 1
Lecture notes
Jorma Kekalainen
Page 2
Lecture notes
Jorma Kekalainen
Page 3
Lecture notes
Image sharpening
Original image
Jorma Kekalainen
Enhanced original
Page 4
Lecture notes
Processed images
Jorma Kekalainen
Image sharpening
Jorma Kekalainen
10
Page 5
Lecture notes
Thumb print
Jorma Kekalainen
11
Jorma Kekalainen
Enhanced image
12
Page 6
Lecture notes
Jorma Kekalainen
Restored image
13
Jorma Kekalainen
14
Page 7
Lecture notes
Jorma Kekalainen
15
16
Page 8
Lecture notes
Jorma Kekalainen
17
Jorma Kekalainen
18
Page 9
Lecture notes
Jorma Kekalainen
19
Ultrasound
Transmitted and reflected ultrasound
Jorma Kekalainen
20
Page 10
Lecture notes
Image
Suppose we take an image, e.g. a photo.
Suppose the photo is black and white (that is, lots of
shades of gray), so no color.
We may consider this image as being a two
dimensional function f(x,y), where the function values
give the brightness of the image at any given point
(x,y).
In other words, there is a function f that depends on
the spatial (room) coordinates x and y.
We may assume that in such an image brightness
values can be any real numbers in the range 0 (black)
to 1 (white).
Jorma Kekalainen
21
Digital image
A digital image differs from a photo in that the x, y and f(x,y)
values are all discrete.
Usually they take on only integer values, so e.g. x and y
ranging from 1 to 256 each, and the) brightness values also
ranging from 0 (black) to 255 (white).
A digital image can be considered as a large array of discrete
dots, each of which has a brightness associated with it.
These dots are picture elements called pixels.
Surroundings of a given pixel form a neighborhood.
A neighborhood can be characterized by its shape in the same
way as a matrix.
E.g. we can speak of a 5*5 neighborhood, or of a 7*9 neighborhood.
Note: Except in very special circumstances, neighborhoods have odd numbers of rows and
Jorma Kekalainen
Image Processing
22
columns, because this ensures thatDigital
the current
pixel is in the centre of the neighborhood.
Page 11
Lecture notes
Zoom
Jorma Kekalainen
Original
image: 500x340
Digital Image Processing
pixels
23
Jorma Kekalainen
24
Page 12
Lecture notes
Pixel: [ p, I(p)]
c
Value: I(p)=I(r,c)
Location: p=(r,c)
Pixel Location: p = (r , c)
Pixel Value: I(p) = I(r , c)
Jorma Kekalainen
25
Pixel: [ p, I(p)]
c
Value: I(p)=I(r,c)
p=(r,c)
=(row#, col#)
Jorma Kekalainen
Location: p=(r,c)
red
I (p ) = green
blue
26
Page 13
Lecture notes
Example
Pixels and a neighborhood
Current pixel
3*5 neighborhood
Note: If a neighborhood has an even number of rows or columns (or both), it may
Jorma Kekalainen
Processing
27
be necessary
to specify which pixel inDigital
theImage
neighborhood
is the current pixel.
Jorma Kekalainen
28
Page 14
Lecture notes
Some applications
Image processing has an enormous range of applications in almost
every area of science and technology e.g.,
Industry
Automatic inspection of items on a production line
Agriculture
Satellite/aerial views of land, for example to determine how much
land is being used for different purposes, or to investigate the
suitability of different regions for different crops, or inspection of fruit
and vegetables - distinguishing good and fresh produce from old.
Medicine
Inspection and interpretation of images obtained from X-rays, MRI
(magnetic resonance imaging) or CT scans.
Law enforcement:
Fingerprint analysis,
Sharpening or de-blurring of speed-camera images,
All kinds of surveillance camera applications
Jorma Kekalainen
29
30
Page 15
Lecture notes
31
Jorma Kekalainen
32
Page 16
Lecture notes
33
Jorma Kekalainen
34
Page 17
Lecture notes
Digital image
a grid of squares,
each of which
contains a single
color
each square is
called a pixel (for
picture element)
35
Binary image
Each pixel is just black or white.
Since there are only two possible values for
each pixel, we only need one bit per pixel.
Such images can therefore be very efficient in
terms of storage.
Images for which a binary representation may
be suitable include text (printed or
handwriting), fingerprints, blueprints,
architectural plans etc.
Jorma Kekalainen
36
Page 18
Lecture notes
Jorma Kekalainen
Grayscale
Each pixel is a shade of gray, normally from 0 (black) to
255 (white).
This range means that each pixel can be represented by
eight bits i.e. exactly one byte.
This is a very natural range for image file handling.
Other grayscale ranges are used, but generally they are
a power of 2.
Such images arise in medicine (X-rays), images of
printed works, and indeed 256 different gray levels is
sufficient for the recognition of most natural objects.
Jorma Kekalainen
38
Page 19
Lecture notes
C(150:170,210:235)
Jorma Kekalainen
39
Color images
Are constructed from
three intensity maps.
Each intensity map is
projected through a color
filter (e.g., red, green, or
blue, or cyan, magenta, or
yellow) to create a
monochrome image.
The intensity maps are
overlaid to create a color
image.
Each pixel in a color image
is a three element vector.
Jorma Kekalainen
40
Page 20
Lecture notes
Jorma Kekalainen
41
Color images
Formation of a vector from corresponding pixel
values in three RGB component images
Jorma Kekalainen
42
Page 21
Lecture notes
43
Red
Jorma Kekalainen
Green
Blue
44
Page 22
Lecture notes
Jorma Kekalainen
45
Indexed image
Most color images only have a small subset of the
more than sixteen million possible colors.
For convenience of storage and file handling, the image
has an associated color map, or color palette, which is
simply a list of all the colors used in that image.
Each pixel has a value which does not give its color (as
for an RGB image), but an index to the color in the
map.
It is convenient if an image has 256 colors or less, for
then the index values will only require one byte each to
store.
Jorma Kekalainen
46
Page 23
Lecture notes
Indices
Color map
In this image the indices, rather then being the gray values
of the pixels, are simply indices into the color map.
Without the color map, the image would be very dark and
colorless.
Jorma Kekalainen
47
Jorma Kekalainen
0.1176
0.2627
0.5451
0.2588
0.6941
0.8431
0.1412
0.2314
0.6392
0.4000
0.1490
0.8196
Page 24
Lecture notes
Example
A small index sample from the previous image
>> ind(117:123,347:352)
ans =
0.1451
2 1 2 1 1 4
0.7451
1 4 4 1 1 1
0.7412
0.2392
2 1 4 4 1 4
0.8706
5 5 2 2 1 1
0.8706
5 5 5 5 5 1
5 5 5 5 5 5
5 5 5 5 5 5
Jorma Kekalainen
Color map
0.1176
0.2627
0.5451
0.2588
0.6941
0.8431
0.1412
0.2314
0.6392
0.4000
0.1490
0.8196
49
50
Page 25
Lecture notes
52
Page 26
Lecture notes
Image perception
Much of image processing is concerned with
making an image appear better to human eyes.
We should therefore be aware of the limitations
of the human visual system.
Image perception consists of two basic steps:
capturing the image with the eye,
recognizing and interpreting the image with the visual
cortex in the brain.
53
Lens
Retina is
the sensor
Focal length
upside down
54
Page 27
Lecture notes
Color vision
The human eye has cones which are sensitive to
different wavelength bands
Jorma Kekalainen
55
Absorption of light by
the cones in the human eye
Jorma Kekalainen
56
Page 28
Lecture notes
57
Page 29
Lecture notes
Actual
intensity:
Perceived
intensity:
Jorma Kekalainen
59
Intensity resolution
We can only resolve 26=64 or at most 27=128 intensity levels
on an ordinary computer screen.
Based on hardware considerations, grayscale images are
usually stored with 8 bits per pixels, i.e. 28=256 intensity
levels.
Some images are stored with more than 8 bits per pixels.
E.g., CT images are stored with 12 bits per pixels, i.e. 212=4096
intensity levels.
During image processing, pixels can preferably be stored with
more than 8 bits or floating point numbers.
Color images are usually stored with 3x8 bits per pixels, 28 red
intensity levels, 28 green intensity levels and 28 blue intensity
levels giving 224 > 16 million different colors.
Jorma Kekalainen
60
Page 30
Lecture notes
Spatial resolution
Spatial resolution is a measure
of the smallest discernible
detail in the image.
Two common measures:
lp/mm (line pair/mm),
dpi (dot/inch)
5 discernible
line pairs (lp)
per mm, 5 lp/mm
Jorma Kekalainen
Newspaper: 75 dpi
Magazine: 133 dpi
Glossy brochures: 175 dpi
Gonzalez & Woods: 2400
dpi
6 dots
per inch, 6 dpi
A newspaper
image 61
Continuous
image
Line A-B
from
image
After
sampling
Jorma Kekalainen
After
quantization
Digital Image Processing
62
Page 31
Lecture notes
Typically camera
Jorma Kekalainen
63
For a color
image, there
are 3 different
types of sensor
elements:
red, green and
blue
Sensor element
Jorma Kekalainen
64
Page 32
Lecture notes
Linear transformation
A D/A-converter
converts a digital
value to an
analog value, an
Jorma Kekalainen
electrical voltage
To D/A-converter and
further to the screen
Digital Image Processing
65
To D/A-converter and
further to the red
Jorma Kekalainen
channel of the screen.
To D/A-converter and
further to the green
Digital Image Processing
channel
of the screen.
Over 16
million
colors
To D/A-converter and
further to the blue
66
channel of the screen.
Page 33
Lecture notes
Jorma Kekalainen
26
21
22
17
12
13
19
23
27
10
14
18
24
25
20
15
16
11
67
Jorma Kekalainen
68
Page 34
Lecture notes
Jorma Kekalainen
69
Page 35
Lecture notes
EM radiation
Electromagnetic radiation is energy which
propagate through space as electromagnetic
waves
The waves consist of transversal electrical and
magnetic fields that alternate with a temporal
frequency (Hertz) and spatial wavelength
(meter)
Jorma Kekalainen
71
Jorma Kekalainen
72
Page 36
Lecture notes
Jorma Kekalainen
73
Jorma Kekalainen
74
Page 37
Lecture notes
Spectrum
In practice, light consists of
photons with a range of energies, or
waves with a range of frequencies
75
Spectrum
Jorma Kekalainen
76
Page 38
Lecture notes
Color spectrum
In 1666, Newton discovered that sunlight (white light) passing
through a glass prism split up into a color spectrum of wave
lengths in the interval 400-700nm.
Jorma Kekalainen
77
Color wavelength
Jorma Kekalainen
78
Page 39
Lecture notes
Classification of EM spectrum
Jorma Kekalainen
79
Polarization
The electromagnetic field has a direction
Perpendicular to the direction of motion
80
Page 40
Lecture notes
Polarization
Plane polarization
The electric field varies only in a single plane
Jorma Kekalainen
81
Polarization
Circular/elliptical polarization
The electric field vector rotates
Can be constructed as the sum of two plane polarized
waves with 90o phase shift
82
Page 41
Lecture notes
Coherence
The phase of the light waves can either be
random: incoherent light (natural light)
in a systematic relation: coherent light
83
Radiation energy
Light radiation has energy
Each photon has a particular energy related to its
frequency (E = h )
The number of photons of a particular frequency
gives the amount of energy for this frequency
Described by the spectrum
Unit: Joule (J=Ws =Watt second)
Is usually not measured directly.
Jorma Kekalainen
84
Page 42
Lecture notes
Radiation power
The power of the radiation, i.e., the energy
per unit time, is the radiant flux
Since the energy depends on the frequency, so
does the radiant flux
Unit: Watt (W=J/s= Joule per second)
Is usually not measured directly.
Page 43
Lecture notes
Radiant intensity
For point sources, or distant sources of small
extent, the flux density can also be measured per
unit solid angle
87
Basic principle
Preservation of energy A constant light
source must produce the same amount of
energy through a solid angle regardless of
distance to the source
The radiant intensity is constant
The radiant flux density decreases with the square
of the distance to the source
Jorma Kekalainen
88
Page 44
Lecture notes
Radiometric chain
Jorma Kekalainen
89
Jorma Kekalainen
90
Page 45
Lecture notes
91
Basic principle
Based on preservation of energy:
E0 = E1 + E2 + E3
Jorma Kekalainen
92
Page 46
Lecture notes
Refraction
The light that is transmitted into the new
medium is refracted due to the change in light
speed
Snells law of refraction:
93
Absorption
Absorption implies attenuation of transmitted
or reflected light
Materials get their colors as a result of
different amount of absorption for different
wavelengths
E.g., A red object attenuates wavelengths in the
red band less than in other bands.
Jorma Kekalainen
94
Page 47
Lecture notes
Absorption
The absorption of light in matter depends on the
length that the light travels through the material
95
Absorption spectrum
The spectrum of the reflected/transmitted
light is given by
s1 = incident spectrum
s2 = reflected/transmitted spectrum
a = absorption spectrum ( 0 a() 1)
Jorma Kekalainen
96
Page 48
Lecture notes
Reflection
Highly dependent on the surface type
97
Emission
Almost independent of its interaction with
incident light:
Any object, even one that is not considered a light
source, emits electromagnetic radiation
Jorma Kekalainen
98
Page 49
Lecture notes
Scattering
All mediums (except vacuum) scatter light
E.g., air, water, glass etc.
Jorma Kekalainen
99
Scattering
Scattering means that the
light ray does not travel
along a straight line
through the medium
There is a probability that a
certain photon exits the
medium in another
direction than it entered.
Examples:
The sky is blue because of
scattering of the sun light
A strong laser beam
becomes visible in air
Jorma Kekalainen
100
Page 50