Lecture-02_DigitalImageEnhancemnet-02.pdf

MuhammadHanif36 11 views 115 slides Mar 11, 2025
Slide 1
Slide 1 of 115
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115

About This Presentation

Image Enhancement


Slide Content

Dr. Muhammad Hanif

Image Enhancement

Image Enhancement

Histogram

Histogram

Histogram

Histogram

Histogram

Interpreting Histograms

Histogram

Contrast and Histogram

Histogram Basics
Normalized histogram ( )
: the number of pixels in the image of
size M N with intensity
k
k
k
k
n
pr
MN
n
r
=
´
Histogram ( )
is the intensity value
is the number of pixels in the image with intensity
kk
th
k
kk
hr n
rk
nr
=

Histogram Equalization
•A popular technique for improving the appearance of a poor image
•Goal: The histogram of the resultant image is as flat as possible
•The histogram equalization process for digital images consists of four
steps:
•1. Find the running sum of the histogram values
•2. Normalize the values from step1 by dividing by total number of pixels.
•3. Multiply the values from step2 by the maximum gray level value and round.
•4. Map the gray-level values to the results from step 3, using a one-to-one
correspondence.

Histogram Equalization
•Example:
•We have an image with 3 bit /pixel, so the possible range of values is
0 to 7. We have an image with the following histogram:

Histogram Equalization

Histogram Equalization

•Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the intensity distribution shown in following table.
•Get the histogram equalization transformation function and give the ps(sk) for each sk.
Histogram Equalization

0
00
0
() 7 () 70.19 1.33
rj
j
sTr pr
=
== =´= å

1
11
0
( ) 7 ( ) 7 (0.19 0.25) 3.08
rj
j
sTr pr
=
== =´+= å

23
45
67
4.55 5 5.67 6
6.23 6 6.65 7
6.86 7 7.00 7
ss
ss
ss
=®=®
=®=®
=®=®
Histogram Equalization

Histogram Equalization

Histogram Equalization

Point Operation and Histogram

Color image Histogram

Point Operation

Homogenous point Operation

Point Operation Pseudocode

Non-Homogenous point operation

Inverting Image

Image Negative

Thresholding

Thresholding

Thresholding and Histogram

Basic Grey level Transforms

Logarithmic Transform

Image Processing

Example

Example

Noise Estimation

Periodic Noise

Periodic Noise

Image Restoration

Correlation vs Convolution
•Both are used to extract information from images
•Both have two key features: they are Time/Shift-invariant, and linear
•Time/Shift-invariant means that we perform the same operation at
every point in the image.
•Linear means that this operation is linear, that is, we replace every pixel
with a linear combination of its neighbors.

Cross-Correlation Vs Convolution
•Correlation is the process of moving a filter mask often referred to as
kernel over the image and computing the sum of products at each
location.
•Correlation is the function of displacement of the filter.
•This is also known as aslidingdot productorsliding inner-product
•In other words, the first value of the correlation corresponds to zero
displacement of the filter, the second value corresponds to one unit
of displacement, and so on.

Cross-Correlation Vs Convolution
•Correlation is the process of moving the template or subimage w
around the image area and computing the value C in that area.
•This involves multiplying each pixel in the template by the image
pixel that it overlaps and then summing the results over all the
pixels of the template.
•The maximum value of C indicates the position where w best
matches f.

2D Correlation
•Given a square filter, we can compute the results of correlation by
aligning the center of the filter with a pixel. Then we multiply all
overlapping values together, and add up the result. We can write this
as:

Applying linear filter: Cross-Correlation

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

2D Convolution
•Convolution is just like correlation, except that we flip over the filter
before correlating.
•In the case of 2D convolution we flip the filter both horizontally and
vertically.

Cross-Correlation Vs Convolution
•In Convolution operation, the kernel is first flipped by an angle of 180
degrees and is then applied to the image.
•The fundamental property of convolution is that convolving a kernel
with a discrete unit impulse yields a copy of the kernel at the location
of the impulse.

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

Enhancement Techniques

Image Denosing: Mean filters

Image Denosing: Mean filters

Image Denosing: Harmonic & Contra-Harmonic

Image Denosing: Harmonic & Contra-Harmonic

Cross-Correlation Vs Convolution
•Correlation is the process of moving a filter mask often referred to as
kernel over the image and computing the sum of products at each
location.
•Correlation is the function of displacement of the filter.
•This is also known as aslidingdot productorsliding inner-product
•In other words, the first value of the correlation corresponds to zero
displacement of the filter, the second value corresponds to one unit
of displacement, and so on.

Cross-Correlation Vs Convolution
•Correlation is the process of moving the template or subimage w
around the image area and computing the value C in that area.
•This involves multiplying each pixel in the template by the image
pixel that it overlaps and then summing the results over all the
pixels of the template.
•The maximum value of C indicates the position where w best
matches f.

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution
•In Convolution operation, the kernel is first flipped by an angle of 180
degrees and is then applied to the image.
•The fundamental property of convolution is that convolving a kernel
with a discrete unit impulse yields a copy of the kernel at the location
of the impulse.

Cross-Correlation Vs Convolution

Cross-Correlation Vs Convolution

Enhancement Techniques

What is a Filter?

What Point operation Can’t Do!

Spatial Filter

Example: Mean of 3x3

Kernel operation

Kernel operation: Smoothing

Kernel operation: Smoothing

Kernel operation: Smoothing

Filter Matrix

Example
What this filter do?

Example 2

Mean Filter
Effect of filter size

Applying linear filter: Cross-Correlation

Computing Filter Operation

Filtering and boundary pixels
•There are a few approaches to dealing with missing edge pixels: –
•Omit missing pixels
•Only works with some filters
•Can add extra code and slow down processing
•Pad the image
• Typically with either all white or all black pixels
•Replicate border pixels
•Truncate the image
•Allow pixels wrap around the image
• Can cause some strange image artefacts

Filtering and boundary pixels

Filtering and boundary pixels

Filtering and boundary pixels

Filtering and boundary pixels

Image Filtering
•Filtering operation:
•Linear : a convolution operation between f(x,y) and a window
function w(x,y).
•A filtering method is linear when the output is a weighted sum
of the input pixels.
•Non-Linear: response is based on ordering (ranking) the pixels

Linear Filters

Gaussian Filter

Difference filter

Convolution: properties

Convolution: Properties

Linear Image Filtering
- Varying the weights m(i,j), results in
different type of linear neighborhood
operations (filtering).

Linear Image Filtering
•Example: Smoothing filter:
•average all of the pixels in a neighbourhood around a central value

Weighted Smoothing filter

Impulse (Dirac) function

Impulse (Dirac) function

Box Filter

Box Filter

Box Filter

Box Filter

Box Filter

References
Tags