810 likes | 824 Vues
3-D Computer Vision CSc 83020. Image Processing I/Filtering. Image Processing I/Filtering. Convolution (1-D) Linear Shift Invariant Systems Convolution (2-D) Application: Noise: Filtering: Averaging, Smoothing, Median. Convolution (Important!). =. h. f. g.
E N D
3-D Computer VisionCSc 83020 Image Processing I/Filtering 3-D Computer Vision 83020 – Ioannis Stamos
Image Processing I/Filtering • Convolution (1-D) • Linear Shift Invariant Systems • Convolution (2-D) • Application: Noise: • Filtering: Averaging, Smoothing, Median.. 3-D Computer Vision 83020 – Ioannis Stamos
Convolution (Important!) = h f g Used for: Derivatives, Edges, Matching, … 3-D Computer Vision 83020 – Ioannis Stamos
Convolution = h f g 3-D Computer Vision 83020 – Ioannis Stamos
Convolution f(ξ) x ξ h(ξ) 3-D Computer Vision 83020 – Ioannis Stamos
Convolution f(ξ) x ξ h(ξ) h(-ξ) 3-D Computer Vision 83020 – Ioannis Stamos
Convolution f(ξ) x ξ h(ξ) h(-ξ) h(x-ξ) x ξ
Convolution f(ξ) h(x-ξ) x ξ f(ξ) *h(x-ξ) x ξ g(x) : area under curve 3-D Computer Vision 83020 – Ioannis Stamos
Convolution f(ξ) h(x-ξ) x ξ f(ξ) *h(x-ξ) ξ x g(x) : area under curve Calculate g(x) for all x!!
Convolution g(x) x f(x) h(x) Calculate g(x) for all x!! => g(x): 1-D function 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(ξ) 1 1 ξ ξ -1 1 -1 1 c = a * b ? 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x<-2 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x=-2 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x -2<x<-1 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x -2<x<-1 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x=-1 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x -1<x<0 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x=0 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x 0<x<1 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x=1 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x 1<x<2 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x=2 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(-ξ) 1 1 ξ ξ -1 1 -1 1 a(ξ) 1 b(x-ξ) ξ -1 1 x x>2 3-D Computer Vision 83020 – Ioannis Stamos
Example a(ξ) b(ξ) 1 1 ξ ξ -1 1 -1 1 c = a * b c(x) 1 x -2 -1 1 2 3-D Computer Vision 83020 – Ioannis Stamos
Properties of Convolution • Commutativity: b * a = a * b. • Associativity: (a * b) * c = a * (b * c) • Cascaded system g f h1 h2 g f h1*h2 Equivalent Systems g f h2*h1 3-D Computer Vision 83020 – Ioannis Stamos
Convolution Discrete f(ξ) m m1 m2 ξ h(ξ) n1 n2 Discrete samples of continuous signal. Sampling at regular intervals. Example : Scanline 3-D Computer Vision 83020 – Ioannis Stamos
Convolution Discrete f(ξ) m-n2 m m-n1 m1 m2 ξ h(ξ) n1 n2 3-D Computer Vision 83020 – Ioannis Stamos
One Scan Line: 1-D discrete signal f(ξ), m1=0, m2=450. 0 450 3-D Computer Vision 83020 – Ioannis Stamos
One Scan Line: 1-D discrete signal f(ξ), m1=0, m2=450. 1/9 0 450 f*h = ? -4 4 h(ξ), n1=-4, n2=4. 3-D Computer Vision 83020 – Ioannis Stamos
One Scan Line: 1-D discrete signal f(ξ) 1/9 h(m- ξ) m-4 m m+4 0 450 m f*h = ?
One Scan Line: 1-D discrete signal f(ξ) 1/9 h(m- ξ) m-4 m m+4 0 450 m f*h = ?
One Scan Line: 1-D discrete signal f(ξ), m1=0, m2=450. 0 450 h: filter or mask. f*h: filtered version of f. In this case h spatially averages f in a neighborhood of 9 samples.
Recap • 1-D Convolution • Continuous vs. Discrete. • Finite vs. Infinite signals (spatial domain). • Filtering. 3-D Computer Vision 83020 – Ioannis Stamos
Linear Shift Invariant Systems f(x) g(x) Linearity: f1(x) g1(x) f2(x) g2(x) af1(x)+bf2(x) ag1(x)+bg2(x) 3-D Computer Vision 83020 – Ioannis Stamos
Linear Shift Invariant Systems f(x) g(x) Shift Invariance: f(x-a) g(x-a) g(x) f(x) x x g(x) f(x-a) x a x a
Convolution Used for: Derivatives, Edges, Matching, … Convolution: LINEAR & SHIFT INVARIANT f(x) g(x) h(x) Also, any LSIS is doing a CONVOLUTION! 3-D Computer Vision 83020 – Ioannis Stamos
Properties of Convolution • Commutativity: b * a = a * b. • Associativity: (a * b) * c = a * (b * c) • Cascaded system g f h1 h2 g f h1*h2 Equivalent Systems g f h2*h1 3-D Computer Vision 83020 – Ioannis Stamos
Example of LSIS: g f Defocused image g: Processed version of Focused image f. Ideal Lens: f(x) g(x) LSIS Linearity: Brightness Variations. Shift Invariance: Scene Movement. Note: Not valid for lenses with non-linear distortions (aberrations). Study of LSIS leads to useful algorithms for processing images!
System as a black box g f h Can we find h? What f will give us g=h? 1/(2ε) δ(x) δ(x) δ(x) 1/(2ε) 1/(2ε) Decrease ε Decrease ε x x x 2ε 2ε 2ε
System as a black box δ(x) Unit Impulse Function: 1/(2ε) x -1 1 2ε Impulse Response f(x)=δ(x) h(x) IMPULSE RESPONSE 3-D Computer Vision 83020 – Ioannis Stamos
Image Formation Scene Image Optical System Point Source δ(x) Point Spread Function h(x) Optical System In an ideal system h(x)=δ(x) Optical Systems are never ideal! Human Eye: Point Spread Function…. 3-D Computer Vision 83020 – Ioannis Stamos
2-D Convolution = g(x,y) Output Image h(x,y) Filter f(x,y) Input Image
Discrete Convolution y (0,0) x g (larger than f) f h
Discrete Convolution – 2D flip 3-D Computer Vision 83020 – Ioannis Stamos
Discrete Convolution 1 2 3 4 5 4 3 2 1 2 6 10 14 16 14 10 6 2 3 10 20 28 32 28 20 10 3 4 14 28 42 48 42 28 14 4 5 16 32 48 57 48 32 16 5 4 14 28 42 48 42 28 14 4 3 10 20 28 32 28 20 10 3 2 6 10 14 16 14 10 6 2 1 2 3 4 5 4 3 2 1 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 = g f h 3-D Computer Vision 83020 – Ioannis Stamos
Discrete Convolution 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 1 2 3 4 5 4 3 2 1 2 6 10 14 16 14 10 6 2 3 10 20 28 32 28 20 10 3 4 14 28 42 48 42 28 14 4 5 16 32 48 57 48 32 16 5 4 14 28 42 48 42 28 14 4 3 10 20 28 32 28 20 10 3 2 6 10 14 16 14 10 6 2 1 2 3 4 5 4 3 2 1 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 3-D Computer Vision 83020 – Ioannis Stamos
Discrete Convolution 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 12 3 4 5 4 3 2 1 2 6 10 14 16 14 10 6 2 3 10 20 28 32 28 20 10 3 4 14 28 42 48 42 28 14 4 5 16 32 48 57 48 32 16 5 4 14 28 42 48 42 28 14 4 3 10 20 28 32 28 20 10 3 2 6 10 14 16 14 10 6 2 1 2 3 4 5 4 3 2 1 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 3-D Computer Vision 83020 – Ioannis Stamos
Discrete Convolution 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 1 2 3 4 5 4 3 2 1 2 6 10 14 16 14 10 6 2 3 10 20 28 32 28 20 10 3 4 14 28 42 48 42 28 14 4 5 16 32 48 57 48 32 16 5 4 14 28 42 48 42 28 14 4 3 10 20 28 32 28 20 10 3 2 6 10 14 16 14 10 6 2 1 2 3 4 5 4 3 2 1 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1 3-D Computer Vision 83020 – Ioannis Stamos