Analysis and comparison of common image interpolation algorithms

Source: Internet
Author: User
Tags comparison scale image

Reference: http://www.cnblogs.com/okaimee/archive/2010/08/18/1802585.html

Absrtact: Interpolation algorithm is a basic and important problem in image scaling processing. There are many interpolation algorithms, the most commonly used are nearest neighbor interpolation, bilinear interpolation, and cubic convolution interpolation.   In this paper, we analyze three kinds of interpolation algorithms and compare their results, and summarize the advantages and disadvantages of the three kinds of algorithms. Keywords: image processing; nearest neighbor interpolation; bilinear interpolation; cubic convolution interpolation
  
1 Introduction
Image geometric transformations include panning, transpose, mirroring, and zooming. Of the first three operation transformations, each pixel point of the output image has a specific pixel in the input image corresponding to it. However, in a scaling operation, the pixel coordinates of the output image may correspond to the position of pixels in the input image, and this time it is necessary to calculate the grayscale value of the output point by the grayscale interpolation process [1]. Image interpolation is an important part of image super-resolution processing, different interpolation algorithms have different accuracy, the quality of interpolation algorithm directly affects the degree of distortion of image. The most commonly used interpolation algorithms are three kinds:
Nearest neighbor interpolation, bilinear interpolation, cubic convolution, where cubic convolution interpolation achieves the best results.
2 principle analysis of several interpolation algorithms
Interpolation algorithm is used in many fields, the image scaling processing is a more typical application, because the image pixel gray value is discrete, so the general processing method is the original pixel value on the integer coordinates to interpolate to create a continuous surface, and then re-sampled on the interpolated surface to obtain the scale image pixel gray value. Scaling processing from the output image, using the reverse mapping method, that is, in the output image to find the corresponding input image of one or some of the pixels, using this method can ensure that the output image of each pixel has a certain value, otherwise, if the output image from the input image to calculate, The pixel points of the output image may appear without grayscale values. Because there may no longer be one by one correspondence between the output image pixel and the input image when scaling the image. The following three kinds of algorithms are introduced respectively.
The simplest interpolation method of the 2.1 nearest neighbor interpolation algorithm is the nearest neighbor interpolation method, also called the 0-order interpolation method [2]. That is, the grayscale value of the input pixel closest to the location to which it is mapped is the interpolated result. For a two-dimensional image, the gray value of the nearest 1 adjacent points in the 4 adjacent pixel points around the sample point is taken as the pixel value of the sample point to be measured. If the coordinates of the output image (x′,y′) are in the corresponding position (m,n) after the geometric transformation, the schematic diagram is as follows:
2.2 bilinear interpolation is also called the first-order interpolation method [3], it has to pass three interpolation to obtain the final result, is an improvement of the nearest neighbor interpolation method, first order linear interpolation in two horizontal directions, and then in the vertical direction of the first order linear interpolation.
2.3 Cubic convolution interpolation algorithm cubic convolution is also called Double three times interpolation [2], is the improvement of bilinear interpolation, is a more complex interpolation method, it not only takes into account the surrounding four direct neighboring pixel gray value of the influence, but also take into account their gray value change rate of influence.
This method uses a grayscale value of 16 pixels near the sampling point for three interpolation and uses the three polynomial S (W) shown in Figure 3.
First, the coordinates of 16 neighbors are determined, and the matrix is arranged in [2]:
The method of square convolution is degenerate into bilinear interpolation method. As a result, cubic convolution can be seen as a two-part composition, where (1-| m|) The gray value of the direct neighbor is treated as the influence of the sampling point, while L represents the influence of the change rate of the gray value between the neighbors on the sampling point. Compared with bilinear interpolation method, the cubic convolution method not only considers the influence of the gray value of the direct neighbor to the sampling point, but also considers the influence of the change rate of the gray value among the neighboring points, so the gray value of the sampled point is more accurate.
Processing results and analysis of 33 interpolation algorithms
By using three kinds of interpolation algorithms to scale the image, it is possible to visually compare the effect after processing. The following is a grayscale image of 128*128 pixels zoomed in twice times to get an image of 256*256 size.
3.1 Zoom operation effect Diagram (a) 128*128 source map (b) Recent ortho interpolation magnification (c) bilinear interpolation magnification (d) cubic convolution interpolation figure 4 effect Figure 3.2 Results analysis from three interpolation algorithm processing the image after the comparison results: The nearest neighbor interpolation method has the worst effect, there are obvious jagged shape, And the details are not clear. bilinear interpolation effect Second, the sawtooth is difficult to detect, but the edge of the image is slightly blurred. Cubic convolution interpolation is the best effect in three interpolation methods, it can overcome the shortcomings of the first two interpolation methods, produce a clearer image edge, high computational accuracy.
Summary of advantages and disadvantages of 43 interpolation algorithms
The advantage of the nearest neighbor interpolation method is that the computational amount is very small and the algorithm is simple, so the operation speed is faster. However, it only uses the gray value of the pixel nearest to the sample point to be measured as the gray value of the sample point, and does not consider the influence of other neighboring pixels, so the gray value has obvious discontinuity after resampling, and the image quality loss is large, which will produce obvious mosaic and sawtooth phenomenon.
Bilinear interpolation is better than the nearest neighbor interpolation, but the calculation is slightly larger, the algorithm is more complicated, the program running time is slightly longer, but the image quality is high after scaling, basically overcome the nearest neighbor interpolation gray value discontinuity characteristics, because it considers the sampling point around the four direct adjacent points to the correlation effect of the sample point. However, this method only considers the influence of the gray value of four direct neighbors around the sample point, but does not take into account the effect of the change rate of gray value among the neighboring points, so it has the properties of the low-pass filter, which causes the high-frequency component of the image to be lost and the edge of the image becomes more fuzzy in some degree. Compared with the input image, the output image scaled by this method still has the problem that the image quality is damaged and the calculation precision is not high due to the poor interpolation function design consideration.
Cubic convolution is the most computationally significant, and the algorithm is the most complex. In geometric operations, the smoothing effect of bilinear interpolation may degrade the details of the image, which is more noticeable when the amplification process is performed. In other applications, the slope discontinuity of bilinear interpolation produces unwanted results. Cubic convolution interpolation not only takes into account the influence of the gray values of the surrounding four direct neighboring pixels, but also the change rate of their gray values. Therefore, overcoming the shortcomings of the first two methods, can produce more smooth edge than bilinear interpolation, the calculation accuracy is very high, the image quality loss after processing the least, the effect is the best.
In short, in the image scaling processing, should be based on the actual situation of the three algorithms to choose, both consider the feasibility of the time, but also the image quality after the transformation to consider, so as to achieve a more satisfactory result.

Reference documents
[1] Zhang Honglin. Proficient in Visual C + + Digital image processing typical algorithm and implementation [M]. Beijing: People's post and Telecommunications press, 2008.
[2] She Fengying, Zhao Dampe. Visual C + + Digital image processing [M]. Beijing: Tsinghua University Press, 2008.
[3] He bin, Ma Tian, Wang Yunjian and so on. Visual C + + Digital image processing [M]. Beijing: People's post and telecommunications, 2001

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.