Interpolation in digital images

We might not realize it, but everytime we use Adobe Photoshop, we’re actually using interpolation techniques. Think about it this way - what happens when we resize/rotate/enlarge a photograph? There are only so many pixels involved in the image, that we will need to infer the type of pixel that we will need to fill up the empty spaces created by these functions on the image.

Resizing and rotating images 

This explains why when we enlarge images, the quality of the image always deteriorates. We only have a fixed number of pixels to interpolate the values of the “empty” pixels created as a result. Thus, the more we expand the image, the smaller the proportion of available values for us to interpolate with, resulting in decreasing picture quality.

Let’s take a look at image rotation now. An interesting observation to make in this situation is that when we rotate images by 90 degrees, we enjoy no loss in picture quality. This is because the imaging software is able to easily reposition the pixels in their relative positions in the rotated dimensions of the new picture. However, a problem crops up when we don’t rotate the images at right angles. When we rotate them at say, 45 degrees, values of certain boundary pixels may have to be changed because these pixels may fall midway between 2 pixels in the resultant image, forcing the algorithm to shift the value of that pixel into another position. So, just for fun, you should try continuously rotating a picture at 45 degree angles to see how much you can mess it up.

Simple interpolation techniques in imaging

Nearest neighbor: This is straightforward - The child pixel just copies the exact value of the parent pixel, which is the one next to it.

Bilinear: This uses the values of the 4 diagonally adjacent pixels to arrive at a weighted average value for the child pixel. Think about this in a tic-tac-toe matrix. The parent pixels are the 4 corner squares, while the child pixel is the one right in the middle.

Bicubic: This looks at the values of 16 other pixels to calculate the value of the child pixel. So imagine a bigger (7X7) tic-tac-toe matrix with the parent pixels taking up all the positions with odd co-efficients (satisfies the condition that x mod 2 = 1, y mod 2 = 1) and the child pixel is still the one right in the middle (x= 4, y=4). In this situation, the closer pixels will have a greater weight in calculating the value of the child pixel. 

Spline and sinc interpolation techniques are also using in image processing, but I guess we haven’t reached a point when this is relevant to our course material yet.

Reference: http://www.cambridgeincolour.com/tutorials/image-interpolation.htm

Posted in Topics: Uncategorized

Jump down to leave a comment.

One response to “Interpolation in digital images”

  1. Cornell CS 322 - Intro to Scientific Computing » Blog Archive » A comparison of some graphical interpolation techniques, plus a look at an extremely good, brand new algorithm. Says:

    […] interpolation, be sure to check some great blog-posts that have come before mine (here and here, for example). After going over these posts, I was curious about the performance difference of […]

Leave a Comment

You must be logged in to post a comment.



* You can follow any responses to this entry through the RSS 2.0 feed.