All about convolution.

Slides:



Advertisements
Similar presentations
Computer Vision Lecture 7: The Fourier Transform
Advertisements

Lecture 7: Basis Functions & Fourier Series
Fourier Transform (Chapter 4)
Fourier Transform – Chapter 13. Image space Cameras (regardless of wave lengths) create images in the spatial domain Pixels represent features (intensity,
Review of Frequency Domain
Digital Image Processing
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
1 Image filtering Hybrid Images, Oliva et al.,
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F(  ) is the spectrum of the function.
Signal Processing COS 323 COS 323. Digital “Signals” 1D: functions of space or time (e.g., sound)1D: functions of space or time (e.g., sound) 2D: often.
Image Enhancement in the Frequency Domain Part I Image Enhancement in the Frequency Domain Part I Dr. Samir H. Abdul-Jauwad Electrical Engineering Department.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
Signals and Systems Discrete Time Fourier Series.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
Basic Image Processing January 26, 30 and February 1.
Most slides from Steve Seitz
CELLULAR COMMUNICATIONS DSP Intro. Signals: quantization and sampling.
CH#3 Fourier Series and Transform
Systems: Definition Filter
CSC589 Introduction to Computer Vision Lecture 7 Thinking in Frequency Bei Xiao.
EE D Fourier Transform. Bahadir K. Gunturk EE Image Analysis I 2 Summary of Lecture 2 We talked about the digital image properties, including.
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
Chapter 7: The Fourier Transform 7.1 Introduction
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
ENG4BF3 Medical Image Processing Image Enhancement in Frequency Domain.
Chapter 5: Neighborhood Processing
CH#3 Fourier Series and Transform
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Image as a linear combination of basis images
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
Fourier Transform.
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
Ch # 11 Fourier Series, Integrals, and Transform 1.
ENEE 322: Continuous-Time Fourier Transform (Chapter 4)
The Frequency Domain Digital Image Processing – Chapter 8.
CH#3 Fourier Series and Transform 1 st semester King Saud University College of Applied studies and Community Service 1301CT By: Nour Alhariqi.
Digital Image Processing Lecture 8: Image Enhancement in Frequency Domain II Naveed Ejaz.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Jean Baptiste Joseph Fourier
Correlation and Convolution They replace the value of an image pixel with a combination of its neighbors Basic operations in images Shift Invariant Linear.
DIGITAL SIGNAL PROCESSING ELECTRONICS
Linear Filters and Edges Chapters 7 and 8
The Fourier Transform Jean Baptiste Joseph Fourier.
Image Enhancement in the
Miguel Tavares Coimbra
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F() is the spectrum of the function.
Fourier Transform.
- photometric aspects of image formation gray level images
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
ENG4BF3 Medical Image Processing
Outline Linear Shift-invariant system Linear filters
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Outline Linear Shift-invariant system Linear filters
CSCE 643 Computer Vision: Thinking in Frequency
4. Image Enhancement in Frequency Domain
Notes Assignments Tutorial problems
Instructor: S. Narasimhan
Basic Image Processing
Digital Image Processing Week IV
Fourier Transform Analytic geometry gives a coordinate system for describing geometric objects. Fourier transform gives a coordinate system for functions.
Lesson Week 8 Fourier Transform of Time Functions (DC Signal, Periodic Signals, and Pulsed Cosine)
Fourier Transforms.
Lecture 2: Image filtering
Intensity Transformation
Discrete Fourier Transform
All about convolution.
The Frequency Domain Any wave shape can be approximated by a sum of periodic (such as sine and cosine) functions. a--amplitude of waveform f-- frequency.
Even Discrete Cosine Transform The Chinese University of Hong Kong
Presentation transcript:

All about convolution

Last time: Convolution and cross-correlation

Last time: Convolution and cross-correlation Properties Shift-invariant: a sensible thing to require Linearity: convenient Can be used for smoothing, sharpening Also main component of CNNs

Boundary conditions What if m-i <0? What if m-i > image size Assume f is defined for [−∞,∞] in both directions, just 0 everywhere else Same for w

Boundary conditions 90 10 20 40 30

Boundary conditions 90 10 20 40 30

Boundary conditions 90 10 20 40 30

Boundary conditions 90 10 20 40 30

Boundary conditions 90 10 20 40 30

Boundary conditions in practice “Full convolution”: compute if any part of kernel intersects with image requires padding Output size = m+k-1 “Same convolution”: compute if center of kernel is in image output size = m “Valid convolution”: compute only if all of kernel is in image no padding output size = m-k+1

More properties of convolution

More properties of convolution Convolution is linear Convolution is shift-invariant Convolution is commutative (w*f = f*w) Convolution is associative ( v*(w*f) = (v*w)*f ) Every linear shift-invariant operation is a convolution

Optimization: separable filters basic alg. is O(r2): large filters get expensive fast! definition: a2(x,y) is separable if it can be written as: this is a useful property for filters because it allows factoring:

More convolution filters 1 Mean filter But nearby pixels are more correlated than far- away pixels Weigh nearby pixels more 1/25

Gaussian filter

Gaussian filter 0.003 0.013 0.022 0.060 0.098 0.162 Ignore factor in front, instead, normalize filter to sum to 1 5x5, 𝜎=1

Gaussian filter 21x21, 𝜎=0.5 21x21, 𝜎=1 21x21, 𝜎=3

Difference of Gaussians 21x21, 𝜎=3 21x21, 𝜎=1

Difference of Gaussians

Images have structure at various scales

Fourier transform and the frequency domain

Signal processing Images are 2D For convenience, consider 1D signals Instead of space, time f[i] : value of signal at point i (1D analog of f(i,j))

Signal processing Instead of discrete signals, we will consider continuous signals Discrete signals can be considered as samples from continuous signals f : R  R, w : R  R What is convolution for continuous signals?

Frequency Frequency of a signal is how fast it changes Reflects scale of structure

Frequency 𝑥(𝑡)= cos 2𝜋𝜈𝑡 What is the period? What is the frequency?

A combination of frequencies 0.1 X + 0.3 X + 0.5 X =

Fourier transform Can we figure out the canonical single-frequency signals that make up a complex signal? Yes! Can any signal be decomposed in this way?

Idea of Fourier Analysis Every signal (doesn’t matter what it is) Sum of sine/cosine waves

Idea of Fourier Analysis Every signal (doesn’t matter what it is) Sum of sine/cosine waves

A box-like example

The Fourier bases Not exactly sines and cosines, but complex variants Euler’s formula

i is same as j

Fourier transform for periodic signals Suppose x is periodic with period T All components must be periodic with period T/k for some integer k Only frequencies are of the form k/T Thus: Given a signal x(t), Fourier transform gives us the coefficients ak (we will denote these as X[k]) ”Pure” signal

Fourier transform for aperiodic signals What if signal is not periodic? Can still decompose into sines and cosines! But no restriction on frequency Now need a continuous space of frequencies Fourier transform gives us the function X(v) ”Pure” signal

Fourier transform Note: X can in principle be complex: we often look at the magnitude |X(v)|

Frequency Time Why is there a peak at 0?

Fourier transform

Dual domains Signal: time domain (or spatial domain) Fourier Transform: Frequency domain Amplitudes are called spectrum For any transformations we do in time domain, there are corresponding transformations we can do in the frequency domain And vice-versa Spatial Domain

Dual domains Convolution in time domain = Point-wise multiplication in frequency domain Convolution in frequency domain = Point-wise multiplication in time domain

Proof (if curious)

Properties of Fourier transforms

Back to 2D images Images are 2D signals Discrete, but consider as samples from continuous function Signal: f(x,y) Fourier transform F(vx, vy): contribution of a “pure” signal with frequency vx in x and vy in y

Back to 2D images

Signals and their Fourier transform Spatial Sine Gaussian Box Frequency Impulse Gaussian Sinc

The Gaussian special case Fourier transform of a Gaussian is a gaussian

Sharp discontinuities require very high frequencies

Duality Since Fourier and inverse Fourier look so much alike: Fourier transform of sinc is box Fourier transform of impulse is sine

Why talk about Fourier transforms? Convolution is point-wise multiplication in frequency space Analyze which frequency components a particular filter lets through, e.g., low-pass, high-pass or band-pass filters Leads to fast algorithms for convolution with large filters: Fast FFT

Why talk about Fourier transforms Frequency space reveals structure at various scales Noise is high-frequency ”Average brightness” is low-frequency Useful to understand how we resize/resample images Sampling causes information loss What is lost exactly? What can we recover?

Fourier transforms from far away Fourier transforms are basically a “change of basis” Instead of representing image as “the value of each pixel”, Represent image as “how much of each frequency component” “Frequency components” are intuitive: slowly- changing or fast-changing images

”The cat has some serious periodic components.” https://xkcd.com/26/