430 likes | 589 Vues
Machine Vision. Lecture 07 – Pyramids. Dr. J. Shanbehzadeh Shanbehzadeh@gmail.com M.HosseinKord. Science and Research Branch of Islamic Azad University. 1/49 slides. Table of Contents. 7-1-1) Reduce 7-1-2) Expand. 7-4) Interpolation. 7-3-1) Image compression
E N D
Machine Vision Lecture 07 – Pyramids Dr. J. Shanbehzadeh Shanbehzadeh@gmail.com M.HosseinKord Science and Research Branch of Islamic Azad University 1/49 slides
Table of Contents 7-1-1) Reduce 7-1-2) Expand 7-4) Interpolation 7-3-1) Image compression 7-3-2) Image composting
7-1)Gaussian Pyramids Lowest Resolution 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids . . . Original Img Highest Resolution
7-1-1) Reduce 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids Level l Level l-1
7-1-1) Reduce- Convolution 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
7-1-1) Reduce (1D):Example Convolution Mask: [w(-2), w(-1), w(0), w(1), w(2)] 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids i = 2
Convolution Mask: [w(-2), w(-1), w(0), w(1), w(2)] [ c , b , a , b , c ] 7-1-1) Reduce (1D) 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids gl = REDUCE (gl-1)
7-1-2) Expand 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids n=1 n=2 Notice:
7-1-2) Expand(1D) [w(-2), w(-1), w(0), w(1), w(2)] [ c , b , a , b , c ] 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids i = 4 Involved weights [c , a , c]
7-1-2) Expand(1D) [w(-2), w(-1), w(0), w(1), w(2)] [ c , b , a , b , c ] 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids i = 3 Involved weights [b , b]
Expand 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Convolution Mask 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids • Separable • •Symmetric
Convolution Mask 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids • The sum of mask should be 1. •All nodes at a given level must contribute the same total weight to the nodes at the next higher level.
Convolution Mask 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids c a b c b a + 2b + 2c = 1 a + 2c = 2b b= ¼
Convolution Mask 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids a= 0.4 GAUSSIAN a= 0.5 TRINGULAR
Gaussian Mask 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Gaussian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Gaussian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Laplacian Pyramids 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids • Similar to edge detected images. • Most pixels are zero. • Can be used for image compression. L1 = g1 – EXPAND[g2] L2 = g2 – EXPAND[g3] L3 = g3 – EXPAND[g4] • L4= g4
Laplacian Pyramids L1 = g1 – EXPAND[g2] L2 = g2 – EXPAND[g3] L3 = g3 – EXPAND[g4] • L4= g4 Lower in size and resolution 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids Gaussian Pyramid Laplacian Pyramid
Image compression •Compute Gaussian pyramid •Compute Laplacian pyramid •Code Laplacian pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Image compression 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids • Decode Laplacian pyramid. • Compute Gaussian pyramid from Laplacian pyramid. • g1 is reconstructed image.
Image Compression (Entropy) 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids 7.6 4.4 0.77 5.0 1.9 5.6 3.3 6.2 4.2
Image Compression 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids 1.58 0.73
Combining Apple & Orange 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Algorithm • • Generate Laplacian pyramid Lo of orange image. • • Generate Laplacian pyramid La of apple • image. • • Generate Laplacian pyramid Lc by • – copying left half of nodes at each level from apple • and • – right half of nodes from orange pyramids. • • Reconstruct combined image from Lc. 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Interpolation 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
1‐D Interpolation 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids 1=< x =<2
2‐D Interpolation 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids Bilinear
Bi‐linear Interpolation 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Why Lucas Kanade with Pyramids? • Horn-Schunck and Lucas-Kanade optical method works only for small motion. • If object moves faster, the brightness changes rapidly, 2x2 or 3x3 masks fail to estimate spatiotemporal derivatives. • Pyramids can be used to compute large optical flow vectors. 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Lucas Kanade with Pyramids Lucas Kanade Lucas Kanade 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids Interpolation LK for highest level of Laplacian pyramid ui , vi Do the interpolation u*i-1 , v*i-1 Multiply by 2 u*i-1 , v*i-1 Calculate ft according to displacement of u*i-1 , v*i-1 LK for level l-1 of Laplacian pyramid u’i-1 , v’i-1 Accurate value of Optical flow is ui-1 = u*i-1 + u’i-1 vi-1 = v*i-1 + v’i-1
Laplacian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Laplacian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Laplacian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Laplacian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids
Laplacian Pyramid 7-1) Gaussian Pyramids 7-1-1) Reduce 7-1-2) Expand 7-1-3) Convolution Mask 7-2) Laplacian Pyramids 7-3) Applications of Laplacian pyramids 7-3-1) Image compression 7-3-2) Image composting 7-4) interpolation 7-5) Optical flow using Pyramids