Lecture-4.ppt - • • Pyrramids Lecture-4 Comments •...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • • Pyrramids Lecture-4 Comments • Horn-Schunck optical method (Algorithm1) 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. • • 1 • • Pyramids • Very useful for representing images. • Pyramid is built by using multiple copies of image. • Each level in the pyramid is 1/4 of the size of previous level. • The lowest level is of the highest resolution. • The highest level is of the lowest resolution. Pyramid • • 2 • • Gaussian Pyramids g l (i, j ) = 2 2 Â Â w(m, n) g l -1 (2i + m,2 j + n) m = -2n = -2 g l = REDUCE[ g l -1 ] Convolution • • 3 • • Gaussian Pyramids g l ,n (i, j ) = 2 2 Â Â w( p, q) g p = -2q = -2 l , n -1 ( i- p j-q , ) 2 2 g l ,n = EXPAND[ g l ,n -1 ] Reduce (1D) g l (i) = 2 ˆ Â w(m) g l -1 (2i + m) m = -2 ˆ ˆ ˆ g l (2) = w(-2) g l -1 (4 - 2) + w(-1) g l -1w(4 - 1) + ˆ ˆ ˆ w(0) g l -1 (4) + w(1) g l -1 (4 + 1) + w(2) g l -1 (4 + 2) ˆ ˆ ˆ g l (2) = w(-2) g l -1 (2) + w(-1) g l -1w(3) + ˆ ˆ ˆ w(0) g l -1 (4) + w(1) g l -1 (5) + w(2) g l -1 (6) • • 4 • • Reduce Expand (1D) g l ,n (i ) = 2 ˆ Â w( p) gl ,n-1 ( p = -2 i- p ) 2 4-2 4 -1 ˆ ) + w(-1) g l ,n -1 ( )+ 2 2 4 4 +1 4+2 ˆ ˆ ˆ w(0) g l ,n -1 ( ) + w(1) g l ,n -1 ( ) + w(2) g l ,n -1 ( ) 2 1 2 ˆ g l ,n (4) = w(-2) g l ,n -1 ( ˆ ˆ ˆ g l ,n (4) = w(-2) g l ,n -1 (1) + w(0) g l ,n -1 (2) + w(2) g l ,n -1 (3) • • 5 • • Expand (1D) g l ,n (i ) = 2 ˆ Â w( p) gl ,n-1 ( p = -2 i- p ) 2 3- 2 3 -1 ˆ ) + w(-1) g l ,n -1 ( )+ 2 2 3 3 +1 3+ 2 ˆ ˆ ˆ w(0) g l ,n -1 ( ) + w(1) g l ,n -1 ( ) + w(2) g l ,n -1 ( ) 2 1 2 ˆ g l ,n (3) = w(-2) g l ,n -1 ( ˆ ˆ g l ,n (3) = w(-1) g l ,n -1 (1) + w(1) g l ,n -1 (2) Expand • • 6 • • Convolution Mask [ w(-2), w(-1), w(0), w(1), w(2)] Convolution Mask • Separable ˆ ˆ w(m, n) = w(m) w(n) •Symmetric ˆ ˆ w(i ) = w(-i ) [c, b, a, b, c] • • 7 • • Convolution Mask • The sum of mask should be 1. a + 2b + 2c = 1 •All nodes at a given level must contribute the same total weight to the nodes at the next higher level. a + 2c = 2b c c bb • a • 8 • • Convolution Mask $ w(0) = a 1 4 1a $ $ w ( -2 ) = w ( 2 ) = 42 $ $ w( -1) = w(1) = a=.4 GAUSSIAN, a=.5 TRINGULAR Triangular 0.5 0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 • Triangular c b a b c • 9 • • Approximate Gaussian 0.4 0.35 0.3 0.25 Gaussian 0.2 0.15 0.1 0.05 0 c b a b c Gaussian g ( x) = e • - x2 2o 2 • 10 • • Gaussian g ( x) = e x -3 -2 .011 .13 - x2 2o 2 -1 0 1 2 3 .6 1 .6 .13 .011 g(x) • • 11 • • Separability Algorithm • Apply 1-D mask to alternate pixels along each row of image. • Apply 1-D mask to each pixel along alternate columns of resultant image from previous step. • • 12 • • Gaussian Pyramid Laplacian Pyramids • Similar to edge detected images. • Most pixels are zero. • Can be used for image compression. L1 = g1 - EXPAND[ g 2 ] L2 = g 2 - EXPAND[ g 3 ] L3 = g 3 - EXPAND[ g 4 ] • • 13 • • Coding using Laplacian Pyramid •Compute Gaussian pyramid g1 , g 2 , g 3 , g 4 •Compute Laplacian pyramid L1 = g1 - EXPAND[ g 2 ] L2 = g 2 - EXPAND[ g 3 ] L3 = g 3 - EXPAND[ g 4 ] L4 = g 4 •Code Laplacian pyramid • • 14 • • Decoding using Laplacian pyramid • Decode Laplacian pyramid. • Compute Gaussian pyramid from Laplacian pyramid. g 4 = L4 g 3 = EXPAND[ g 4 ] + L3 g 2 = EXPAND[ g 3 ] + L2 g1 = EXPAND[ g 2 ] + L1 • g1 is reconstructed image. Gaussian • Most natural phenomenon can be modeled by Gaussian. • Take a bunch of random variables of any distribution, find the mean, the mean will approach to Gaussian distribution. • Gaussian is very smooth function, it has infinite no of derivatives. • • 15 • • Gaussian • Fourier Transform of Gaussian is Gaussian. • If you convolve Gaussian with itself, it is again Gaussian. • There are cells in human brain which perform Gaussian filtering. – Laplacian of Gaussian edge detector Carl F. Gauss • Born to a peasant family in a small town in Germany. • Learned counting before he could talk. • Contributed to Physics, Mathematics, Astronomy,… • Discovered most methods in modern mathematics, when he was a teenager. • • 16 • • Carl F. Gauss • Some contributions – Gaussian elimination for solving linear systems – Gauss-Seidel method for solving sparse systems – Gaussian curvature – Gaussian quadrature Laplacian Pyramid • • 17 • • Image Compression (Entropy) 7.6 4.4 .77 1.9 5.0 5.6 3.3 6.2 4.2 Huffman Coding (Example-1) 0 A1 P=.5 A2 A3 P=.25 P=.125 A4 P=.125 • 0 1 0 1 1 A1 0 A2 10 A3 110 A4 111 • 18 • • Huffman Coding 255 Entropy H = -Â p (i ) log 2 p (i ) i =0 H = -.5 log .5 - .25 log .25 - .125 log .125 .125 log .125 = 1.75 Image Compression 1.58 1 .73 • • 19 • • Combining Apple & Orange Combining Apple & Orange • • 20 • • 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. • http://ww-bcs.mit.edu/people/adelson/papers.html – The Laplacian Pyramid as a compact code, Burt and Adelson, IEEE Trans on Communication, 1983. • • 21 • • Algorithm-2 (Optical Flow) • Create Gaussian pyramid of both frames. • Repeat – apply algorithm-1 at the current level of pyramid. – propagate flow by using bilinear interpolation to the next level, where it is used as an initial estimate. – Go back to step 2 • • 22 ...
View Full Document

This note was uploaded on 06/12/2011 for the course CAP 6411 taught by Professor Shah during the Spring '09 term at University of Central Florida.

Ask a homework question - tutors are online