Blending and Compositing Computational Photography Derek Hoiem, University of Illinois 09/23/14.

Slides:



Advertisements
Similar presentations
CSCE 643 Computer Vision: Template Matching, Image Pyramids and Denoising Jinxiang Chai.
Advertisements

Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/15/11 “The Double Secret”, Magritte.
Image Blending and Compositing : Computational Photography Alexei Efros, CMU, Fall 2010 © NASA.
Lecture 6 Sharpening Filters
Blending and Compositing Computational Photography Connelly Barnes Many slides from James Hays, Alexei Efros.
Multiscale Analysis of Images Gilad Lerman Math 5467 (stealing slides from Gonzalez & Woods, and Efros)
CS 691 Computational Photography
Recap from Monday Frequency domain analytical tool computational shortcut compression tool.
Recap from Monday Fourier transform analytical tool computational shortcut.
A Gimp Plugin that uses “GrabCut” to perform image segmentation
Photo Stitching Panoramas from Multiple Images Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/28/12.
CS448f: Image Processing For Photography and Vision Graph Cuts.
Announcements Project 2 Out today Sign up for a panorama kit ASAP! –best slots (weekend) go quickly...
Blending and Compositing : Rendering and Image Processing Alexei Efros.
Image Pyramids and Blending
Image Pyramids Pre-filter images to collect information at different scalesPre-filter images to collect information at different scales More efficient.
An Iterative Optimization Approach for Unified Image Segmentation and Matting Hello everyone, my name is Jue Wang, I’m glad to be here to present our paper.
Image Compositing and Blending : Computational Photography Alexei Efros, CMU, Fall 2007 © NASA.
Lecture 8: Image Alignment and RANSAC
Image Pyramids and Blending : Computational Photography Alexei Efros, CMU, Fall 2005 © Kenneth Kwan.
4 – Image Pyramids. Admin stuff Change of office hours on Wed 4 th April – Mon 31 st March pm (right after class) Change of time/date of last.
Image Stitching II Ali Farhadi CSE 455
Image Pyramids and Blending
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/27/11 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Image Representation Gaussian pyramids Laplacian Pyramids
High dynamic range imaging. Camera pipeline 12 bits8 bits.
National Center for Supercomputing Applications University of Illinois at Urbana-Champaign Image Features Kenton McHenry, Ph.D. Research Scientist.
The Frequency Domain Somewhere in Cinque Terre, May 2005 Many slides borrowed from Steve Seitz CS194: Image Manipulation & Computational Photography Alexei.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/14/10 “The Double Secret”, Magritte.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/24/15 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Image Warping Computational Photography Derek Hoiem, University of Illinois 09/23/10 Many slides from Alyosha Efros + Steve Seitz Photo by Sean Carroll.
Mosaics Today’s Readings Szeliski, Ch 5.1, 8.1 StreetView.
Intelligent Scissors for Image Composition Anthony Dotterer 01/17/2006.
Image Stitching Ali Farhadi CSE 576 Several slides from Rick Szeliski, Steve Seitz, Derek Hoiem, and Ira Kemelmacher.
Image Filtering Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/02/10.
CS4670 / 5670: Computer Vision KavitaBala Lecture 17: Panoramas.
CS654: Digital Image Analysis Lecture 24: Introduction to Image Segmentation: Edge Detection Slide credits: Derek Hoiem, Lana Lazebnik, Steve Seitz, David.
Templates, Image Pyramids, and Filter Banks
Kylie Gorman WEEK 1-2 REVIEW. CONVERTING AN IMAGE FROM RGB TO HSV AND DISPLAY CHANNELS.
Mosaics part 3 CSE 455, Winter 2010 February 12, 2010.
Computational Photography lecture 8 – segmentation CS (future 572) Spring 2016 Prof. Alex Berg (Credits to many other folks on individual slides)
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Image Stitching II Linda Shapiro CSE 455. RANSAC for Homography Initial Matched Points.
Image Warping Many slides from Alyosha Efros + Steve Seitz + Derek oeim Photo by Sean Carroll.
Digital Image Processing Week V Thurdsak LEAUHATONG.
Cutting Images: Graphs and Boundary Finding Computational Photography Derek Hoiem, University of Illinois 09/20/12 “The Double Secret”, Magritte.
Image Stitching Computer Vision CS 691E Some slides from Richard Szeliski.
Hebrew University Image Processing Exercise Class 8 Panoramas – Stitching and Blending Min-Cut Stitching Many slides from Alexei Efros.
Recall: Gaussian smoothing/sampling G 1/4 G 1/8 Gaussian 1/2 Solution: filter the image, then subsample Filter size should double for each ½ size reduction.
Winter in Kraków photographed by Marcin Ryczek
Image Stitching II Linda Shapiro EE/CSE 576.
Image Blending : Computational Photography
Cutting Images: Graphs and Boundary Finding
Image Blending and Compositing
Computational Photography Derek Hoiem, University of Illinois
Image Processing and Reconstructions Tools
Image gradients and edges
Image Fusion for Context Enhancement and Video Surrealism
Multiscale Analysis of Images
Image Stitching II Linda Shapiro EE/CSE 576.
Image Stitching II Linda Shapiro CSE 455.
Patric Perez, Michel Gangnet, and Andrew Black
Image Stitching Computer Vision CS 678
Image Stitching II Linda Shapiro EE/CSE 576.
Winter in Kraków photographed by Marcin Ryczek
Photometric Processing
Computational Photography Derek Hoiem, University of Illinois
Templates and Image Pyramids
Presentation transcript:

