How is project #1 going?

Similar documents
Last Lecture. Edge Detection. Filtering Pyramid

Image Warping CSE399b, Spring 07 Computer Vision

Image Warping. Some slides from Steve Seitz

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Image Warping. Some slides from Steve Seitz

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

Image Warping (Szeliski Sec 2.1.2)

Image Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision

Warping, Morphing and Mosaics

Image warping. image filtering: change range of image. image warping: change domain of image g(x) = f(h(x)) h(y)=0.5y+0.5. h([x,y])=[x,y/2] f h

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Warping. 12 May 2015

Image warping/morphing

CS4670: Computer Vision

Prof. Feng Liu. Winter /05/2019

Scene Graphs & Modeling Transformations COS 426

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

Modeling Transformations

Modeling Transformations

Modeling Transformations

Modeling Transformations

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Photo by Carl Warner

Modeling Transformations

CS 335 Graphics and Multimedia. Geometric Warping

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

3D Geometry and Camera Calibration

Image warping , , Computational Photography Fall 2017, Lecture 10

Multi-stable Perception. Necker Cube

Image Metamorphosis By Affine Transformations

Editing and Transformation

Fitting a transformation: Feature-based alignment April 30 th, Yong Jae Lee UC Davis

M y. Image Warping. Targil 7 : Image Warping. Image Warping. 2D Geometric Transformations. image filtering: change range of image g(x) = T(f(x))

Geometric Image Transformations and Related Topics

Homogeneous Coordinates

Image Transformations

Image Warping and Morphing. Alexey Tikhonov : Computational Photography Alexei Efros, CMU, Fall 2007

CS4670: Computer Vision

Image Warping and Morphing. Alexey Tikhonov

3-Dimensional Viewing

Computer Graphics. Geometric Transformations

Affine and Projective Transformations

Computer Graphics. Geometric Transformations

Image Warping and Morphing. Alexey Tikhonov

Limitations of Thresholding

Image warping/morphing

Scale Invariant Feature Transform (SIFT) CS 763 Ajit Rajwade

The 3-D Graphics Rendering Pipeline

Transformations II. Week 2, Wed Jan 17

3D Computer Vision II. Reminder Projective Geometry, Transformations. Nassir Navab. October 27, 2009

Modeling Transformations Revisited

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

Computer Vision Lecture 20

Introduction to Computer Vision

2D transformations and homogeneous coordinates

CS F-07 Objects in 2D 1

Image Alignment AJIT RAJWADE

Perspective Projection Transformation

3D Coordinates & Transformations

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

High Dimensional Rendering in OpenGL

Geometric Model of Camera

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

Computer Graphics. 2D transformations. Transforma3ons in computer graphics. Overview. Basic classes of geometric transforma3ons

CS4670: Computer Vision

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

Broad field that includes low-level operations as well as complex high-level algorithms

CAP5415-Computer Vision Lecture 8-Mo8on Models, Feature Tracking, and Alignment. Ulas Bagci

Motion estimation. Lihi Zelnik-Manor

Optical flow. Cordelia Schmid

EE795: Computer Vision and Intelligent Systems

EECS 556 Image Processing W 09

Two Dimensional Viewing

Linear Algebra and Image Processing: Additional Theory regarding Computer Graphics and Image Processing not covered by David C.

Image Warping and Mosacing

Handling Noise in Single Image Deblurring using Directional Filters

Prof. Feng Liu. Fall /25/2018

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

What and Why Transformations?

CSE528 Computer Graphics: Theory, Algorithms, and Applications

IMAGE DENOISING TO ESTIMATE THE GRADIENT HISTOGRAM PRESERVATION USING VARIOUS ALGORITHMS

Prof. Kristen Grauman

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science

Computer Graphics. Si Lu. Fall er_graphics.htm 10/11/2017

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

More on Transformations. COS 426, Spring 2019 Princeton University

[ ] [ ] Orthogonal Transformation of Cartesian Coordinates in 2D & 3D. φ = cos 1 1/ φ = tan 1 [ 2 /1]

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

N-Views (1) Homographies and Projection

CS770/870 Spring 2017 Transformations

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

Transcription:

How is project # going?

Last Lecture Edge Detection Filtering Pramid

Toda Motion Deblur Image Transformation

Removing Camera Shake from a Single Photograph Rob Fergus, Barun Singh, Aaron Hertzmann, Sam T. Roweis and William T. Freeman http://people.csail.mit.edu/fergus/research/deblur.html Massachusetts Institute of Technolog and Universit of Toronto

