6_2DConvolution

6_2DConvolution - EE 211A Fall Quarter, 2011 Instructor:...

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: EE 211A Fall Quarter, 2011 Instructor: John Villasenor Digital Image Processing I Handout 6 2D Convolution as an Array Multiplication: Example Find x(m, n) ∗ h(m, n) where 3 0 4 3 x(m, n) = ↑ 1 2 1, h(m, n) = →m n ↑ 0 2 1 −1 −1 → n m Step 1: Write x, h as matrices ⎡ྎ1 0 ⎤ྏ X ʹȃ = ⎢ྎ2 4⎥ྏ, ⎢ྎ ⎥ྏ ⎢ྎ1 3 ⎥ྏ ⎣ྏ ⎦ྏ 2 3⎤ྏ ⎡ྎ 1 h = ⎢ྎ 1 − 0⎥ྏ ⎣ྏ− 1 ⎦ྏ 3columns 2 columns y = x ∗ h will have 2 + 3 – 1 = 4 columns, 3 + 2 – 1 = 4 rows. Step 2: Express x(m, n) as column-oriented vector ⎡ྎ1 ⎤ྏ ⎢ྎ2⎥ྏ ⎢ྎ ⎥ྏ ⎡ྎ X 0 ⎤ྏ ⎢ྎ1 ⎥ྏ X = ⎢ྎ ⎥ྏ = ⎢ྎ ⎥ྏ ⎢ྎ X 1 ⎥ྏ ⎢ྎ0⎥ྏ ⎣ྏ ⎦ྏ ⎢ྎ4⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ3⎥ྏ ⎣ྏ ⎦ྏ Step 3: Form matrices H n :Each H n contains the elements from the column n of h. Number of columns of H n = Number of rows of x. Number of rows of H n = Number of rows of y. H is a block matrix containing H n . 1 ⎡ྎ ← a blocks →⎤ྏ ⎢ྎ ⎥ྏ ⎢ྎ ↑ ⎥ྏ , H is ⎢ྎb blocks ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ ↓ ⎥ྏ ⎣ྏ ⎦ྏ a : number of columns of x b : number of columns of y Let column i of y be yi . ⎡ྎ H 0 ⎡ྎ y 0 ⎤ྏ ⎢ྎ ⎢ྎ y ⎥ྏ ⎢ྎ H 1 1 ⎥ྏ ⎢ྎ = ⎢ྎ ⎢ྎ y 2 ⎥ྏ ⎢ྎ H 2 ⎢ྎ ⎥ྏ ⎢ྎ[0] ⎣ྏ y 3 ⎦ྏ ⎣ྏ 0 0 ⎡ྎ 1 ⎢ྎ− 1 1 0 ⎢ྎ ⎢ྎ 0 − 1 1 ⎢ྎ 0 −1 ⎢ྎ 0 ⎢ྎ 2 0 0 ⎢ྎ ⎢ྎ− 1 2 0 ⎢ྎ 0 − 1 2 ⎢ྎ 0 −1 ⎢ྎ 0 ⎢ྎ 3 0 0 ⎢ྎ ⎢ྎ 0 30 ⎢ྎ 0 3 ⎢ྎ 0 ⎢ྎ 0 0 0 ⎢ྎ 0 0 ⎢ྎ 0 ⎢ྎ 0 0 0 ⎢ྎ 0 0 ⎢ྎ 0 ⎢ྎ 0 0 0 ⎣ྏ [0] ⎤ྏ H 0 ⎥ྏ ⎡ྎ X 0 ⎤ྏ ⎥ྏ ⋅ ⎢ྎ ⎥ྏ H 1 ⎥ྏ ⎢ྎ X 1 ⎥ྏ ⎥ྏ ⎣ྏ ⎦ྏ H 2 ⎥ྏ ⎦ྏ 0 0 0 ⎤ྏ ⎡ྎ 1 ⎤ྏ ⎥ྏ ⎢ྎ 1 ⎥ྏ 0 0 0 ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ − 1 ⎥ྏ 0 0 0 ⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ 0 0 0 ⎥ྏ ⎢ྎ − 1 ⎥ྏ ⎢ྎ 2 ⎥ྏ 1 0 0 ⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ −1 1 0 ⎥ྏ ⎡ྎ1 ⎤ྏ ⎢ྎ 7 ⎥ྏ ⎢ྎ − 1 ⎥ྏ 0 − 1 1 ⎥ྏ ⎢ྎ2⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ ⎥ྏ 0 0 − 1⎥ྏ ⎢ྎ1 ⎥ྏ ⎢ྎ − 4 ⎥ྏ ⋅ ⎢ྎ ⎥ྏ = ⎢ྎ 20 0 ⎥ྏ ⎢ྎ0 ⎥ྏ 3 ⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ 14 ⎥ྏ − 1 2 0 ⎥ྏ ⎢ྎ4⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ ⎢ྎ ⎥ྏ 0 − 1 2 ⎥ྏ ⎢ྎ3 ⎥ྏ ⎣ྏ ⎦ྏ ⎢ྎ 5 ⎥ྏ ⎢ྎ − 3 ⎥ྏ 0 0 − 1⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ 30 0 ⎥ྏ ⎢ྎ 0 ⎥ྏ ⎢ྎ 12 ⎥ྏ 0 3 0 ⎥ྏ ⎥ྏ ⎢ྎ ⎥ྏ 0 0 3 ⎥ྏ ⎢ྎ 9 ⎥ྏ ⎢ྎ 0 ⎥ྏ 0 0 0 ⎥ྏ ⎦ྏ ⎢ྎ ⎥ྏ 0 12 9 0 2 3 0 ⎤ྏ ⎡ྎ 1 3 14 5 − 3 ⎢ྎ 1 7 14 12 ⎥ྏ ⎥ྏ, ⇒ y (m, n) = n 2 7 − 1 − 4 ⇒ y = ⎢ྎ ⎢ྎ− 1 − 1 5 9 ⎥ྏ ↑ 1 1 −1 −1 ⎢ྎ ⎥ྏ ⎣ྏ− 1 − 4 − 3 0 ⎦ྏ →m 2 ...
View Full Document

This note was uploaded on 12/27/2011 for the course EE211A 211A taught by Professor Villasenor during the Spring '11 term at UCLA.

Ask a homework question - tutors are online