Blending and Compositing Computational Photography Derek Hoiem, University of Illinois 09/23/14

hybridImage.m

pyramids.m

Hybrid results Pooja Bag

Donald Cha

Hao Gao

This Class How do I put an object from one image into another?

Image Compositing Some slides from Efros/Seitz

News Composites Original “Enhanced” Version 16/mubarak-doctored-red-carpet-picture

News Composites Original “Enhanced” Version Walski, LA Times, 2003

Three methods 1.Cut and paste 2.Laplacian pyramid blending 3.Poisson blending

Method 1: Cut and Paste

Method: Segment using intelligent scissors Paste foreground pixels onto target region

Method 1: Cut and Paste Problems: Small segmentation errors noticeable Pixels are too blocky Won’t work for semi-transparent materials

Feathering Near object boundary pixel values come partly from foreground and partly from background

Method 1: Cut and Paste (with feathering)

Alpha compositing + Output = foreground*mask + background*(1-mask)

Alpha compositing with feathering Output = foreground*mask + background*(1-mask)

Another example (without feathering) Mattes Composite by David Dewey Composite

Proper blending is key

Alpha Blending / Feathering = I blend =  I left + (1-  )I right

Affect of Window Size 0 1 left right 0 1

Affect of Window Size

Good Window Size 0 1 “Optimal” Window: smooth but not ghosted

How much should we blend?

Method 2: Pyramid Blending

Left pyramidRight pyramidblend At low frequencies, blend slowly At high frequencies, blend quickly

laplacian level 4 laplacian level 2 laplacian level 0 left pyramidright pyramidblended pyramid

Method 2: Pyramid Blending Burt and Adelson 1983

Laplacian Pyramid Blending Implementation: 1.Build Laplacian pyramids for each image 2.Build a Gaussian pyramid of region mask 3.Blend each level of pyramid using region mask from the same level 4.Collapse the pyramid to get the final blended image Burt and Adelson 1983 Region mask at level i of Gaussian pyramid Image 1 at level i of Laplacian pyramid Pointwise multiply

Simplification: Two-band Blending Brown & Lowe, 2003 – Only use two bands: high freq. and low freq. – Blends low freq. smoothly – Blend high freq. with no smoothing: use binary alpha

Low frequency High frequency 2-band Blending

Linear Blending

2-band Blending

Blending Regions

© Chris Cameron

Related idea: Poisson Blending A good blend should preserve gradients of source region without changing the background Perez et al. 2003

Related idea: Poisson Blending A good blend should preserve gradients of source region without changing the background Perez et al Project 3!

Method 3: Poisson Blending A good blend should preserve gradients of source region without changing the background Treat pixels as variables to be solved – Minimize squared difference between gradients of foreground region and gradients of target region – Keep background pixels constant Perez et al. 2003

Example Source: Evan Wallace Gradient Visualization

Source: Evan Wallace + Specify object region

Gradient-domain editing Creation of image = least squares problem in terms of: 1) pixel intensities; 2) differences of pixel intensities Least Squares Line Fit in 2 Dimensions Use Matlab least-squares solvers for numerically stable solution with sparse A

Examples 1.Line-fitting: y=mx+b

Examples 2. Gradient domain processing source image background image target image 10 v1v1 v3v3 v2v2 v4v

Other results Perez et al. 2003

What do we lose? Perez et al Foreground color changes Background pixels in target region are replaced

Blending with Mixed Gradients Use foreground or background gradient with larger magnitude as the guiding gradient Perez et al. 2003

Project 3: Gradient Domain Editing General concept: Solve for pixels of new image that satisfy constraints on the gradient and the intensity – Constraints can be from one image (for filtering) or more (for blending)

Project 3: Reconstruction from Gradients 1.Preserve x-y gradients 2.Preserve intensity of one pixel Source pixels: s Variable pixels: v 1.minimize (v(x+1,y)-v(x,y) - (s(x+1,y)-s(x,y))^2 2.minimize (v(x,y+1)-v(x,y) - (s(x,y+1)-s(x,y))^2 3.minimize (v(1,1)-s(1,1))^2

Project 3 (extra): Color2Gray rgb2gray ? Gradient-domain editing

Project 3 (extra): NPR Preserve gradients on edges – e.g., get canny edges with edge(im, ‘canny’) Reduce gradients not on edges Preserve original intensity Perez et al. 2003

DVS Camera Links Pencil balance – k k Quad Copter Tennis 7