Overview Original Our algorithm

Close-up Original Naïve Sharpening Our algorithm

Let s take a photo Blurr result

Slow-motion repla

Slow-motion repla Motion of camera

Image formation process = Blurr image Sharp image Blur kernel Input to algorithm Model is approimation Desired output Convolution operator

Wh is this hard? Simple analog: is the product of two numbers. What are the? No unique solution: = = 2 5.5 = 3 3.667 etc.. Need more information!!!!

Multiple possible solutions Sharp image Blur kernel = Blurr image = =

Natural image statistics Characteristic distribution with heav tails Histogram of image gradients

Blur images have different statistics Histogram of image gradients

Parametric distribution Histogram of image gradients Use parametric model of sharp image statistics

Three sources of information. Reconstruction constraint: = Estimated sharp image Estimated blur kernel Input blurr image 2. Image prior: 3. Blur prior: Distribution of gradients Positive & Sparse

Variational Baesian method Based on work of Miskin & Macka 2 Keeps track of uncertaint in estimates of image and blur b using a distribution instead of a single estimate Helps avoid local maima and over-fitting

Variational Baesian method Objective function for a single variable Maimum a-posteriori (MAP) Score Variational Baes Piel intensit

Overview of algorithm. Pre-processing Input image 2. Kernel estimation - Multi-scale approach 3. Image reconstruction - Standard non-blind deconvolution routine

Preprocessing Input image Convert to grascale Remove gamma correction User selects patch from image Baesian inference too slow to run on whole image Infer kernel from this patch

Initialization Input image Convert to grascale Remove gamma correction User selects patch from image Initialize 33 blur kernel Blurr patch Initial image estimate Initial blur kernel

Inferring the kernel: multiscale method Input image Convert to grascale Remove gamma correction Loop over scales User selects patch from image Upsample estimates Variational Baes Initialize 33 blur kernel Use multi-scale approach to avoid local minima:

Image Reconstruction Input image Convert to grascale Remove gamma correction Loop over scales User selects patch from image Full resolution blur estimate Upsample estimates Variational Baes Initialize 33 blur kernel Non-blind deconvolution (Richardson-Luc) Deblurred image

Results on real images Submitted b people from their own photo collections Tpe of camera unknown Output does contain artifacts Increased noise Ringing Compares well to eisting methods

Original photograph

Blur kernel Our output

Original photograph Matlab s deconvblind

Original photograph

Matlab s deconvblind

Photoshop sharpen more

Our output Blur kernel

Original photograph

Our output Blur kernel

Original photograph

Our output Blur kernel

Matlab s deconvblind

Original photograph

Our output Blur kernel

Close-up of bird Original Our output

Original photograph

Blur kernel Our output

Image artifacts & estimated kernels Blur kernels Image patterns Note: blur kernels were inferred from large image patches, NOT the image patterns shown

Summar Method for removing camera shake from real photographs First method that can handle complicated blur kernels Uses natural image statistics Non-blind deconvolution currentl simplistic

Image Warping image filtering: change range of image g() = T(f()) f T f image warping: change domain of image g() = f(t()) f T f

Image Warping image filtering: change range of image g() = T(f()) T image warping: change domain of image g() = f(t()) T

Parametric (global) warping Eamples of parametric warps: translation rotation aspect affine perspective clindrical

Parametric (global) warping T p = (,) p = (, ) Transformation T is a coordinate-changing machine: p = T(p) What does it mean that T is global? Is the same for an point p can be described b just a few numbers (parameters) Let s represent T as a matri: p = Mp = M

Scaling Scaling a coordinate means multipling each of its components b a scalar Uniform scaling means this scalar is the same for all components: 2

Scaling Non-uniform scaling: different scalars per component: X 2, Y.5

Scaling Scaling operation: Or, in matri form: b a = = = b a scaling matri S What s inverse of S?

2-D Rotation (, ) (, ) θ = cos(θ) - sin(θ) = sin(θ) + cos(θ)

