Department of Computer Engineering

Slides:



Advertisements
Similar presentations
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
3-D Computational Vision CSc Image Processing II - Fourier Transform.
Image Enhancement in the Frequency Domain (2)
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
Pyramids and Texture. Scaled representations Big bars and little bars are both interesting Spots and hands vs. stripes and hairs Inefficient to detect.
Computer Vision University of Illinois Derek Hoiem
Image Processing and Analysis (ImagePandA) 5 – Image Restoration and Reconstruction Christoph Lampert / Chris Wojtan Based on slides by Selim Aksoy, Bilkent.
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
Convolution, Edge Detection, Sampling : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz.
Immagini e filtri lineari. Image Filtering Modifying the pixels in an image based on some function of a local neighborhood of the pixels
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
Convolution and Edge Detection : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz.
Computer Vision - A Modern Approach Set: Pyramids and Texture Slides by D.A. Forsyth Scaled representations Big bars (resp. spots, hands, etc.) and little.
The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall 2008 Somewhere in Cinque Terre, May 2005 Many slides borrowed from Steve.
Computational Photography: Fourier Transform Jinxiang Chai.
Slides from Alexei Efros, Steve Marschner Filters & fourier theory.
Chapter 4 Image Enhancement in the Frequency Domain.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
Fourier Analysis : Rendering and Image Processing Alexei Efros.
Image Sampling CSE 455 Ali Farhadi Many slides from Steve Seitz and Larry Zitnick.
CSC589 Introduction to Computer Vision Lecture 9 Sampling, Gaussian Pyramid Bei Xiao.
Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10.
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Thinking in Frequency Computational Photography University of Illinois Derek Hoiem 09/01/15.
Lecture 7: Sampling Review of 2D Fourier Theory We view f(x,y) as a linear combination of complex exponentials that represent plane waves. F(u,v) describes.
Recap of Monday linear Filtering convolution differential filters filter types boundary conditions.
CS 691B Computational Photography
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
Lecture 5: Fourier and Pyramids
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
Linear filters. CS8690 Computer Vision University of Missouri at Columbia What is Image Filtering? Modify the pixels in an image based on some function.
Digital Image Processing Chapter - 4
Miguel Tavares Coimbra
Jean Baptiste Joseph Fourier
Slide credit Fei Fei Li.
The Frequency Domain, without tears
Prof. Adriana Kovashka University of Pittsburgh September 14, 2016
Image Resampling & Interpolation
Computer Vision Brown James Hays 09/16/11 Thinking in Frequency Computer Vision Brown James Hays Slides: Hoiem, Efros, and others.
Sampling, Template Matching and Pyramids
Linear Filters and Edges Chapters 7 and 8
Linear Filtering – Part II
Many slides from Steve Seitz and Larry Zitnick
Linear Filters and Edges Chapters 7 and 8
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
ENG4BF3 Medical Image Processing
Frequency Domain Analysis
More Image Manipulation
CSCE 643 Computer Vision: Thinking in Frequency
Samuel Cheng Slide credits: Noah Snavely
Digital Image Processing
Phase and Amplitude in Fourier Transforms, Meaning of frequencies
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Oh, no, wait, sorry, I meant, welcome to the implementation of 20th-century science fiction literature, or a small part of it, where we will learn about.
Linear Filtering CS 678 Spring 2018.
Department of Computer Engineering
Image Resampling & Interpolation
Department of Computer Engineering
Samuel Cheng Slide credits: Noah Snavely
Lecture 4 Image Enhancement in Frequency Domain
Convolution.
Thinking in Frequency Computational Photography University of Illinois
Presentation transcript:

Department of Computer Engineering Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University saksoy@cs.bilkent.edu.tr

Fourier theory The Fourier theory shows how most real functions can be represented in terms of a basis of sinusoids. The building block: A sin( ωx + Φ ) Add enough of them to get any signal you want. Adapted from Alexei Efros, CMU CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

An illustration By Lucas V. Barbosa - Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=24822617 CS 484, Spring 2017 Bilkent University

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform To get some sense of what basis elements look like, we plot a basis element --- or rather, its real part --- as a function of x,y for some fixed u, v. We get a function that is constant when (ux+vy) is constant. The magnitude of the vector (u, v) gives a frequency, and its direction gives an orientation. The function is a sinusoid with this frequency along the direction, and constant perpendicular to the direction. u v Adapted from Antonio Torralba CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform Here u and v are larger than in the previous slide. Adapted from Antonio Torralba CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform And larger still... v u Adapted from Antonio Torralba CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform Adapted from Alexei Efros, CMU CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform Adapted from Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Ringing artifact revisited Adapted from Gonzales and Woods CS 484, Spring 2017 Bilkent University

