Download presentation
Presentation is loading. Please wait.
1
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 5: Image Processing 2: Warping Ravi Ramamoorthi http://www.cs.columbia.edu/~cs4162
2
To Do Assignment 1, Due Feb 16. All info in this and previous lecture Enough to implement second half of assn Questions/difficulties so far in doing assignment?
3
Outline Image Warping General ideas Resampling filters Antialiased shift and resize Not well covered in textbook Many slides courtesy Tom Funkhouser
4
Image Warping
5
A note on notation This lecture uses (u,v) for warped location in the source image (or old coordinates) and (u', v') for integer coordinates, and (x,y) for new coordinates Most of the homework assignment uses (x,y) for old integer coordinates and (a,b) for new coordinates. The warped location is not written explicitly, but is implicit in the evaluation of the filter f
6
Example Mappings
9
Forward Warping/Mapping Iterate over source, sending pixels to destination
10
Forward 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.
11
Inverse Warping/Mapping Iterate destination, finding pixels from source
12
Inverse 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
13
Outline Image Warping General ideas Resampling filters Antialiased shift and resize Not well covered in textbook Many slides courtesy Tom Funkhouser
14
Filtering or Resampling Compute weighted sum of pixel neighborhood Weights are normalized values of kernel function Equivalent to convolution at samples with kernel Find good (normalized) filters h using ideas of last lecture (u,v) width=2 s=0 ; for (u ' = u-width ; u ' <= u+width; u ' ++) for (v' = v-width ; v ' <= v+width; v ' ++) s += h (u ' - u, v' - v) src (u ', v ') ;
15
Inverse Warping/Mapping Iterate destination, finding pixels from source Filter is really square with width w, not circle
16
A note on notation This lecture uses (u,v) for warped location in the source image (or old coordinates) and (u', v') for integer coordinates, and (x,y) for new coordinates Most of the homework assignment uses (x,y) for old integer coordinates and (a,b) for new coordinates. The warped location is not written explicitly, but is implicit in the evaluation of the filter This lecture uses h for filter (so as not to confuse with mapping f), while assignment uses f Assignment has some notational misprints, corrected here.
17
Filters 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
18
Filtering Methods Comparison
19
Outline Image Warping General ideas Resampling filters Antialiased shift and resize Not well covered in textbook Many slides courtesy Tom Funkhouser
20
Antialiased Shift Shift image based on (fractional) s x and s y Check for integers, treat separately Otherwise convolve/resample with kernel/filter: In notation of assignment (note slight misprint RHS should be (x,y))
21
Antialiased Scale Magnification Magnify image (scale s or γ > 1) [read s as γ in assn] Interpolate between orig. samples to evaluate frac vals Do so by convolving/resampling with kernel/filter: Treat the two image dimensions independently (diff scales) In notation of assignment
22
Antialiased Scale Minification checkerboard.bmp 300x300: point sample checkerboard.bmp 300x300: Mitchell
23
Antialiased Scale Minification Minify (reduce size of) image Similar in some ways to mipmapping for texture maps We use fat pixels of size 1/γ, with new size γ*orig size (γ is scale factor < 1). Each fat pixel must integrate over corresponding region in original image using the filter kernel. In notation of assignment
24
Antialiased Scale Minification Minify (reduce size of) image Similar in some ways to mipmapping for texture maps We use fat pixels of size 1/γ, with new size γ*orig size (γ is scale factor < 1). Each fat pixel must integrate over corresponding region in original image using the filter kernel. Hence, filter width 1/ γ normal width Requires renormalization to work properly Caveats: floating point, parametric form for filter
25
To Do Assignment 1, Due Feb 16. All info in this and previous lecture Enough to implement second half of ass Questions/difficulties so far in doing assignment?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.