More Image Manipulation

Slides:



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

Image Interpolation CS4670: Computer Vision Noah Snavely.
15-463: Computational Photography Alexei Efros, CMU, Spring 2010 Most slides from Steve Marschner Sampling and Reconstruction.
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
Slides from Alexei Efros
CS 691 Computational Photography
Computational Photography: Sampling + Reconstruction Connelly Barnes Slides from Alexei Efros and Steve Marschner.
Linear Filtering – Part II Selim Aksoy Department of Computer Engineering Bilkent University
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Filtering CSE P 576 Larry Zitnick
Image Filtering, Part 2: Resampling Today’s readings Forsyth & Ponce, chapters Forsyth & Ponce –
Convolution, Edge Detection, Sampling : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz.
Affine Linear Transformations Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
Sampling and Pyramids : Rendering and Image Processing Alexei Efros …with lots of slides from Steve Seitz.
Edges and Scale Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski – From Sandlot ScienceSandlot.
Lecture 2: Edge detection and resampling
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
Image transformations, Part 2 Prof. Noah Snavely CS1114
Image Sampling Moire patterns
Lecture 3: Edge detection, continued
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
Lecture 4: Image Resampling CS4670: Computer Vision Noah Snavely.
Lecture 3: Image Resampling CS4670: Computer Vision Noah Snavely Nearest-neighbor interpolation Input image 3x upsample hq3x interpolation (ZSNES)
CPSC 641 Computer Graphics: Fourier Transform Jinxiang Chai.
Computational Photography: Fourier Transform Jinxiang Chai.
Slides from Alexei Efros, Steve Marschner Filters & fourier theory.
Image Sampling Moire patterns -
Fourier Analysis : Rendering and Image Processing Alexei Efros.
Image Pyramids and Blending
Robust fitting Prof. Noah Snavely CS1114
Image Sampling CSE 455 Ali Farhadi Many slides from Steve Seitz and Larry Zitnick.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 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.
Image Resampling CS4670: Computer Vision Noah Snavely.
Image Resampling CS4670: Computer Vision Noah Snavely.
Lecture 4: Image Resampling and Reconstruction CS4670: Computer Vision Kavita Bala.
Image Processing Edge detection Filtering: Noise suppresion.
Lecture 3: Edge detection CS4670/5670: Computer Vision Kavita Bala From Sandlot ScienceSandlot Science.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Image Processing.
Lecture 5: Fourier and Pyramids
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
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.
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.
Image Resampling & Interpolation
Linear Filtering – Part II
Many slides from Steve Seitz and Larry Zitnick
CS 4501: Introduction to Computer Vision Sparse Feature Detectors: Harris Corner, Difference of Gaussian Connelly Barnes Slides from Jason Lawrence, Fei.
Image Sampling Moire patterns
Image transformations
Image transformations
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
Object recognition Prof. Graeme Bailey
Recap from Wednesday Spectra and Color Light capture in cameras and humans.
Image Sampling Moire patterns
Jeremy Bolton, PhD Assistant Teaching Professor
Multiscale Analysis of Images
Recap from Friday Image Completion Synthesis Order Graph Cut Scene Completion.
Sampling and Reconstruction
CSCE 643 Computer Vision: Thinking in Frequency
Samuel Cheng Slide credits: Noah Snavely
Image Processing Today’s readings For Monday
Filtering Part 2: Image Sampling
Linear filtering.
Image Sampling Moire patterns
Lecture 5: Resampling, Compositing, and Filtering Li Zhang Spring 2008
Image Resampling & Interpolation
Resampling.
Samuel Cheng Slide credits: Noah Snavely
Presentation transcript:

More Image Manipulation Prof. Graeme Bailey http://cs1114.cs.cornell.edu (notes modified from Noah Snavely, Spring 2009)

Last time: image transformations

2D Linear Transformations Can be represented with a 2D matrix And applied to a point using matrix multiplication

Forward mapping Lots of problems came up trying to enlarge a image…

How do we fix this? Answer: do the opposite! Create an output image For each pixel in the output image, find the corresponding pixel in the input image* Give that output pixel the same color *Requires that we invert the mapping

Inverse mapping How do we invert the mapping? With linear transformations T, we invert T

Inverse mapping

Resampling Suppose we scale image by 2 T = [ 2 0 ; 0 2 ] inv(T) = ? Pixel (5,5) in img_out should be colored with pixel (2.5, 2.5) in img_in How do we find the intensity at (2.5, 2.5)?

Downsampling Suppose we scale image by 0.25 – a different problem with some surprising issues …

Downsampling Which pixels were picked from the larger image to choose colour values?

What’s going on? Aliasing can arise when you sample a continuous signal or image Occurs when the sampling rate is not high enough to capture the detail in the image Can give you the wrong signal/image—an alias

2D example Good sampling Bad sampling

Image credit: Steve Seitz Examples of aliasing Wagon wheel effect Moiré patterns Image credit: Steve Seitz

Slide credits: Steve Seitz This image is too big to fit on the screen. How can we create a half-sized version? Slide credits: Steve Seitz

Image sub-sampling 1/8 1/4 Current approach: throw away every other row and column (subsample)

Image sub-sampling 1/2 1/4 (2x zoom) 1/8 (4x zoom)

Image sub-sampling What’s really going on? Which one to pick, or should we somehow merge all values?

Subsampling with pre-filtering Average 2x2 Average 4x4 Average 8x8 Solution: blur the image, then subsample Filter size should double for each ½ size reduction.

Subsampling with pre-filtering Average 8x8 Average 4x4 Average 2x2 Solution: blur the image, then subsample Filter size should double for each ½ size reduction.

Compare with 1/8 1/4

Weighted averaging Filtering, aka convolution (a very big topic!) Take one image, the kernel (usually small) to act as a (weighted) averager, then slide it over another image (usually big) At each point/pixel, multiply the kernel times the image, and add up the results This is the new value of the image … example:

Sometimes we want many resolutions Known as a Gaussian Pyramid [Burt and Adelson, 1983] In computer graphics, a mip map [Williams, 1983] A precursor to wavelet transform

More image transformations Default rotation is around the point (0, 0) – the upper-left corner of the image This probably isn’t really what we want…

Translation We really want to rotate around the center of the image Nice trick: move the center of the image to the origin, apply the default rotation, then move the center back (Moving an image is called “translation”) But technically, translation isn’t a linear function - check the two definition properties for f(v) = v + w (for some constant vector w)… f(v + u) =? f(v) + f(u) f(av) =? a f(v) Formally we call this an affine linear function LHS = v + u + w RHS = v + u + 2w LHS = av + w RHS = av + 2aw

Detour: Homogeneous coordinates Add a 1 to the end of our 2D points (x, y)  (x, y, 1) “Homogeneous” 2D points We can represent transformations on 2D homogeneous coordinates as 3D matrices What does that mean we’re doing geometrically?

Translation via homogeneous coordinates Other transformations just add an extra row and column with [ 0 0 1 ] scale rotation

Rotation about image centre Translate center to origin Rotate Translate back to center