University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Circulant Matrices and Convolution) Digital Image Processing.

Slides:



Advertisements
Similar presentations
8.4 Matrices of General Linear Transformations
Advertisements

Applied Informatics Štefan BEREŽNÝ
Matrices A matrix is a rectangular array of quantities (numbers, expressions or function), arranged in m rows and n columns x 3y.
University of Ioannina - Department of Computer Science Wavelets and Multiresolution Processing (Background) Christophoros Nikou Digital.
Refresher: Vector and Matrix Algebra Mike Kirkpatrick Department of Chemical Engineering FAMU-FSU College of Engineering.
Eigenvalues and Eigenvectors
Linear Transformations
MSP15 The Fourier Transform (cont’) Lim, MSP16 The Fourier Series Expansion Suppose g(t) is a transient function that is zero outside the interval.
6 1 Linear Transformations. 6 2 Hopfield Network Questions.
Signals and Systems Discrete Time Fourier Series.
Input image Output image Transform equation All pixels Transform equation.
Lecture 7: Matrix-Vector Product; Matrix of a Linear Transformation; Matrix-Matrix Product Sections 2.1, 2.2.1,
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
5.1 Orthogonality.
1 Statistical Analysis Professor Lynne Stokes Department of Statistical Science Lecture 5QF Introduction to Vector and Matrix Operations Needed for the.
Linear Algebra and Image Processing
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Fundamentals) Digital Image Processing Christophoros Nikou
1 7.1 Discrete Fourier Transform (DFT) 7.2 DFT Properties 7.3 Cyclic Convolution 7.4 Linear Convolution via DFT Chapter 7 Discrete Fourier Transform Section.
Linear Algebra Review 1 CS479/679 Pattern Recognition Dr. George Bebis.
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
 Row and Reduced Row Echelon  Elementary Matrices.
MATH 250 Linear Equations and Matrices
Eigenvalues and Eigenvectors
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Matrices and Vectors Objective.
CS654: Digital Image Analysis Lecture 12: Separable Transforms.
Mathematical Preliminaries. 37 Matrix Theory Vectors nth element of vector u : u(n) Matrix mth row and nth column of A : a(m,n) column vector.
Finite-Length Discrete Transform
1 BIEN425 – Lecture 8 By the end of the lecture, you should be able to: –Compute cross- /auto-correlation using matrix multiplication –Compute cross- /auto-correlation.
Matrices CHAPTER 8.1 ~ 8.8. Ch _2 Contents  8.1 Matrix Algebra 8.1 Matrix Algebra  8.2 Systems of Linear Algebra Equations 8.2 Systems of Linear.
Lecture 7 Matrices CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 5 Eigenvalues and Eigenvectors 大葉大學 資訊工程系 黃鈴玲 Linear Algebra.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Elementary Linear Algebra Anton & Rorres, 9 th Edition Lecture Set – 02 Chapter 2: Determinants.
1 Closures of Relations: Transitive Closure and Partitions Sections 8.4 and 8.5.
Wavelets and Multiresolution Processing (Wavelet Transforms)
Fourier Analysis of Discrete Time Signals
Chapter 5 Finite-Length Discrete Transform
4.8 Rank Rank enables one to relate matrices to vectors, and vice versa. Definition Let A be an m  n matrix. The rows of A may be viewed as row vectors.
Image transformations Digital Image Processing Instructor: Dr. Cheng-Chien LiuCheng-Chien Liu Department of Earth Sciences National Cheng Kung University.
Word : Let F be a field then the expression of the form a 1, a 2, …, a n where a i  F  i is called a word of length n over the field F. We denote the.
8.4 Matrices of General Linear Transformations. V and W are n and m dimensional vector space and B and B ’ are bases for V and W. then for x in V, the.
Chapter 2 … part1 Matrices Linear Algebra S 1. Ch2_2 2.1 Addition, Scalar Multiplication, and Multiplication of Matrices Definition A matrix is a rectangular.
Review of Matrix Operations Vector: a sequence of elements (the order is important) e.g., x = (2, 1) denotes a vector length = sqrt(2*2+1*1) orientation.
Chapter 2 Determinants. With each square matrix it is possible to associate a real number called the determinant of the matrix. The value of this number.
Matrices and Determinants
By Josh Zimmer Department of Mathematics and Computer Science The set ℤ p = {0,1,...,p-1} forms a finite field. There are p ⁴ possible 2×2 matrices in.
Matrices and Matrix Operations. Matrices An m×n matrix A is a rectangular array of mn real numbers arranged in m horizontal rows and n vertical columns.
4.8 Rank Rank enables one to relate matrices to vectors, and vice versa. Definition Let A be an m  n matrix. The rows of A may be viewed as row vectors.
STROUD Worked examples and exercises are in the text Programme 5: Matrices MATRICES PROGRAMME 5.
A function is a rule f that associates with each element in a set A one and only one element in a set B. If f associates the element b with the element.
1 Chapter 8 – Symmetric Matrices and Quadratic Forms Outline 8.1 Symmetric Matrices 8.2Quardratic Forms 8.3Singular ValuesSymmetric MatricesQuardratic.
Chapter 13 Discrete Image Transforms
STROUD Worked examples and exercises are in the text PROGRAMME 5 MATRICES.
1 Objective To provide background material in support of topics in Digital Image Processing that are based on matrices and/or vectors. Review Matrices.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
2.1 Matrix Operations 2. Matrix Algebra. j -th column i -th row Diagonal entries Diagonal matrix : a square matrix whose nondiagonal entries are zero.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
College Algebra Chapter 6 Matrices and Determinants and Applications
CS479/679 Pattern Recognition Dr. George Bebis
Eigenvalues and Eigenvectors
CSCI N207 Data Analysis Using Spreadsheet
Symmetric Matrices and Quadratic Forms
Maths for Signals and Systems Linear Algebra in Engineering Lectures 13 – 14, Tuesday 8th November 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR)
Linear Algebra review (optional)
Eigenvalues and Eigenvectors
Linear Algebra: Matrix Eigenvalue Problems – Part 2
Chapter 2 Determinants.
Symmetric Matrices and Quadratic Forms
Presentation transcript:

