Linear filtering.

Slides:



Advertisements
Similar presentations
Image Processing. Overview ImagesPixel Filters Neighborhood Filters Dithering.
Advertisements

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.
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Lecture 2: Filtering CS4670/5670: Computer Vision Kavita Bala.
1 Image filtering Hybrid Images, Oliva et al.,
Lecture 2: Edge detection and resampling
Lecture 1: Images and image filtering
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Linear filtering. Overview: Linear filtering Linear filters Definition and properties Examples Gaussian smoothing Separability Applications Denoising.
Announcements Kevin Matzen office hours – Tuesday 4-5pm, Thursday 2-3pm, Upson 317 TA: Yin Lou Course lab: Upson 317 – Card access will be setup soon Course.
1 Image filtering Images by Pawan SinhaPawan Sinha.
1 Image filtering
Lecture 2: Image filtering
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
Linear filtering.
1 Image filtering Hybrid Images, Oliva et al.,
Linear Filtering About modifying pixels based on neighborhood. Local methods simplest. Linear means linear combination of neighbors. Linear methods simplest.
Basic Image Processing January 26, 30 and February 1.
Most slides from Steve Seitz
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
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,
Image Filtering Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/02/10.
Why is computer vision difficult?
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.
CSE 473/573 Computer Vision and Image Processing (CVIP) Ifeoma Nwogu Lecture 7 – Linear Filters 1.
Visual Computing Computer Vision 2 INFO410 & INFO350 S2 2015
CS 691B Computational Photography
Reconnaissance d’objets et vision artificielle
Linear filtering. Motivation: Image denoising How can we reduce noise in a photograph?
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al.,
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Sampling and Reconstruction.
Image Resampling & Interpolation
Miguel Tavares Coimbra
Linear Filters T-11 Computer Vision University of Houston
Linear Filters April 6th, 2017
ECE 692 – Advanced Topics in Computer Vision
IMAGE PROCESSING AKSHAY P S3 EC ROLL NO. 9.
Lecture 1: Images and image filtering
Image filtering Hybrid Images, Oliva et al.,
Image gradients and edges April 11th, 2017
More Image Manipulation
Image filtering Images by Pawan Sinha.
Sampling and Reconstruction
Sampling and Reconstruction
Image filtering Images by Pawan Sinha.
Image Processing Today’s readings For Monday
Image filtering Images by Pawan Sinha.
Motion illusion, rotating snakes
Filtering Part 2: Image Sampling
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Basic Image Processing
Most slides from Steve Seitz
Image filtering Images by Pawan Sinha.
Linear Filtering CS 678 Spring 2018.
Image filtering
Image filtering
Resampling.
Lecture 2: Image filtering
Lecture 1: Images and image filtering
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Most slides from Steve Seitz
Miguel Tavares Coimbra
Presentation transcript:

Linear filtering

Overview: Linear filtering Linear filters Definition and properties Examples Gaussian smoothing Separability Applications Denoising Non-linear filters: median filter Sharpening Subsampling

Images as functions demo with scanalyze on laptop Source: S. Seitz

Images as functions We can think of an image as a function, f, from R2 to R: f( x, y ) gives the intensity at position ( x, y ) Realistically, we expect the image only to be defined over a rectangle, with a finite range: f: [a,b] x [c,d]  [0,1] A color image is just three functions pasted together. We can write this as a “vector-valued” function: As opposed to [0..255] Source: S. Seitz

What is a digital image? In computer vision we usually operate on digital (discrete) images: Sample the 2D space on a regular grid Quantize each sample (round to nearest integer) The image can now be represented as a matrix of integer values Source: S. Seitz

Motivation 1: Noise reduction Given a camera and a still scene, how can you reduce noise? Answer: take lots of images, average them Take lots of images and average them! What’s the next best thing? Source: S. Seitz

Motivation 2: Image half-sizing This image is too big to fit on the screen. How can we reduce it by a factor of two? How about taking every second pixel? Source: S. Seitz

First attempt at a solution Let’s replace each pixel with an average of all the values in its neighborhood ys(i) =1/(2N+1)*(y(i + N) + y(i + N – 1) + ... + y(i – N)) ys(1) = y(1) ys(2) = (y(1)+y(2)+y(3))/3 ys(3) = (y(1)+y(2)+y(3)+y(4)+y(5))/5 ys(4) = (y(2)+y(3)+y(4)+y(5)+y(6))/5 Source: S. Marschner

