Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10.

Slides:



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

CSCE 643 Computer Vision: Template Matching, Image Pyramids and Denoising Jinxiang Chai.
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
Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Motion illusion, rotating snakes. Slide credit Fei Fei Li.
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
CS 691 Computational Photography
Computational Photography: Sampling + Reconstruction Connelly Barnes Slides from Alexei Efros and Steve Marschner.
CS 4487/9587 Algorithms for Image Analysis
Thinking in Frequency Computer Vision Brown James Hays Slides: Hoiem, Efros, and others.
Computer Vision University of Illinois Derek Hoiem
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Templates, Image Pyramids, and Filter Banks Slides largely from Derek Hoeim, Univ. of Illinois.
Templates and Image Pyramids Computational Photography Derek Hoiem, University of Illinois 09/06/11.
Convolution, Edge Detection, Sampling : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz.
Sampling and Pyramids : Rendering and Image Processing Alexei Efros …with lots of 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
Lecture 1: Images and image filtering
Linear filtering. Overview: Linear filtering Linear filters Definition and properties Examples Gaussian smoothing Separability Applications Denoising.
15-463: Computational Photography Alexei Efros, CMU, Fall 2011 Many slides from Steve Marschner Sampling and Reconstruction.
Lecture 2: Image filtering
Templates, Image Pyramids, and Filter Banks Computer Vision James Hays, Brown Slides: Hoiem and others.
Linear filtering.
1 Image filtering Hybrid Images, Oliva et al.,
Slides from Alexei Efros, Steve Marschner Filters & fourier theory.
CSC589 Introduction to Computer Vision Lecture 9 Sampling, Gaussian Pyramid Bei Xiao.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5409 T-R 10:30am – 11:50am.
CSE 185 Introduction to Computer Vision Image Filtering: Frequency Domain.
Slide credit Fei Fei Li. Image filtering Image filtering: compute function of local neighborhood at each position Really important! – Enhance images.
Templates, Image Pyramids, and Filter Banks Computer Vision Derek Hoiem, University of Illinois 01/31/12.
Computer Vision James Hays Thinking in Frequency Computer Vision James Hays Slides: Hoiem, Efros, and others.
CS 1699: Intro to Computer Vision Texture and Other Uses of Filters Prof. Adriana Kovashka University of Pittsburgh September 10, 2015 Slides from Kristen.
Templates, Image Pyramids, and Filter Banks
CSE 185 Introduction to Computer Vision Image Filtering: Frequency Domain.
Templates and Image Pyramids Computational Photography Derek Hoiem, University of Illinois 09/03/15.
Linear Filters Monday, Jan 24 Prof. Kristen Grauman UT-Austin …
Linear Filters August 27 th 2015 Devi Parikh Virginia Tech 1 Slide credit: Devi Parikh Disclaimer: Many slides have been borrowed from Kristen Grauman,
Thinking in Frequency Computational Photography University of Illinois Derek Hoiem 09/01/15.
Why is computer vision difficult?
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Linear filtering. Motivation: Noise reduction Given a camera and a still scene, how can you reduce noise? Take lots of images and average them! What’s.
Templates, Image Pyramids, and Filter Banks
CS 691B Computational Photography
Pixels and Image Filtering Computational Photography Derek Hoiem 08/26/10 Graphic:
Lecture 5: Fourier and Pyramids
Linear filtering. Motivation: Image denoising How can we reduce noise in a photograph?
Projects Project 1a due this Friday Project 1b will go out on Friday to be done in pairs start looking for a partner now.
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
Finding Boundaries Computer Vision CS 143, Brown James Hays 09/28/11 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li,
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al.,
Image Filtering in Spatial domain
Slide credit Fei Fei Li.
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 Filtering – Part II
Department of Computer Engineering
Image Pyramids and Applications
Sampling and Reconstruction
Motion illusion, rotating snakes
Linear filtering.
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
Thinking in Frequency Computational Photography University of Illinois
Templates and Image Pyramids
Presentation transcript:

Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10

Credit: S. Seitz Review: Image filtering

Image filtering Credit: S. Seitz

Image filtering Credit: S. Seitz

Filtering in spatial domain * =

Filtering in frequency domain FFT Inverse FFT =

Sharpening revisited What does blurring take away? original smoothed (5x5) – detail = sharpened = Let’s add it back: originaldetail + α

Application: Hybrid Images A. Oliva, A. Torralba, P.G. Schyns, “Hybrid Images,” SIGGRAPH 2006 “Hybrid Images,”

Application: Hybrid Images A. Oliva, A. Torralba, P.G. Schyns, “Hybrid Images,” SIGGRAPH 2006 “Hybrid Images,”

Today’s class How to use filters for – Matching – Denoising – Anti-aliasing Image representation with pyramids Texture – What is it? – How to represent it?

