Computational Photography Prof. Feng Liu Spring 2015 04/06/2015.

Slides:



Advertisements
Similar presentations
Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Advertisements

Spatial Filtering (Chapter 3)
Motion illusion, rotating snakes. Slide credit Fei Fei Li.
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
CS 4487/9587 Algorithms for Image Analysis
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 4 Linear Filters and Convolution
Lecture 2: Filtering CS4670/5670: Computer Vision Kavita Bala.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
1 Image filtering Hybrid Images, Oliva et al.,
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
Computer Vision - A Modern Approach
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.
Linear filters and edges. Linear Filters General process: Form new image whose pixels are a weighted sum of original pixel values, using the same set.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
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.
15-463: Computational Photography Alexei Efros, CMU, Fall 2011 Many slides from Steve Marschner Sampling and Reconstruction.
Lecture 2: Image filtering
Linear filtering.
Linear Filtering About modifying pixels based on neighborhood. Local methods simplest. Linear means linear combination of neighbors. Linear methods simplest.
Computational Photography: Image Processing Jinxiang Chai.
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Kavita Bala Hybrid Images, Oliva et al.,
Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Spatial Filtering: Basics
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?
Image gradients and edges Tuesday, September 1 st 2015 Devi Parikh Virginia Tech Disclaimer: Many slides have been borrowed from Kristen Grauman, who may.
03/28/03© 2005 University of Wisconsin NPR Today “Comprehensible Rendering of 3-D Shapes”, Takafumi Saito and Tokiichiro Takahashi, SIGGRAPH 1990 “Painterly.
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.
2/17/04© University of Wisconsin, CS559 Spring 2004 Last Time Resampling –Ideal reconstruction –You can only ideally reconstruct band-limited functions.
Pixels and Image Filtering Computer Vision Derek Hoiem, University of Illinois 02/01/11 Graphic:
9/30/04© University of Wisconsin, CS559 Fall 2004 Last Time Reconstruction Aliasing Compositing Intro.
CS 691B Computational Photography
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Painterly Rendering with Curved Brush Strokes of Multiple Sizes Aaron Hertzmann Siggraph98 資工所碩一 R 蔡銘宏.
Pixels and Image Filtering Computational Photography Derek Hoiem 08/26/10 Graphic:
Reconnaissance d’objets et vision artificielle
Linear filtering. Motivation: Image denoising How can we reduce noise in a photograph?
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Images and Filters CSEP 576 Ali Farhadi Many slides from Steve Seitz and Larry Zitnick.
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al.,
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Linear Filters and Edges Chapters 7 and 8
Linear Filters April 6th, 2017
ECE 692 – Advanced Topics in Computer Vision
A Gentle Introduction to Bilateral Filtering and its Applications
Image gradients and edges
Lecture 1: Images and image filtering
Image gradients and edges April 11th, 2017
Motion illusion, rotating snakes
Linear filtering.
Most slides from Steve Seitz
Linear Filtering CS 678 Spring 2018.
Linear Operations Using Masks
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
Presentation transcript:

Computational Photography Prof. Feng Liu Spring /06/2015

Last Time  Digital Camera History of Camera Controlling Camera  Photography Concepts

Today  Filters and its applications naïve denoising Gaussian blur better denoising edge-preserving filter noisy image Slide credit: Sylvain Paris and Frédo Durand

The raster image (pixel matrix) Slide credit: D. Hoiem

The raster image (pixel matrix) Slide credit: D. Hoiem

Perception of Intensity Slide credit: T. Adelson

Perception of Intensity

Color Image R G B Slide credit: D. Hoiem

 Image filtering: compute function of local neighborhood at each pixel position  One type of “Local operator,” “Neighborhood operator,” “Window operator”  Useful for: Enhancing images  Noise reduction, smooth, resize, increase contrast, etc. Extracting information from images  Texture, edges, distinctive points, etc. Detecting patterns  Template matching, e.g., eye template Source: D. Hoiem Image Filtering Slide credit: C. Dyer

Source: Bokeh: Blur in out-of-focus regions of image Camera shake * = Source: Fergus, et al. “Removing Camera Shake from a Single Photograph”, SIGGRAPH 2006 Blurring in the Real World Slide credit: C. Dyer

Image Correlation Filtering  Select a filter g g is called a filter, mask, kernel, or template  Center filter g at each pixel in image f  Multiply weights by corresponding pixels  Set resulting value in output image h  Linear filtering is sum of dot product at each pixel position  Filtering operation called cross-correlation, and denoted h = f  g Slide credit: C. Dyer

Example: Box Filter Slide credit: David Lowe

Credit: S. Seitz Image Filtering

Image Filtering Credit: S. Seitz

Image Filtering Credit: S. Seitz

Image Filtering Credit: S. Seitz

Image Filtering Credit: S. Seitz

Image Filtering ? Credit: S. Seitz

Image Filtering ? Credit: S. Seitz

Image Filtering Credit: S. Seitz

What does it do? Replaces each pixel with an average of its neighborhood Achieves smoothing effect (i.e., removes sharp features) Weaknesses: Blocky results Axis-aligned streaks Slide credit: David Lowe Box Filter

Smoothing with Box Filter Slide credit: C. Dyer