First attempt at a solution Let’s replace each pixel with an average of all the values in its neighborhood Moving average in 1D: Source: S. Marschner

Weighted Moving Average Can add weights to our moving average Weights [1, 1, 1, 1, 1] / 5 Source: S. Marschner

Weighted Moving Average Non-uniform weights [1, 4, 6, 4, 1] / 16 Source: S. Marschner

Moving Average In 2D 90 90 ones, divide by 9 Source: S. Seitz

Moving Average In 2D 90 90 10 ones, divide by 9 Source: S. Seitz

Moving Average In 2D 90 90 10 20 ones, divide by 9 Source: S. Seitz

Moving Average In 2D 90 90 10 20 30 ones, divide by 9 Source: S. Seitz

Moving Average In 2D 90 10 20 30 ones, divide by 9 Source: S. Seitz

Moving Average In 2D Source: S. Seitz ones, divide by 9 90 10 20 30 40 90 10 20 30 40 60 90 50 80 ones, divide by 9 Source: S. Seitz

Generalization of moving average Let’s replace each pixel with a weighted average of its neighborhood The weights are called the filter kernel What are the weights for a 3x3 moving average? 1 “box filter” Source: D. Lowe

Practice with linear filters 1 ? Original Source: D. Lowe

Practice with linear filters 1 Original Filtered (no change) Source: D. Lowe

Practice with linear filters 1 ? Original Source: D. Lowe

Practice with linear filters 1 Original Shifted left By 1 pixel Source: D. Lowe

Practice with linear filters ? 1 Original Source: D. Lowe

Practice with linear filters 1 Original Blur (with a box filter) Source: D. Lowe

Practice with linear filters - 2 1 ? (Note that filter sums to 1) Original Source: D. Lowe

Practice with linear filters - 2 1 Original Sharpening filter Accentuates differences with local average Source: D. Lowe

Sharpening Source: D. Lowe

Gaussian Kernel 0.003 0.013 0.022 0.013 0.003 0.013 0.059 0.097 0.059 0.013 0.022 0.097 0.159 0.097 0.022 5 x 5,  = 1 Constant factor at front makes volume sum to 1 (can be ignored, as we should re-normalize weights to sum to 1 in any case) Source: C. Rasmussen

Choosing kernel width Gaussian filters have infinite support, but discrete filters use finite kernels Source: K. Grauman

Choosing kernel width Rule of thumb: set filter half-width to about 3 σ

Gaussian noise Mathematical model: sum of many independent factors Good for small standard deviations Assumption: independent, zero-mean noise Source: K. Grauman

Reducing Gaussian noise Smoothing with larger standard deviations suppresses noise, but also blurs the image

Reducing salt-and-pepper noise 3x3 5x5 7x7 What’s wrong with the results?

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

Median vs. Gaussian filtering 3x3 5x5 7x7 Gaussian Median

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

unit impulse (identity) Unsharp mask filter Gaussian unit impulse Laplacian of Gaussian image blurred image unit impulse (identity) f + a(f - f * g) = (1+a)f-af*g = f*((1+a)e-g)

- Recall 2 1 Original Sharpening filter 2 1 Original Sharpening filter Accentuates differences with local average

Image half-sizing This image is too big to fit on the screen. How can we reduce it by a factor of two? How about taking every second pixel? Source: S. Seitz

Image sub-sampling 1/8 1/4 Throw away every other row and column to create a 1/2 size image - called image sub-sampling Slide by Steve Seitz

Gaussian (low-pass) pre-filtering Solution: filter the image, then subsample Filter size should double for each ½ size reduction Source: Steve Seitz

Subsampling with Gaussian pre-filtering 1/2 1/4 (2x zoom) 1/8 (4x zoom) Source: Steve Seitz

Without prefiltering: 1/2 1/4 (2x zoom) 1/8 (4x zoom) Source: Steve Seitz

Zmiany klimatyczne – El Nino

ENSO = EN + SO

Fourier series make use of the orthogonality relationships of the sine and cosine functions

natural fake

Anti-aliasing in 3D graphic display