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

23
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
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    0

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

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

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

Page 2: Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 5: Image Processing 2: Warping Ravi Ramamoorthi 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?

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

OutlineOutline

Image Warping General ideas Resampling filters Antialiased shift and resize

Not well covered in textbook

Many slides courtesy Tom Funkhouser

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

Image WarpingImage Warping

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

Example MappingsExample Mappings

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

Example MappingsExample Mappings

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

Example MappingsExample Mappings

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

Forward Warping/MappingForward Warping/Mapping

Iterate over source, sending pixels to destination

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

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.

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

Inverse Warping/MappingInverse Warping/Mapping

Iterate destination, finding pixels from source

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

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

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

OutlineOutline

Image Warping General ideas Resampling filters Antialiased shift and resize

Not well covered in textbook

Many slides courtesy Tom Funkhouser

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

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

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

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

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

Filtering Methods ComparisonFiltering Methods Comparison

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

Inverse Warping/MappingInverse Warping/Mapping

Iterate destination, finding pixels from source

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

OutlineOutline

Image Warping General ideas Resampling filters Antialiased shift and resize

Not well covered in textbook

Many slides courtesy Tom Funkhouser

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

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

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

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

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

Antialiased Scale MinificationAntialiased Scale Minification

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

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

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.

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

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

Page 23: Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 5: Image Processing 2: Warping Ravi Ramamoorthi 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?