2-D Rotation This is eas to capture in matri form: = cos sin θ ( θ ) sin( θ ) ( ) ( ) R cos θ Even though sin(θ) and cos(θ) are nonlinear functions of θ, is a linear combination of and is a linear combination of and What is the inverse transformation? Rotation b θ For rotation matrices R = R T

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Identit? = = = 2D Scale around (,)? s s * * = = = s s

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Rotate around (,)? * cos * sin * sin * cos Θ + Θ = Θ Θ = Θ Θ Θ Θ = cos sin sin cos 2D Shear? sh sh + = + = * * = sh sh

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Mirror about Y ais? = = = 2D Mirror over (,)? = = =

22 Matrices What tpes of transformations can be represented with a 22 matri? 2D Translation? = + t = + t NO! Onl linear 2D transformations can be represented with a 22 matri

All 2D Linear Transformations Linear transformations are combinations of Scale, Rotation, Shear, and = Mirror Properties of linear transformations: Origin maps to origin Lines map to lines Parallel lines remain parallel Ratios are preserved Closed under composition = a c be d g a c b d f i h k j l

Homogeneous Coordinates Q: How can we represent translation as a 33 matri? = + t = + t

Homogeneous Coordinates Homogeneous coordinates represent coordinates in 2 dimensions with a 3-vector

Homogeneous Coordinates Q: How can we represent translation as a 33 matri? A: Using the rightmost column: = t t Translation t t + = + =

Translation Eample of translation + + = = t t t t t = 2 t = Homogeneous Coordinates

Homogeneous Coordinates Add a 3rd coordinate to ever 2D point (,, w) represents a point at location (/w, /w) (,, ) represents a point at infinit (,, ) is not allowed 2 (2,,) or (4,2,2) or (6,3,3) Convenient coordinate sstem to represent man useful transformations 2

Basic 2D Transformations Basic 2D transformations as 33 matrices Θ Θ Θ Θ = cos sin sin cos = t t = sh sh Translate Rotate Shear = s s Scale

Affine Transformations Affine transformations are combinations of Linear transformations, and Translations Properties of affine transformations: Origin does not necessaril map to origin Lines map to lines Parallel lines remain parallel Ratios are preserved Closed under composition = w f e d c b a w

Projective Transformations Projective transformations Affine transformations, and Projective warps Properties of projective transformations: Origin does not necessaril map to origin Lines map to lines Parallel lines do not necessaril remain parallel Ratios are not preserved Closed under composition = w i h g f e d c b a w

Matri Composition Transformations can be combined b matri multiplication Θ Θ Θ Θ = w s s t t w cos sin sin cos p = T(t,t ) R(Θ) S(s,s ) p

2D image transformations These transformations are a nested set of groups Closed under composition and inverse is a member

Recovering Transformations? T(,) f(,) g(, ) What if we know f and g and want to recover the transform T? Using correspondences How man do we need?

Translation: # correspondences? How man correspondences needed for translation? How man Degrees of Freedom? What is the transformation matri? T(,)? = p p p p M

Euclidian: # correspondences?? T(,) How man correspondences needed for translation+rotation? How man DOF?

Affine: # correspondences?? T(,) How man correspondences needed for affine? How man DOF?

Projective: # correspondences?? T(,) How man correspondences needed for projective? How man DOF?

Eample: warping triangles Given two triangles: ABC and A B C in 2D (2 numbers) Need to find transform T to transfer all piels from one to the other. What kind of transformation is T? How can we compute the transformation matri: T(,)? A B Source C A C B Destination = f e d c b a

warping triangles (Barcentric Coordinaes) (,) A B Source T C (,) (,) Inverse change of basis change of basis A T 2 B Destination Don t forget to move the origin too! C Ver useful in Graphics

Image warping T(,) f(,) g(, ) Given a coordinate transform (, ) = T(,) and a source image f(,), how do we compute a transformed image g(, ) = f(t(,))?

Forward warping T(,) f(,) g(, ) Send each piel f(,) to its corresponding location (, ) = T(,) in the second image Q: what if piel lands between two piels?

Forward warping T(,) f(,) g(, ) Send each piel f(,) to its corresponding location (, ) = T(,) in the second image Q: what if piel lands between two piels? A: distribute color among neighboring piels (, ) Known as splatting

Inverse warping T - (,) f(,) g(, ) Get each piel g(, ) from its corresponding location (,) =T - (, ) in the first image Q: what if piel comes from between two piels?

Inverse warping T - (,) f(,) g(, ) Get each piel g(, ) from its corresponding location (,) =T - (, ) in the first image Q: what if piel comes from between two piels? A: Interpolate color value from neighbors nearest neighbor, bilinear, Gaussian, bicubic