Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital...
Transcript of Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital...
![Page 1: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/1.jpg)
CSC320: Introduction to Visual Computing
Michael GuerzhoyMany slides from
Steve Marschner, Alexei Efros, Noah Snavely
Upsampling and Interpolation
Nearest-neighbor interpolation
hq3x interpolation (ZSNES) http://en.wikipedia.org/wiki/Hqx
![Page 2: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/2.jpg)
Last time: Non-Maximum SuppressionAt q, we have a
maximum if the
value is larger than
those at both p and
at r. Interpolate to
get these values.
Source: D. Forsyth
![Page 3: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/3.jpg)
Interpolation
• See blackboard
![Page 4: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/4.jpg)
Bilinear Interpolation: Summary
![Page 5: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/5.jpg)
Bilinear Interpolation
• Not actually linear
– If you fix x it’s linear in y. If you fix y, it’s linear in x.
![Page 6: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/6.jpg)
Upsampling
• This image is too small for this screen:
• How can we make it 10 times as big?
• Simplest approach:
repeat each row
and column 10 times
• (“Nearest neighbor
interpolation”)
![Page 7: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/7.jpg)
Image interpolation
Recall how a digital image is formed
• It is a discrete point-sampling of a continuous function
• If we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale
1 2 3 4 5
Adapted from: S. Seitz
d = 1 in this
example
![Page 8: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/8.jpg)
Image interpolation
1 2 3 4 5
d = 1 in this
example
Recall how a digital image is formed
• It is a discrete point-sampling of a continuous function
• If we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale
Adapted from: S. Seitz
![Page 9: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/9.jpg)
Image interpolation
1 2 3 4 52.5
1
• Convert to a continuous function:
• Reconstruct by convolution with a reconstruction filter, h
• What if we don’t know ?• Guess an approximation:
• Can be done in a principled way: filtering
d = 1 in this
example.
Note: this is linear interpolation!
Adapted from: S. Seitz
![Page 10: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/10.jpg)
Image interpolation
“Ideal” reconstruction
Nearest-neighbor interpolation
Linear interpolation
Gaussian reconstruction
Source: B. Curless
![Page 11: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/11.jpg)
Reconstruction filters• What does the 2D version of this hat function look like?
Better filters give better resampled images
• Bicubic is common choice
performs linear interpolation
(tent function) performs bilinear interpolation
Cubic reconstruction filter
![Page 12: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/12.jpg)
Upsampling
• The empty pixels are initially set to 0
• Convolve with a (Gaussian, or another) filter
• If the filter sums to 1, multiply the result by 4
• ¾ of the new image was initially 0
![Page 13: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/13.jpg)
Image interpolation
Nearest-neighbor interpolation Bilinear interpolation Bicubic interpolation
Original image: x 10
![Page 14: Upsampling and Interpolationguerzhoy/320/lec/upsampling.pdfImage interpolation Recall how a digital image is formed •It is a discrete point-sampling of a continuous function •If](https://reader033.fdocuments.net/reader033/viewer/2022060415/5f131b6f614b675f66477f3e/html5/thumbnails/14.jpg)
Image interpolation
Also used for resampling