University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Circulant Matrices and Convolution) Digital Image Processing Christophoros Nikou

2 C. Nikou – Digital Image Processing (E12) Toeplitz matrices Elements with constant value along the main diagonal and sub-diagonals. For a NxN matrix, its elements are determined by a ( 2N-1)- length sequence

3 C. Nikou – Digital Image Processing (E12) Toeplitz matrices (cont.) Each row (column) is generated by a shift of the previous row (column). −The last element disappears. −A new element appears.

4 C. Nikou – Digital Image Processing (E12) Circulant matrices Elements with constant value along the main diagonal and sub-diagonals. For a NxN matrix, its elements are determined by a N- length sequence

5 C. Nikou – Digital Image Processing (E12) Circulant matrices (cont.) Special case of a Toeplitz matrix. Each row (column) is generated by a circular shift (modulo N ) of the previous row (column).

6 C. Nikou – Digital Image Processing (E12) Convolution by matrix-vector operations 1-D linear convolution between two discrete signals may be expressed as the product of a Toeplitz matrix constructed by the elements of one of the signals and a vector constructed by the elements of the other signal. 1-D circular convolution between two discrete signals may be expressed as the product of a circulant matrix constructed by the elements of one of the signals and a vector constructed by the elements of the other signal. Extension to 2D signals.

7 C. Nikou – Digital Image Processing (E12) 1D linear convolution using Toeplitz matrices The linear convolution g[n]=f [n]*h [n] will be of length N=N 1 +N 2 -1=3+2-1=4. We create a Toeplitz matrix H from the elements of h [n] (zero-padded if needed) with − N=4 lines (the length of the result). − N 1 =3 columns (the length of f [n] ). −The two signals may be interchanged.

8 C. Nikou – Digital Image Processing (E12) 1D linear convolution using Toeplitz matrices (cont.) Length of f [n] = 3 Length of the result = 4 Notice that H is not circulant (e.g. a -1 appears in the second line which is not present in the first line. Zero-padded h[n] in the first column

9 C. Nikou – Digital Image Processing (E12) 1D linear convolution using Toeplitz matrices (cont.)

10 C. Nikou – Digital Image Processing (E12) 1D circular convolution using circulant matrices The circular convolution g[n]=f [n]  h [n] will be of length N=max{N 1, N 2 }=3. We create a circulant matrix H from the elements of h [n] (zero-padded if needed) of size NxN. −The two signals may be interchanged.

11 C. Nikou – Digital Image Processing (E12) 1D circular convolution using circulant matrices (cont.) Zero-padded h[n] in the first column

12 C. Nikou – Digital Image Processing (E12) 1D circular convolution using circulant matrices (cont.)

13 C. Nikou – Digital Image Processing (E12) Block matrices A ij are matrices. If the structure of A, with respect to its sub-matrices, is Toeplitz (circulant) then matrix A is called block-Toeplitz (block-circulant). If each individual A ij is also a Toeplitz (circulant) matrix then A is called doubly block-Toeplitz (doubly block-circulant).

14 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices m n f [m,n] m n h [m,n] M 1 =2, N 1 =3M 2 =2, N 2 =2 The result will be of size (M 1 +M 2 -1) x (N 1 +N 2 -1) = 3 x 4

15 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) At first, h[m,n] is zero-padded to 3 x 4 (the size of the result). Then, for each row of h[m,n], a Toeplitz matrix with 3 columns (the number of columns of f [m,n] ) is constructed. m n h[m,n] m n f [m,n] m n h [m,n]

16 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) For each row of h[m,n], a Toeplitz matrix with 3 columns (the number of columns of f [m,n] ) is constructed. m n h[m,n]

