Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 5: Image Processing 2: Warping Ravi...

Post on 20-Dec-2015

215 views 0 download

Tags:

Transcript of Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 5: Image Processing 2: Warping Ravi...

Advanced Computer Graphics Advanced Computer Graphics (Spring 2005) (Spring 2005)

COMS 4162, Lecture 5: Image Processing 2: Warping

Ravi Ramamoorthi

http://www.cs.columbia.edu/~cs4162

To Do To Do

Assignment 1, Due Feb 15. All info in this and previous lecture Enough to implement second half of ass

Questions/difficulties so far in doing assignment?

OutlineOutline

Image Warping General ideas Resampling filters Antialiased shift and resize

Not well covered in textbook

Many slides courtesy Tom Funkhouser

Image WarpingImage Warping

Example MappingsExample Mappings

Example MappingsExample Mappings

Example MappingsExample Mappings

Forward Warping/MappingForward Warping/Mapping

Iterate over source, sending pixels to destination

Forward Warping: ProblemsForward Warping: Problems

Iterate over source, sending pixels to destination

Same source pixel may map to multiple dest pixels

Some dest pixels may have no corresponding source

Holes in reconstruction

Must splat etc.

Inverse Warping/MappingInverse Warping/Mapping

Iterate destination, finding pixels from source

Inverse Warping/MappingInverse Warping/Mapping

Iterate over dest, finding pixels from source

Non-integer evaluation source image, resample

May oversample source

But no holes

Simpler, better than forward mapping

OutlineOutline

Image Warping General ideas Resampling filters Antialiased shift and resize

Not well covered in textbook

Many slides courtesy Tom Funkhouser

Filtering or ResamplingFiltering or Resampling

Compute weighted sum of pixel neighborhood Weights are normalized values of kernel function Equivalent to convolution at samples with kernel Find good filters using ideas of last lecture

Filters for AssignmentFilters for Assignment

Implement 3 filters Nearest neighbor or point sampling Hat filter (linear or triangle)

Mitchell cubic filter (form in assigments). This is a good finite filter that approximates ideal sinc but without ringing or infinite width. Alternative is gaussian

Construct 2D filters by multiplying 1D filters

( ) 1 | |f x x

( , ) ( ) ( )f x y f x f y

Filtering Methods ComparisonFiltering Methods Comparison

Inverse Warping/MappingInverse Warping/Mapping

Iterate destination, finding pixels from source

OutlineOutline

Image Warping General ideas Resampling filters Antialiased shift and resize

Not well covered in textbook

Many slides courtesy Tom Funkhouser

Antialiased ShiftAntialiased Shift

Shift image based on (fractional) x and y Check for integers, treat separately Otherwise convolve/resample with kernel/filter:

,

( , ) ( , ) ( , )new oldx y

I a b f x a sx y b sy I x y

Antialiased Scale MagnificationAntialiased Scale Magnification

Magnify image Interpolate between orig. samples to evaluate frac vals Do so by convolving/resampling with kernel/filter:

,

( , ) ( , ) ( , ) 1new oldx y

a bI a b f x y I x y s

s s

Antialiased Scale MinificationAntialiased Scale Minification

checkerboard.bmp 300x300: point sample checkerboard.bmp 300x300: Mitchell

Antialiased Scale MinificationAntialiased Scale Minification

Minify (reduce size of) image Similar in some ways to mipmapping for texture maps We use fat pixels of size 1/s, with new size sw (w is

original size, s is scale factor < 1). Each fat pixel must integrate over corresponding region in

original image using the kernel f.

Antialiased Scale MinificationAntialiased Scale Minification

Minify (reduce size of) image Similar in some ways to mipmapping for texture maps We use fat pixels of size 1/s, with new size sw (w is

original size, s is scale factor < 1). Each fat pixel must integrate over corresponding region in

original image using the kernel f.

Hence, center filter at a/s, width 1/s times normal width Caveats: floating point, parametric form for filter

,

( , ) ( , ) ( , ) 1new oldx y

I a b f sx a sy b I x y s

To Do To Do

Assignment 1, Due Feb 15. All info in this and previous lecture Enough to implement second half of ass

Questions/difficulties so far in doing assignment?