Download presentation
Presentation is loading. Please wait.
1
Lecture: Image manipulations (2) Filters and kernels
Alireza Akhavan Pour CLASS.VISION سه شنبه - ۸ اسفند ۱۳۹۶
2
Image Manipulations (Part 2)
1. Intro to Convolution 2. Blurring 3.Sharpening 4. Dilation, Erosion, Opening and Closing 5. Edge Detection & Image Gradients سه شنبه - ۸ اسفند ۱۳۹۶
3
Filter example #1: Moving Average
2D DS moving average over a 3 × 3 window of neighborhood h 1 سه شنبه - ۸ اسفند ۱۳۹۶
4
Filter example #1: Moving Average
90 90 Courtesy of S. Seitz سه شنبه - ۸ اسفند ۱۳۹۶
5
Filter example #1: Moving Average
90 90 10 5 سه شنبه - ۸ اسفند ۱۳۹۶
6
Filter example #1: Moving Average
90 90 10 20 سه شنبه - ۸ اسفند ۱۳۹۶
7
Filter example #1: Moving Average
90 90 10 20 30 سه شنبه - ۸ اسفند ۱۳۹۶
8
90 10 20 30 سه شنبه - ۸ اسفند ۱۳۹۶
9
Filter example #1: Moving Average
90 10 20 30 40 60 90 50 80 Source: S. Seitz سه شنبه - ۸ اسفند ۱۳۹۶
10
Filter example #1: Moving Average
In summary: This filter “Replaces” each pixel with an average of its neighborhood. Achieve smoothing effect (remove sharp features) 1 سه شنبه - ۸ اسفند ۱۳۹۶
11
Filter example #1: Moving Average
سه شنبه - ۸ اسفند ۱۳۹۶
12
2D convolution Assume we have a filter(h[,]) that is 3x3. and an image (f[,]) that is 7x7. سه شنبه - ۸ اسفند ۱۳۹۶
13
2D convolution Assume we have a filter(h[,]) that is 3x3. and an image (f[,]) that is 7x7. سه شنبه - ۸ اسفند ۱۳۹۶
14
2D convolution Assume we have a filter(h[,]) that is 3x3. and an image (f[,]) that is 7x7. سه شنبه - ۸ اسفند ۱۳۹۶
15
2D convolution Assume we have a filter(h[,]) that is 3x3. and an image (f[,]) that is 7x7. سه شنبه - ۸ اسفند ۱۳۹۶
16
2D convolution Assume we have a filter(h[,]) that is 3x3. and an image (f[,]) that is 7x7. سه شنبه - ۸ اسفند ۱۳۹۶
17
2D convolution Assume we have a filter(h[,]) that is 3x3. and an image (f[,]) that is 7x7. سه شنبه - ۸ اسفند ۱۳۹۶
18
2D convolution example سه شنبه - ۸ اسفند ۱۳۹۶
19
2D convolution example Slide credit: Song Ho Ahn
سه شنبه - ۸ اسفند ۱۳۹۶
20
2D convolution example Slide credit: Song Ho Ahn
سه شنبه - ۸ اسفند ۱۳۹۶
21
2D convolution example Slide credit: Song Ho Ahn
سه شنبه - ۸ اسفند ۱۳۹۶
22
سه شنبه - ۸ اسفند ۱۳۹۶
23
Slide credit: Song Ho Ahn
سه شنبه - ۸ اسفند ۱۳۹۶
24
2D convolution example سه شنبه - ۸ اسفند ۱۳۹۶
25
1 ? = * Original Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
26
Convolution in 2D - examples
1 = * Original Filtered (no change) Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
27
Convolution in 2D - examples
1 ? = * Original Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
28
Convolution in 2D - examples
1 = * Original Shifted right By 1 pixel Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
29
? 1 = * Original Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
30
Convolution in 2D - examples
1 = * Original Blur (with a box filter) Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
31
- = ? - 2 1 1 1 1 (Note that filter sums to 1) Original
2 1 = ? (Note that filter sums to 1) Original “details of the image” - 1 1 1 + Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
32
What does blurring take away?
detail – = original smoothed (5x5) Let’s add it back: original detail sharpened + a = سه شنبه - ۸ اسفند ۱۳۹۶
33
Convolution in 2D – Sharpening filter
- 2 1 = Original Sharpening filter: Accentuates differences with local average Courtesy of D Lowe سه شنبه - ۸ اسفند ۱۳۹۶
34
Image support and edge effect
A computer will only convolve finite support signals. What happens at the edge? • zero “padding” • edge value replication • mirror extension • more (beyond the scope of this class) -> Matlab conv2 uses zero-padding f h سه شنبه - ۸ اسفند ۱۳۹۶
35
Convolution vs. (Cross) Correlation
A convolution is an integral that expresses the amount of overlap of one function as it is shifted over another function. convolution is a filtering operation Correlation compares the similarity of two sets of data. Correlation computes a measure of similarity of two input signals as they are shifted by one another. The correlation result reaches a maximum at the time when the two signals match best . correlation is a measure of relatedness of two signals سه شنبه - ۸ اسفند ۱۳۹۶
36
What about OpenCV? Convolution or (Cross) Correlation?
سه شنبه - ۸ اسفند ۱۳۹۶
37
https://en.wikipedia.org/wiki/Kernel_(image_processing)
سه شنبه - ۸ اسفند ۱۳۹۶
38
سه شنبه - ۸ اسفند ۱۳۹۶
39
سه شنبه - ۸ اسفند ۱۳۹۶
40
سه شنبه - ۸ اسفند ۱۳۹۶
41
سه شنبه - ۸ اسفند ۱۳۹۶
42
سه شنبه - ۸ اسفند ۱۳۹۶
43
منابع http://vision.stanford.edu/teaching/cs131_fall1718/
سه شنبه - ۸ اسفند ۱۳۹۶
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.