17 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) Using matrices H 1, H 2 and H 3 as elements, a doubly block Toeplitz matrix H is then constructed with 2 columns (the number of rows of f [m,n] ). m n f [m,n] m n h [m,n]

18 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) We now construct a vector from the elements of f [m,n]. m n f [m,n] m n h [m,n]

19 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) m n f [m,n] m n h [m,n]

20 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.)

21 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) * m n f [m,n] m n h [m,n] = 3 2 m n g [m,n]

22 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) m n f [m,n] m n 1 h [m,n] M 1 =2, N 1 =2M 2 =1, N 2 =2 The result will be of size (M 1 +M 2 -1) x (N 1 +N 2 -1) = 2 x 3 Another example

23 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) At first, h[m,n] is zero-padded to 2 x 3 (the size of the result). Then, for each line of h[m,n], a Toeplitz matrix with 2 columns (the number of columns of f [m,n] ) is constructed. m n h[m,n] m n f [m,n] m n 1 h [m,n]

24 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) For each row of h[m,n], a Toeplitz matrix with 2 columns (the number of columns of f [m,n] ) is constructed. m n h[m,n]

25 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) Using matrices H 1 and H 2 as elements, a doubly block Toeplitz matrix H is then constructed with 2 columns (the number of rows of f [m,n] ). m n f [m,n] m n 1 h [m,n]

26 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) We now construct a vector from the elements of f [m,n]. m n f [m,n] m n 1 h [m,n]

27 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) m n f [m,n] m n 1 h [m,n]

28 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.)

29 C. Nikou – Digital Image Processing (E12) 2D linear convolution using doubly block Toeplitz matrices (cont.) * = m n g [m,n] m n f [m,n] m n 1 h [m,n]

30 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices where H is a doubly block circulant matrix generated by h [m,n] and f is a vectorized form of f [m,n]. The circular convolution g[m,n]=f [m,n]  h [m,n] may be expressed in matrix-vector form as: with

31 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices (cont.) Each H j, for j=1,..M, is a circulant matrix with N columns (the number of columns of f [m,n] ) generated from the elements of the j -th row of h [m,n].

32 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices (cont.) Each H j, for j=1,..M, is a NxN circulant matrix generated from the elements of the j -th row of h [m,n].

33 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices (cont.) m n f [m,n] m n h [m,n] 

34 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices (cont.) m n f [m,n] m n h [m,n] 

35 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices (cont.)

36 C. Nikou – Digital Image Processing (E12) 2D circular convolution using doubly block circulant matrices (cont.) m n h [m,n] m n g [m,n]  = m n f [m,n] 010

37 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices Theorem: The columns of the inverse DFT matrix are eigenvectors of any circulant matrix. The corresponding eigenvalues are the DFT values of the signal generating the circulant matrix. Proof: Let be the DFT basis elements of length N with:

38 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) We know that the DFT F [k] of a 1D signal f [n] may be expressed in matrix-vector form: where

39 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) The inverse DFT is then expressed by: where The theorem implies that any circulant matrix has eigenvectors the columns of A -1.

40 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) Let H be a NxN circulant matrix generated by the 1D N -length signal h[n], that is: Let also α k be the k -th column of the inverse DFT matrix A -1. We will prove that α k, for any k, is an eigenvector of H. The m -th element of the vector Hα k, denoted by is the result of the circular convolution of the signal h[n] with α k.

41 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) We will break it into two parts

42 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) Periodic with respect to N.

43 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) DFT of h[n] at k. This holds for any value of m. Therefore: which means that α k, for any k, is an eigenvector of H with corresponding eigenvalue the k -th element of H[k], the DFT of the signal generating H.

44 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) The above expression may be written in terms of the inverse DFT matrix: Based on this diagonalization, we can prove the property between circular convolution and DFT. or equivalently:

45 C. Nikou – Digital Image Processing (E12) Diagonalization of circulant matrices (cont.) DFT of g[n] DFT of f [n] DFT of h [n]

46 C. Nikou – Digital Image Processing (E12) Diagonalization of doubly block circulant matrices These properties may be generalized in 2D. We need to define the Kronecker product:

47 C. Nikou – Digital Image Processing (E12) Diagonalization of doubly block circulant matrices (cont.) The 2D signal f [m,n], may be vectorized in lexicographic ordering (stacking one column after the other) to a vector: The DFT of f [m,n], may be obtained in matrix-vector form:

48 C. Nikou – Digital Image Processing (E12) Diagonalization of doubly block circulant matrices (cont.) Theorem: The columns of the inverse 2D DFT matrix are eigenvectors of any doubly block circulant matrix. The corresponding eigenvalues are the 2D DFT values of the 2D signal generating the doubly block circulant matrix: Doubly block circulant Diagonal, containing the 2D DFT of h[m,n] generating H