Fourier transform - matlab A=1; K=10; M=100; t=[ones(1,K)*A zeros(1,M-K)]; subplot(3,1,1); bar(t); ylim([0 2*A]) subplot(3,1,2); bar(abs(fftshift(fft(t)))); ylim([0 A*K+1]) % Matlab uses DFT formulation without normalization by M. subplot(3,1,3); bar(real(fftshift(fft(t)))); ylim([-A*K+1 A*K+1]) Adapted from Gonzales and Woods CS 484, Spring 2017 Bilkent University

Fourier transform Adapted from Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform How to interpret a Fourier spectrum: fmax Horizontal orientation Vertical orientation 45 deg. fmax fx in cycles/image Low spatial frequencies High spatial frequencies Log power spectrum Adapted from Antonio Torralba CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform C A B 1 2 3 Adapted from Antonio Torralba CS 484, Fall 2017 ©2017, Selim Aksoy

Fourier transform Adapted from Shapiro and Stockman CS 484, Fall 2017 ©2017, Selim Aksoy

Convolution theorem CS 484, Fall 2017 ©2017, Selim Aksoy

Frequency domain filtering Adapted from Shapiro and Stockman, and Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Frequency domain filtering CS 484, Fall 2017 ©2017, Selim Aksoy

Frequency domain filtering f(x,y) h(x,y) g(x,y)   |F(u,v)| |H(u,v)| |G(u,v)|   CS 484, Fall 2017 ©2017, Selim Aksoy Adapted from Alexei Efros, CMU

Smoothing frequency domain filters CS 484, Fall 2017 ©2017, Selim Aksoy

Smoothing frequency domain filters The blurring and ringing caused by the ideal low-pass filter can be explained using the convolution theorem where the spatial representation of a filter is given below. CS 484, Fall 2017 ©2017, Selim Aksoy

Sharpening frequency domain filters CS 484, Fall 2017 ©2017, Selim Aksoy

Sharpening frequency domain filters Adapted from Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Sharpening frequency domain filters Adapted from Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Template matching Correlation can also be used for matching. If we want to determine whether an image f contains a particular object, we let h be that object (also called a template) and compute the correlation between f and h. If there is a match, the correlation will be maximum at the location where h finds a correspondence in f. Preprocessing such as scaling and alignment is necessary in most practical applications. CS 484, Fall 2017 ©2017, Selim Aksoy

Template matching Adapted from Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Face detection using template matching: face templates. CS 484, Fall 2017 ©2017, Selim Aksoy

Face detection using template matching: detected faces. CS 484, Fall 2017 ©2017, Selim Aksoy

Template matching Where is Waldo? http://machinelearningmastery.com/using-opencv-python-and-template-matching-to-play-wheres-waldo/ CS 484, Fall 2017 ©2017, Selim Aksoy

Resizing images How can we generate a half-sized version of a large image? Adapted from Steve Seitz, U of Washington CS 484, Fall 2017 ©2017, Selim Aksoy

Resizing images 1/8 1/4 Throw away every other row and column to create a 1/2 size image (also called sub-sampling). Adapted from Steve Seitz, U of Washington CS 484, Fall 2017 ©2017, Selim Aksoy

Resizing images 1/2 1/4 (2x zoom) 1/8 (4x zoom) Does this look nice? Adapted from Steve Seitz, U of Washington CS 484, Fall 2017 ©2017, Selim Aksoy

Resizing images We cannot shrink an image by simply taking every k’th pixel. Solution: smooth the image, then sub-sample. Gaussian 1/8 Gaussian 1/4 Gaussian 1/2 Adapted from Steve Seitz, U of Washington CS 484, Fall 2017 ©2017, Selim Aksoy

Resizing images Gaussian 1/2 Gaussian 1/4 (2x zoom) Adapted from Steve Seitz, U of Washington CS 484, Fall 2017 ©2017, Selim Aksoy

Sampling and aliasing Adapted from Steve Seitz, U of Washington CS 484, Fall 2017 ©2017, Selim Aksoy

Sampling and aliasing Errors appear if we do not sample properly. Common phenomenon: High spatial frequency components of the image appear as low spatial frequency components. Examples: Wagon wheels rolling the wrong way in movies. Checkerboards misrepresented in ray tracing. Striped shirts look funny on color television. CS 484, Fall 2017 ©2017, Selim Aksoy

Sampling and aliasing CS 484, Fall 2017 ©2017, Selim Aksoy Adapted from Ali Farhadi

Gaussian pyramids Adapted from Gonzales and Woods CS 484, Fall 2017 ©2017, Selim Aksoy

Gaussian pyramids Adapted from Michael Black, Brown University CS 484, Fall 2017 ©2017, Selim Aksoy

Gaussian pyramids Adapted from Michael Black, Brown University CS 484, Fall 2017 ©2017, Selim Aksoy