Matching with filters Goal: find in image

Matching with filters Goal: find in image Method 1: SSD Input 1- sqrt(SSD) Threshold at 0.8

Matching with filters Goal: find in image Method 1: SSD Method 2: Normalized cross-correlation Input Normalized X-Correlation Threshold at 0.5

Noise Gaussian Additive Noise + = Noisy Image

Gaussian noise Mathematical model: sum of many independent factors Assumption: independent, zero-mean noise Source: M. Hebert

Noise Salt and pepper noise: contains random occurrences of black and white pixels Impulse noise: contains random occurrences of white pixels Gaussian noise: variations in intensity drawn from a Gaussian normal distribution Source: S. Seitz

Denoising Additive Gaussian Noise Gaussian Filter

Smoothing with larger standard deviations suppresses noise, but also blurs the image Reducing Gaussian noise Source: S. Lazebnik

Reducing salt-and-pepper noise by Gaussian smoothing 3x35x57x7

Alternative idea: Median filtering A median filter operates over a window by selecting the median intensity in the window Is median filtering linear? Source: K. Grauman

Median filter What advantage does median filtering have over Gaussian filtering? – Robustness to outliers Source: K. Grauman

Median filter Salt-and-pepper noise Median filtered Source: M. Hebert MATLAB: medfilt2(image, [h w])

Median vs. Gaussian filtering 3x35x57x7 Gaussian Median

Throw away every other row and column to create a 1/2 size image Subsampling by a factor of 2

1D example (sinewave): Source: S. Marschner Aliasing problem

Source: S. Marschner 1D example (sinewave): Aliasing problem

Sub-sampling may be dangerous…. Characteristic errors may appear: – “Wagon wheels rolling the wrong way in movies” – “Checkerboards disintegrate in ray tracing” – “Striped shirts look funny on color television” Source: D. Forsyth Aliasing problem

Aliasing in video Slide by Steve Seitz

Source: A. Efros Aliasing in graphics

Sampling and aliasing

When sampling a signal at discrete intervals, the sampling frequency must be  2  f max ; f max = max frequency of the input signal. This will allows to reconstruct the original perfectly from the sampled version good bad vvv Nyquist-Shannon Sampling Theorem

Anti-aliasing Solutions: Sample more often Get rid of all frequencies that are greater than half the new sampling frequency – Will lose information – But it’s better than aliasing – Apply a smoothing filter

Algorithm for downsampling by factor of 2 1.Start with image(h, w) 2.Apply low-pass filter im_blur = imfilter(image, fspecial(‘gaussian’, 7, 1)) 3.Sample every other pixel im_small = im_blur(1:2:end, 1:2:end);

Anti-aliasing Forsyth and Ponce 2002

Subsampling without pre-filtering 1/4 (2x zoom) 1/8 (4x zoom) 1/2 Slide by Steve Seitz

Subsampling with Gaussian pre-filtering G 1/4G 1/8Gaussian 1/2 Slide by Steve Seitz

Gaussian pyramid Source: Forsyth

Laplacian filter Gaussian unit impulse Laplacian of Gaussian Source: Lazebnik

Laplacian pyramid Source: Forsyth

Computing Gaussian/Laplacian Pyramid Can we reconstruct the original from the laplacian pyramid?

Related idea: 2d wavelets

2d Wavelets Matlab: wavemenu

Image representation Pixels: great for spatial resolution, poor access to frequency Fourier transform: great for frequency, not for spatial info Pyramids/wavelets: balance between spatial and frequency information

Major uses of image pyramids Compression Object detection – Scale search – Features Detecting stable interest points Registration – Course-to-fine

Texture Source: Forsyth

Texture and Material

Texture and Orientation

Texture and Scale

What is texture? Regular or stochastic patterns caused by bumps, grooves, and/or markings

How can we represent texture? Measure frequencies at various orientations and scales

Overcomplete representation: filter banks LM Filter Bank Code for filter banks:

Filter banks Process image with each filter and keep responses (or squared/abs responses)

Representing texture Idea 1: take simple statistics (e.g., mean, std) of various absolute filter responses

Can you match the texture to the response? Mean abs responses Filters A B C 1 2 3

Representing texture by mean abs response Mean abs responses Filters

Representing texture Idea 2: take vectors of filter responses at each pixel and cluster them, then take histograms (more on in coming weeks)

Things to remember When matching using a filter, normalized cross correlation is preferred Use Gaussian or median filter for denoising Beware of aliasing – use lowpass filter to downsample Laplacian pyramids and wavelets provide spatial/frequency information Filter banks provide overcomplete representation, good for modeling/recognizing texture

Next class Edges and lines

Questions

Denoising “Salt and Pepper” Noise

Denoising 3x3 Median Filter “Salt and Pepper” Noise

Denoising Gaussian Additive Noise 3x3 Median Filter