Download - Lecture III
![Page 1: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/1.jpg)
1
Lecture III
Shobhit NiranjanGaurav Gupta
![Page 2: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/2.jpg)
2
Convolution
Definition:
For discrete functions:
Properties Commutativity Associativity Distributivity
![Page 3: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/3.jpg)
3
Convolution The convolution is performed by sliding the mask over
the image Convolution can be used to implement many different
operators, particularly spatial filters and feature detectors.
Examples include Gaussian smoothing and Sobel edge detector
The animation graphically illustrate the convolution of two Gaussians functions.
The green curve shows the convolution of the blue and red curves and the position is indicated by the vertical green line. The gray region indicates the product f(n)g(m-n) as a function of m, so its area as a function of is precisely the convolution.
![Page 4: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/4.jpg)
4
2 D Convolution
),(),(*1),(),(1
0
1
0
nymxhnmfMN
yxhyxfM
m
N
n
![Page 5: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/5.jpg)
5
Masks - Convolution Kernels
Convolution operation in spatial domain is also called masking
a=(m-1)/2 and b=(n-1)/2, m x n (odd numbers)
For x=0,1,…,M-1 and y=0,1,…,N-1
g(x,y) w(s,t) f (x s,y t)t b
b
s a
a
![Page 6: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/6.jpg)
6
Convolution Kernels for Image Enhancement
![Page 7: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/7.jpg)
7
Correlation It is used to measure the similarity between images
or parts of images.
Definition:
The greater the similarity between the template and the image in a particular location, the greater the value resulting from the correlation.
),(),(*1),(),(1
0
1
0
nymxhnmfMN
yxhyxfM
m
N
n
![Page 8: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/8.jpg)
8
Correlation
If the two functions f and g contain similar features, but at a different position, the correlation function will have a large value at a vector corresponding to the shift in the position of the feature.
![Page 9: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/9.jpg)
9
Fourier Transforms and Applications
![Page 10: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/10.jpg)
10
Fourier Transform
Processing images by looking at the grey level at each point in the image – Spatial Processing
Alternative representations that are more amenable for certain types of analysis
Most common image transform takes spatial data and transforms it into frequency data
![Page 11: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/11.jpg)
11
What is frequency in Images ?
FT expresses a function in terms of the sum of its projections onto a set of basis functions
In images we are concerned with spatial frequency, that is, the rate at which brightness in the image varies across the image
![Page 12: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/12.jpg)
12
![Page 13: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/13.jpg)
13
Fourier Transform Discrete Fourier Transform (DFT)
sampled Fourier Transform and therefore does not contain all frequencies forming an image
is complicated to work out as it involves many additions and multiplications involving complex numbers.
![Page 14: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/14.jpg)
14
Fourier Transform
In many applications phase information is discarded
In case of images, phase information must not be ignored – phase carries major information
![Page 15: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/15.jpg)
15
![Page 16: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/16.jpg)
16
Why is phase important !
![Page 17: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/17.jpg)
17
Qualitative Filters
F G
=
=
=
H
Low-pass
High-pass
Band-pass
![Page 18: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/18.jpg)
18
Low-Pass Filtered Image
![Page 19: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/19.jpg)
19
High-Pass Filtered Image
![Page 20: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/20.jpg)
20
low-pass filter
high-pass filter
no filter
![Page 21: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/21.jpg)
21
band-pass filter
no filter
![Page 22: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/22.jpg)
22
Summary:
Distance or size in spatial domain correlates inversely with frequency in frequency domain. Consequently, small structures in an image are said to have high spatial frequency, and the resolution capability of a camera is often expressed by means of the Nyquist frequency, that is, the highest frequency that the system can “see.”
Understanding that low frequencies correspond to large, uniform objects and that high frequencies correspond to small objects or sudden variations in count levels (e.g., at the edge of an object), one realizes the desirability of developing tools that enhance or deemphasize specific characteristics of an image. Filters are such tools.
![Page 23: Lecture III](https://reader036.vdocuments.us/reader036/viewer/2022070503/56815d8e550346895dcba0ca/html5/thumbnails/23.jpg)
23
Brainstorming Try installing OpenCV as mentioned in last lecture.
In the meantime, try playing around with inbuilt MATLAB demos on topic covered till now.
So as to be able to apply concepts to practical problems,
you need to have your concepts fine-tuned. Matlab demos would be of great help. Try changing parameters, observe variations in results, and try to understand why !