lect 02 second portion
TRANSCRIPT
![Page 1: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/1.jpg)
DIGITAL IMAGE PROCESSING (2ND EDITION)
RAFAEL C. GONZALEZRICHARD E.WOODS
Dr Moe Moe Myint(Assistant Lecturer)Technological University (Kyaukse)
![Page 2: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/2.jpg)
2
MISCELLANEA Lectures: A
Monday 1:00 – 3:00 Tuesday 2:00 – 4:00
Lectures: B Monday 8:00 – 10:00 Wednesday 1:00 – 3:00
Slideshare: www.slideshare.net/MoeMoeMyint E-mail: [email protected] Blog: drmoemoemyint.blogspot.com
![Page 3: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/3.jpg)
3
CONTENTS FOR CHAPTER 2
2.1 Elements of Visual Perception2.2 Light and the Electromagnetic Spectrum2.3 Image Sensing and Acquisition2.4 Image Sampling and Quantization2.5 Some Basic Relationships Between Pixels2.6 Linear and Nonlinear Operations
![Page 4: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/4.jpg)
4
Digital Image
Digital image = a multidimensionalarray of numbers (such as intensity image) or vectors (such as color image)
Each component in the imagecalled pixel associates withthe pixel value (a single number in the case of intensity images or a vector in the case of color images).
398715322213251537266928161010
39656554424754216796543243567065
99876532924385856796906078567099
![Page 5: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/5.jpg)
5
2.3 IMAGE SENSING AND ACQUISITION
Image Sensingo Scene
o Moleculeso Human Brainso …
o Illuminationo Radaro Infraredo X-rayo Sun o …
o Reflection
![Page 6: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/6.jpg)
6
CONT’D
Single imaging Sensor
Line Sensor
Array Sensor
![Page 7: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/7.jpg)
7
IMAGE ACQUISITION USING A SINGLE SENSOR
The most familiar sensor of this type is the photodiodeIt is constructed of silicon materials and whose output voltage waveform is proportional to light. The use of a filter in front of a sensor improves selectivity. For example, a green (pass) filter in front of a light sensor favors light in the green band of the color spectrum.As a consequence, the sensor output will be stronger for green light than for other components in the visible spectrum.
![Page 8: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/8.jpg)
8
IMAGE ACQUISITION USING SENSOR STRIPS
![Page 9: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/9.jpg)
9
Image Acquisition Using Sensor Strip
![Page 10: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/10.jpg)
10
IMAGE ACQUISITION USING SENSOR ARRAYS
![Page 11: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/11.jpg)
11
CCD KAF-3200E from Kodak.(2184 x 1472 pixels,
Pixel size 6.8 microns2)
Charge-Coupled Device (CCD)
w Used for convert a continuous image into a digital image
w Contains an array of light sensors
w Converts photon into electric chargesaccumulated in each sensor unit
Image Sensors : Array Sensor
![Page 12: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/12.jpg)
12
A SIMPLE IMAGE FORMATION MODEL
f(x,y) = i(x,y) r(x,y)0 < i(x,y) < 0 < r(x,y) < 1(from total absorption to total reflectance)
Sample values of r(x,y):
0.01: black velvet0.93: snow
Intensity of a monochrome image f at (x0,y0): gray level l of the image at that pointl=f(x0, y0)Lmin ≤ l ≤ Lmax
Where:Lmin: PositiveLmax: Finite
In practice:Lmin = Imin rmin Lmax = Imax rmax
e.g. for indoor image processing:Lmin ≈ 10Lmax ≈ 1000
[Lmin, Lmax] : gray scaleOften shifted to [0,L-1] l=0: black
l=L-1: whiteAll intermediate values are shades of gray
![Page 13: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/13.jpg)
13
CONT’D
![Page 14: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/14.jpg)
14
2.4 Image Sampling and Quantization
• The output of most sensors is continuous in amplitude and spatial coordinates.
• Converting an analog image to a digital image require sampling and quantization
• Sampling: is digitizing the coordinate values
• Quantization: is digitizing the amplitude values
![Page 15: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/15.jpg)
15
SAMPLING & QUANTIZATION The spatial and amplitude digitization of
f(x,y) is called:
image sampling when it refers to spatial coordinates (x,y) and
gray-level quantization when it refers to the amplitude.
![Page 16: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/16.jpg)
16
Image Sampling and Quantization
Spatial sampling is accomplished by sensorarrangement and mechanical movement.
![Page 17: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/17.jpg)
17
IMAGE SAMPLING AND QUANTISATIONA digital sensor can only measure a limited number of samples at a discrete set of energy levelsQuantisation is the process of converting a continuous analogue signal into a digital representation of this signal
![Page 18: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/18.jpg)
18
IMAGE SAMPLING AND QUANTISATION
![Page 19: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/19.jpg)
19
IMAGE SAMPLING AND QUANTISATION
![Page 20: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/20.jpg)
20
IMAGE SAMPLING AND QUANTISATION (CONT…)Remember that a digital image is always only an approximation of a real world scene
![Page 21: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/21.jpg)
21
original Sampled by 2 Sampled by 4
Sampled by 8 Sampled by 16
![Page 22: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/22.jpg)
22
UNIFORM QUANTIZATION Digitized in amplitude (or pixel value) PGM – 256 levels 4 levels
0
255
64
128
192
0
3
1
2
![Page 23: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/23.jpg)
23
original 128 levels (7 bits) 16 levels (4 bits)
4 levels (2 bits) 2 levels (1 bit)
![Page 24: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/24.jpg)
24
Representing Digital Images
![Page 25: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/25.jpg)
25
Image “After snow storm”
Fundamentals of Digital Images
f(x,y)
x
y
w An image: a multidimensional function of spatial coordinates.w Spatial coordinate: (x,y) for 2D case such as photograph,
(x,y,z) for 3D case such as CT scan images (x,y,t) for movies
w The function f may represent intensity (for monochrome images) or color (for color images) or other associated values.
Origin
![Page 26: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/26.jpg)
26
REPRESENTING DIGITAL IMAGES
0 ai,j L-1 Where L = 2k
The dynamic range of an image is the range of values spanned by the gray scale.
The number, b, of bits required to store a digitized image of size M by N is
b = M N k
The pixel intensity levels (gray scale levels) are in the interval of [0, L-1].
![Page 27: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/27.jpg)
27
77 66 68 67 98 93 79 8179 61 61 71 61 78 88 9479 93 84 64 72 76 95 9497 65 71 75 75 72 95 111120 81 82 76 72 77 78 83150 146 112 83 78 62 91 85156 145 158 125 107 121 95 86158 166 147 146 153 149 129 107
Elaine image of size 512 by 512 pixels (5 by 5 inches), The dynamic range is [0, 255].
Find the following:• The number of bits required to represent a pixel• The size of the image in bits?
Representing Digital Images
![Page 28: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/28.jpg)
28
Representing Digital Images
![Page 29: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/29.jpg)
29
Digital Image Types : Intensity Image
Intensity image or monochrome image each pixel corresponds to light intensitynormally represented in gray scale (gray level).
398715322213251537266928161010
Gray scale values
![Page 30: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/30.jpg)
30
398715322213251537266928161010
39656554424754216796543243567065
99876532924385856796906078567099
Digital Image Types : RGB Image
Color image or RGB image:each pixel contains a vectorrepresenting red, green andblue components.
RGB components
![Page 31: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/31.jpg)
31
Image Types : Binary Image
Binary image or black and white imageEach pixel contains one bit :
1 represent white0 represents black
1111111100000000
Binary data
![Page 32: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/32.jpg)
32
Image Types : Index Image
Index imageEach pixel contains index numberpointing to a color in a color table
256746941
Index value
Index No.
Redcomponent
Greencomponent
Bluecomponent
1 0.1 0.5 0.32 1.0 0.0 0.03 0.0 1.0 0.04 0.5 0.5 0.55 0.2 0.8 0.9
… … … …
Color Table
![Page 33: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/33.jpg)
33
Effect of Spatial Resolution
256x256 pixels
64x64 pixels
128x128 pixels
32x32 pixels
![Page 34: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/34.jpg)
34
SPATIAL RESOLUTIONThe spatial resolution of an image is determined by how sampling was carried outSpatial resolution simply refers to the smallest discernable detail in an image
Vision specialists will often talk about pixel size
Graphic designers will talk about dots per inch (DPI)
5.1
Megapixels
![Page 35: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/35.jpg)
35
Effect of Spatial Resolution
![Page 36: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/36.jpg)
36
SPATIAL RESOLUTION (CONT…)
![Page 37: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/37.jpg)
37
SPATIAL RESOLUTION (CONT…)
![Page 38: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/38.jpg)
38
SPATIAL RESOLUTION (CONT…)
![Page 39: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/39.jpg)
39
SPATIAL RESOLUTION (CONT…)
![Page 40: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/40.jpg)
40
SPATIAL RESOLUTION (CONT…)
![Page 41: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/41.jpg)
41
SPATIAL RESOLUTION (CONT…)
![Page 42: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/42.jpg)
42
INTENSITY LEVEL RESOLUTIONIntensity level resolution refers to the number of intensity levels used to represent the image
The more intensity levels used, the finer the level of detail discernable in an image
Intensity level resolution is usually given in terms of the number of bits used to store each intensity level
Number of Bits Number of Intensity Levels Examples
1 2 0, 12 4 00, 01, 10, 114 16 0000, 0101, 11118 256 00110011,
0101010116 65,536 1010101010101010
![Page 43: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/43.jpg)
43
INTENSITY LEVEL RESOLUTION (CONT…)
128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp)
16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
256 grey levels (8 bits per pixel)
![Page 44: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/44.jpg)
44
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 45: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/45.jpg)
45
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 46: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/46.jpg)
46
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 47: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/47.jpg)
47
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 48: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/48.jpg)
48
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 49: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/49.jpg)
49
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 50: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/50.jpg)
50
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 51: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/51.jpg)
51
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 52: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/52.jpg)
52
SATURATION & NOISE
![Page 53: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/53.jpg)
53
RESOLUTION: HOW MUCH IS ENOUGH?The big question with resolution is always how much is enough?
This all depends on what is in the image and what you would like to do with it
Key questions include Does the image look aesthetically pleasing? Can you see what you need to see within the image?
![Page 54: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/54.jpg)
54
RESOLUTION: HOW MUCH IS ENOUGH? (CONT…)
The picture on the right is fine for counting the number of cars, but not for reading the number plate
![Page 55: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/55.jpg)
55
INTENSITY LEVEL RESOLUTION (CONT…)
Low Detail Medium Detail High Detail
![Page 56: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/56.jpg)
56
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 57: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/57.jpg)
57
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 58: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/58.jpg)
58
INTENSITY LEVEL RESOLUTION (CONT…)
![Page 59: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/59.jpg)
59
Basic Relationship of Pixels
x
y
(0,0)
Conventional indexing method
(x,y) (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
![Page 60: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/60.jpg)
60
Neighbors of a Pixel
p (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
4-neighbors of p:
N4(p) =
(x-1,y)(x+1,y)(x,y-1)(x,y+1)
Neighborhood relation is used to tell adjacent pixels. It is useful for analyzing regions.
Note: q Î N4(p) implies p Î N4(q)
4-neighborhood relation considers only vertical and horizontal neighbors.
![Page 61: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/61.jpg)
61
p (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
CONT’D
8-neighbors of p:
(x-1,y-1)(x,y-1)
(x+1,y-1)(x-1,y)(x+1,y)
(x-1,y+1)(x,y+1)
(x+1,y+1)
N8(p) =
8-neighborhood relation considers all neighbor pixels.
![Page 62: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/62.jpg)
62
p
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
Diagonal neighbors of p:
ND(p) =
(x-1,y-1)(x+1,y-1)(x-1,y+1)
(x+1,y+1)
Diagonal -neighborhood relation considers only diagonalneighbor pixels.
CONT’D
![Page 63: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/63.jpg)
63
If pixel p at location (x,y) then its neighbors are: • 4-neighbors N4(p) (x-1 , y), (x+1 , y), (x , y-1), (x , y+1)
• 4-diagonal neighbors ND(p)(x-1 , y-1), (x-1 , y+1), (x+1 , y+1), (x+1 , y-1)
• 8-neighbors N8(p)All pixels in N4(p) and in ND(p)
2.5 Some Basic Relationship Between Pixels
![Page 64: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/64.jpg)
64
Three type of adjacency:(a) 4-adjacency. Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p).
(b) 8-adjacency. Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p).
( c) m-adjacency (mixed adjacency). Two pixels p and q with values from V are m-adjacent if (i) q is in N4(p), or (ii) q is in ND(p) and the set N4(p) N4(q) has no pixels whose values are from VV: The set of gray-level values used to define adjacency
Adjacency
![Page 65: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/65.jpg)
65
Adjacency
A pixel p is adjacent to pixel q is they are connected.Two image subsets S1 and S2 are adjacent if some pixelin S1 is adjacent to some pixel in S2
S1
S2
We can define type of adjacency: 4-adjacency, 8-adjacencyor m-adjacency depending on type of connectivity.
![Page 66: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/66.jpg)
66
0 1 0
0 1 0
0 0 1
4-adjacency
q
p
8-adjacency
0 0 1
0 1 0
0 0 1
q
m-adjacency
0 1 1
0 1 0
0 0 1
q
0 1 1
0 1 0
0 0 1
q
8-adjacency !?
Adjacency
![Page 67: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/67.jpg)
67
CONT’D Subset adjacency
S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2
A path (curve) from pixel p with coordinates (x,y) to pixel q with coordinates (s,t) is a sequence of distinct pixels:
(x0,y0), (x1,y1), …, (xn,yn)
where (x0,y0)=(x,y), (xn,yn)=(s,t), and (xi,yi) is adjacent to (xi-1,yi-1), for 1≤i ≤n ; n is the length of the path.
If (x0, y0) = (xn, yn): A closed path.
![Page 68: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/68.jpg)
68
Region We call R a region of the image if R is a
connected set Boundary
The boundary of a region R is the set of pixels in the region that have one or more neighbors that are not in R
Edge Pixels with derivative values that exceed a
preset threshold
CONT’D
![Page 69: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/69.jpg)
69
Distance measures Euclidean distance
City-block distance
Chessboard distance
21
22 ])()[(),( tysxqpDe -+-
|)(||)(|),(4 tysxqpD -+-
|))(||,)(max(|),(8 tysxqpD --
CONT’D
![Page 70: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/70.jpg)
70
mD distance: The shortest m-path between the points
CONT’D
![Page 71: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/71.jpg)
71
For pixels p, q, and z, with coordinates (x,y), (s,t), and (v,w), respectively, D is a distance function or metric if
(a) D(p,q) 0 ,(b) D(p,q) = D(q,p), (symmetry)(c) D(p,z) D(p,q) + D(q,z) (triangular
inequality)Euclidean distance between p and q is
De(p,q) = [ (x - s)2 + (y - t)2 ]1/2For this distance measure, the pixels having a distance less than or equal to some value r from (x,y) are the points contained in a disk of radius r centered at (x,y).
Distance Measure (Euclidean)
![Page 72: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/72.jpg)
72
The D4 distance (city-block) between p and q is D4(p,q) = |x – s | + |y – t |
Diamond shape
The D8 distance (chessboard) between p and q is D8(p,q) = max ( |x – s | , |y – t | )
22 1 2
2 1 0 1 22 1 2
2
2 2 2 2 22 1 1 1 22 1 0 1 22 1 1 1 22 2 2 2 2
Distance Measure (City block, Chessboard)
![Page 73: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/73.jpg)
73
If distance depend on the path between two pixels such as m-adjacency then the Dm distance between two pixelsis defined as the shortest m-path between the pixels.
0 0 1
0 1 0
1 0 0
q
Dm( p , q ) = 2
0 0 1
1 1 0
1 0 0p
Dm( p , q ) = 3
0 1 1
1 1 0
1 0 0
Dm( p , q ) = 4
Distance Measure of Path
![Page 74: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/74.jpg)
74
Distance
For pixel p, q, and z with coordinates (x,y), (s,t) and (u,v),D is a distance function or metric if
w D(p,q) 0 (D(p,q) = 0 if and only if p = q)
w D(p,q) = D(q,p)
w D(p,z) D(p,q) + D(q,z)
Example: Euclidean distance22 )()(),( tysxqpDe -+-
![Page 75: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/75.jpg)
75
D4-distance (city-block distance) is defined as
tysxqpD -+-),(4
1 210
1 212
2
2
2
2
2
Pixels with D4(p) = 1 is 4-neighbors of p.
![Page 76: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/76.jpg)
76
D8-distance (chessboard distance) is defined as
),max(),(8 tysxqpD --
12
101
2
12
2
2
2
2
2
Pixels with D8(p) = 1 is 8-neighbors of p.
22
2
2
2222
1
1
1
1
![Page 77: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/77.jpg)
77
Path A path from pixel p at (x,y) to pixel q at (s,t) is a sequenceof distinct pixels:
(x0,y0), (x1,y1), (x2,y2),…, (xn,yn)such that
(x0,y0) = (x,y) and (xn,yn) = (s,t)and (xi,yi) is adjacent to (xi-1,yi-1), i = 1,…,n
pq
We can define type of path: 4-path, 8-path or m-pathdepending on type of adjacency.
![Page 78: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/78.jpg)
78
p
q
p
q
p
q
8-path from p to qresults in some ambiguity
m-path from p to qsolves this ambiguity
8-path m-path
![Page 79: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/79.jpg)
79
3 1 2 1
2 2 0 2
1 2 1 1
1 0 1 2(p)
(q)Find the shortest 4-, 8-, m-pathbetween p and q for V= {0, 1} and V={1, 2}
Path Length
![Page 80: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/80.jpg)
80
Images are represented by Matrices, and matrix division is not defined. The following image division C = A/Bmeans that the division is carried out between corresponding pixels in the two images A and B to form image C.
Image Operation on a Pixel Basis
![Page 81: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/81.jpg)
81
H(af + bg) = a H( f ) + b H( g )
Linear and Nonlinear OperationLinear operation
H is said to be a linear operator if, for any two images f and g and any two scalars a and b,
![Page 82: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/82.jpg)
82
IMAGE ADDITION(AVERAGING)IMAGE ADDITION (AVERAGING)
![Page 83: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/83.jpg)
83
IMAGE SUBTRACTION
![Page 84: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/84.jpg)
84
IMAGE SUBTRACTION
![Page 85: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/85.jpg)
85
IMAGE MULTIPLICATION (DIVISION)
![Page 86: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/86.jpg)
86
IMAGE MULTIPLICATION (DIVISION)
![Page 87: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/87.jpg)
87
REFERENCES “Digital Image Processing”, 2/ E, Rafael C. Gonzalez & Richard
E. Woods, www.prenhall.com/gonzalezwoods.
Only Original Owner has full rights reserved for copied images.
This PPT is only for fair academic use.
![Page 88: Lect 02 second portion](https://reader036.vdocuments.site/reader036/viewer/2022062400/587f27171a28ab350c8b7fa1/html5/thumbnails/88.jpg)
88
Questions?
Think Smarter,Work Harder