Properties of Smoothing Filters  Smoothing Values all positive Sum to 1  constant regions same as input Amount of smoothing proportional to mask size Removes “high-frequency” components “low-pass” filter Slide credit: C. Dyer

 Weight contributions of neighboring pixels by nearness  Constant factor at front makes volume sum to 1  Convolve each row of image with 1D kernel to produce new image; then convolve each column of new image with same 1D kernel to yield output image x 5,  = 1 Slide credit: Christopher Rasmussen Gaussian Filtering

 Smoothing with a box actually doesn’t compare at all well with a defocused lens  Most obvious difference is that a single point of light viewed in a defocused lens looks like a fuzzy blob; but the averaging process would give a little square  Gaussian is isotropic (i.e., rotationally symmetric)  A Gaussian gives a good model of a fuzzy blob  It closely models many physical processes (the sum of many small effects) Slide by D.A. Forsyth Smoothing with a Gaussian

What does Blurring take away? original Slide credit: C. Dyer

What does Blurring take away? smoothed (5x5 Gaussian) Slide credit: C. Dyer

Smoothing with Gaussian Filter

Smoothing with Box Filter

input Slide by S. Paris

box average Slide by S. Paris

Gaussian blur Slide by S. Paris

 What parameters matter here?  Standard deviation, , of Gaussian: determines extent of smoothing σ = 2 with 30 x 30 kernel σ = 5 with 30 x 30 kernel Source: D. Hoiem Gaussian Filters

Slide credit: C. Dyer

for sigma=1:3:10 h = fspecial('gaussian‘, hsize, sigma); out = imfilter(im, h); imshow(out); pause; end … Parameter σ is the “scale” / “width” / “spread” of the Gaussian kernel, and controls the amount of smoothing Smoothing with a Gaussian Slide credit: C. Dyer

Gaussian filters = 30 pixels= 1 pixel = 5 pixels = 10 pixels Slide credit: C. Dyer

 What parameters matter here?  Size of kernel or mask σ = 5 with 10 x 10 kernel σ = 5 with 30 x 30 kernel Gaussian Filters Slide credit: C. Dyer

 Gaussian function has infinite “support” but need a finite-size kernel  Values at edges should be near 0   98.8% of area under Gaussian in mask of size 5σ x 5σ  In practice, use mask of size 2k+1 x 2k+1 where k  3   Normalize output by dividing by sum of all weights How big should the filter be? Slide credit: C. Dyer

Original ? (Note that filter sums to 1) Source: D. Lowe Sharpening Filters

Original Sharpening filter - Sharpen an out of focus image by subtracting a multiple of a blurred version Source: D. Lowe Sharpening Filters

Source: D. Lowe Sharpening

 h = f + k(f * g) where k is a small positive constant and g =  Called unsharp masking in photography called a Laplacian mask Sharpening by Unsharp Masking

Sharpening using Unsharp Mask Filter OriginalFiltered result Slide credit: C. Dyer

Vertical Edge (absolute value) Sobel Application: Edge Detection Slide credit: C. Dyer

Horizontal Edge (absolute value) Sobel Application: Edge Detection Slide credit: C. Dyer

Application: Hybrid Images Gaussian Filter Laplacian Filter A. Oliva, A. Torralba, P.G. Schyns, Hybrid Images, SIGGRAPH 2006 Gaussian unit impulse Laplacian of Gaussian I1I1 I2I2 G1G1 (1-G 2 ) I1  G1I1  G1

Application: XDoG Filters Gaussian filtering results Winnemoller, H., XDoG: advanced image stylization with eXtended Difference-of-Gaussians NPAR 2011 Input XDoG Input XDoG

Application: Painterly Filters  Many methods have been proposed to make a photo look like a painting  Today we look at one: Painterly-Rendering with Brushes of Multiple Sizes  Basic ideas: Build painting one layer at a time, from biggest to smallest brushes At each layer, add detail missing from previous layer A. Hertzmann, Painterly rendering with curved brush strokes of multiple sizes, SIGGRAPH Slide credit: S. Chenney

Algorithm 1 function paint(sourceImage,R 1... R n ) // take source and several brush sizes { canvas := a new constant color image // paint the canvas with decreasing sized brushes for each brush radius R i, from largest to smallest do { // Apply Gaussian smoothing with a filter of size const * radius // Brush is intended to catch features at this scale referenceImage = sourceImage * G(fs R i ) // Paint a layer paintLayer(canvas, referenceImage, Ri) } return canvas } Slide credit: S. Chenney

Algorithm 2 procedure paintLayer(canvas,referenceImage, R) // Add a layer of strokes { S := a new set of strokes, initially empty D := difference(canvas,referenceImage) // euclidean distance at every pixel for x=0 to imageWidth stepsize grid do // step in size that depends on brush radius for y=0 to imageHeight stepsize grid do { // sum the error near (x,y) M := the region (x-grid/2..x+grid/2, y-grid/2..y+grid/2) areaError := sum(D i,j for i,j in M) / grid 2 if (areaError > T) then { // find the largest error point (x1,y1) := max D i,j in M s :=makeStroke(R,x1,y1,referenceImage) add s to S } paint all strokes in S on the canvas, in random order } Slide credit: S. Chenney

Results OriginalBiggest brush Medium brush addedFinest brush added Slide credit: S. Chenney

Next Time  More Filters  De-noise