Linear Algebraand
Image Processing
Topics
• Vectors and Matrices• Vector Spaces• Eigenvalues and Eigenvectors• Digital Images - Basic Concepts• Histograms• Spatial Filtering
Vectors
• Scalar – single value • Vector – tuple of values
• Dimension – Cardinality of vector*• Standard operations• Inner product, Outer product
• Usage
Matrices
• Matrix – 2D vector*• Dimensions• Standard operations• Matrix multiplication• Trace and determinant• Rows and columns• Matrix types• Usage
Vector Spaces
• A collection of vectors over a field• Supports addition and scalar multiplication• Satisfies:
• Examples
1
v v
v v v
u v u v
u v v u
v v
Vector Space Properties
• Also true:
• Linear combination• Linearly independent vectors
1 1 1... 0 ,..., 0n n nv v
Subspaces
• A subspace is a subset of vectors from the vector space.
• It must be closed for addition and scalar multiplication
• Subspaces are vector spaces themselves
• Examples
Spanning Set and Basis
• A spanning set is a set of all possible linear combinations of
• A basis is a set of vectors satisfying• Spanning the space• Linearly independent
• Dimension – the length of the basis
• Examples
1,..., nv v
Eigenvalues and Eigenvectors
• Eigenvector of a square matrix is a non-zero vector such that for some scalar • The scalar is the matching Eigenvalue• Number of non-zero eigenvalues = matrix rank
• Examples• Importance
Av v A
v
Solving for Eigenvalues
• Characteristic polynomial• Roots are eigenvalues of A
• Algebraic and geometric multiplicities• Diagonalization:
• Importance
P( ) det( )A I
1P AP D
Properties of Eigenvalues
• Trace – sum of eigenvalues• Determinant – product of eigenvalues• Power - leads to• A is invertible for non-zero eigenvalues only• Invertible – power property holds for -1• A is hermitian – eigenvalues are real• A is unitary – eigenvalues satisfy
1,... nA 1 ,...k k knA
1
Numerical Linear Algebra
• Further reading• QR• LU• SVD• …
Digital Images - Basic Concepts
• Digital image – A matrix of pixels• Pixel – Smallest picture element
• Digital image acquisition:• Optics• Sampling• Quantization
Digital Image Processing
• Representation - discrete signal, 1D or 2D• Discrete convolution, discrete derivatives, …• Discrete transforms (e.g. DFT, DCT)
• Notable applications• Enhancement – Denoising, Inpainting, Debluring• Compression• Super-Resolution
Histogram
• Density function of the image• Statistical tool for estimation and processing
• Gray levels vs. number of occurrences• Can be normalized PDF• Global, Invariant to order of pixels
Histogram Importance
• Brightness and contrast• Information theory• Image matching• Local features
Spatial Convolution
• Convolution in 1D
• Convolution in 2D
• Usage• Filtering• Edge Detection• Template matching
Linear Filtering
• Linear combination of image and filter
• Examples• Averaging• Gaussian• Laplacian
1 2
3 4 5
[ , ] [ , ] [ 1, ]
[ , 1] [ 1, ] [ , 1]
J m n I m n I m n
I m n I m n I m n
2 3 2
3 5 3
2 3 2
Non-Linear Filtering
• Not all filters can be formulated as matrices
• Minimum, Maximum• Median filter• Frequency mixer• Energy transfer filter• …
Adaptive Filtering
• Not all filters are space invariant
• Image statistics may be local• Corruption may be location dependent• Different schemes at edges and at textures
• How to create location dependent filters?
Examples
• Wallis filter – local dynamic range correction
• Edge based denoising
• Importance for Computer Vision