

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Geometric transformations of an image, such as resizing, produce images whose pixels typically don’t align with pixels in the original image. This raises the question of what values to assign to the pixels in the transformed image. This can be accomplished using interpolation. Most interpolation approaches estimate the pixel values in the transformed image using the values of the “closest” pixels in the original image.
Note that rethinking the transformation helps with solving this problem. All we really want are the pixel values in the transformed image. So, rather than computing where the pixels in the original image are mapped to, such as in the diagram below,
is mapped to
we know the values at pixels marked by ·
we seek the values at pixels marked
resize x^ x^ x
x x x
x x x
original transformed
we instead compute where the pixels in the transformed image are mapped from, as in the diagram below,
is mapped from
we know the values at pixels marked by ·
we seek the values at pixels marked
resize x^ x x
x x x
x x x
original transformed
Thus, we actually perform the inverse mapping.
Once we have computed where the pixel is mapped from, we can use the values of surrounding pixels in the original image (whose values we know) to estimate the value of the pixel in the transformed image. Nearest neighbor interpolation uses the value of the closest pixel. Bilinear interpolation uses the values of the four closest pixels. In this problem, you will explore how to determine these pixels.
To simplify the problem, we will work in 1D. Instead of determining the closest pixels in an image, we will only consider the closest pixels in an array. The extension to 2D is straightforward. We will also only consider resizing as the geometric transformation.
We will model a 1D M pixel “image” as follows
pixel boundaries pixel locations
0.5 1.0 1.5 2.0 2.5 3.0 3.5 M-0.5 M M+0.
image boundary
Now, the inverse mapping of a pixel in a transformed image of size M’ to an original image of size M can be viewed as follows
original 1 2 3 … M
x
m’ (^) M’ 1 2 … …
0.5 1.0 1.5 2.0 2.5 3.0 3.5 M-0.5 M M+0.
0.5 1.0 1.5 2.0 2.5 m’ M’-0.5 M’ M’+0.
transformed