1 / 28

Convolution

Convolution. CS474/674 – Prof. Bebis Section 3.4, 4.2. Output Image. Correlation - Review. K x K. Convolution – Review (cont’d). Same as correlation except that the mask is flipped both horizontally and vertically.

Download Presentation

Convolution

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Convolution CS474/674 – Prof. Bebis Section 3.4, 4.2

  2. Output Image Correlation - Review K x K

  3. Convolution – Review (cont’d) • Same as correlation except that the mask is flipped both horizontally and vertically. • Note that if w(x,y) is symmetric, that is w(x,y)=w(-x,-y), then convolution is equivalent to correlation!

  4. 1D Continuous Convolution - Definition • Convolution is defined as follows: • Convolution is commutative

  5. Example 1

  6. Example 2 • Suppose we want to compute the convolution of the following two functions:

  7. Example 2 (cont’d)

  8. Example 2 (cont’d) Step 3:

  9. Example 2 (cont’d)

  10. Example 2 (cont’d)

  11. Example 2 (cont’d)

  12. Example 2 (cont’d)

  13. Example 2 (cont’d)

  14. Important Observations • The extent of f(x) * g(x) is equal to the extent of f(x) plus the extent of g(x) • For every x, the limits of the integral are determined as follows: • Lower limit: MAX (left limit of f(x), left limit of g(x-a)) • Upper limit: MIN (right limit of f(x), right limit of g(x-a))

  15. Example 3 α α

  16. Convolution with an impulse (i.e., delta function)

  17. Convolution with an “train” of impulses =

  18. Convolution Theorem • Convolution in the spatial domain is equivalent to multiplication in the frequency domain. • Multiplication in the spatial domain is equivalent to convolution in the frequency domain. f(x) F(u) g(x) G(u)

  19. Efficient computation of (f * g) • 1. Compute and • 2. Multiply them: • 3. Compute the inverse FT: (i.e., complex multiplication)

  20. Discrete Convolution • Replace integral with summation • Integration variable becomes an index. • Displacements take place in discrete increments

  21. Discrete Convolution (cont’d) 3 samples 5 samples g - 1)

  22. Convolution Theorem in Discrete Case • Input sequences: • Length of output sequence: • Extended input sequences (i.e., pad with zeroes)

  23. Convolution Theorem in Discrete Case (cont’d) • When dealing with discrete sequences, the convolution theorem holds true for the extended sequences only!! In general, we can choose

  24. Why? continuous case discrete case The convolution of discrete sequences is a periodic function (with period M) since the DFT is periodic

  25. Why? (cont’d) Α+Β+1 Α+Β+1 If M<A+B-1, the periods will overlap If M>=A+B-1, the periods will not overlap

  26. 2D Convolution • Definition • 2D convolution theorem

  27. Discrete 2D convolution • Suppose f(x,y) is A x B and g(x,y) is C x D • The size of f(x,y) * g(x,y) would be N x M where N=A+C-1 and M=B+D-1 • Form extended images (i.e., pad with zeroes):

  28. Discrete 2D convolution (cont’d) • The convolution theorem holds true for the extended images only.

More Related