Reference:
Https://www.cnblogs.com/han1ning1/p/6924404.html
https://blog.csdn.net/ccblogger/article/details/72875497
An interpolation algorithm based on image edge. Han Ping 1. The concept of sampling and up-sampling under the image
The imresize function in MATLAB can be used in both the image sampling and the bottom sampling, which is an indispensable operation step in the algorithm used in image pyramid. The following is a brief introduction to the concept of 2. 1.1 Image down sampling
Under-Image sampling (subsampled) can be easily understood as a reduced image, also known as a reduced-sampling (downsampled). Its purpose is two: 1) make the image conform to the size of the display area, 2) generate thumbnails of the corresponding image. 1.2 sampling on the image
Image sampling (upsampling) is to enlarge the image, or it can be called image interpolation (interpolating), its main purpose is to enlarge the original picture, so that the image can be displayed on the higher resolution of the display device. 2. Principle 2.1 Down Sampling principle
To clear the sample, let's give an example. Let's say we have an image img with a size of m*n, and we want to sample the image in S-times, even if the image is smaller than S-times, where the length and width are reduced by S times. The resulting bottom-sampled image (the resulting image) is the size of (M/s) x (N/S). There are 2 ways to convert an image to (M/s) x (N/S) size. As follows:
img = imread (' lena.tif ');
[height,width,~] =size (IMG);
% is sampled using 2 methods
sub_1 = IMG (1:2:end,1:2:end)
sub_2 = Imresize (Img,[height/2,width/2], ' bilinear ');
2.2 On-sample principle
The image sampling is almost all using interpolation method, that is, on the basis of the original image pixels, the appropriate interpolation algorithm is used to insert the new element between pixels.
Specifically, because the image is sampled to enlarge the image, then the process will inevitably produce some pixels, and these pixels are originally non-existent. This raises the question of how the pixel values of these new pixel points should be determined. Interpolation algorithms exist to calculate the pixel values of these new pixel points.
In the review of image interpolation technology, the interpolation algorithm is divided into traditional interpolation, edge-based interpolation and region-based interpolation Class 3.
The next step is to briefly describe these 3 types of algorithms. 2.2.1 Traditional interpolation algorithm
The most classical interpolation method has the nearest neighbor interpolation, bilinear interpolation, double three interpolation, and in order to overcome the smoothing effect of traditional interpolation, an edge-based image interpolation algorithm and an object-based image interpolation algorithm are presented. Nearest neighbor interpolation
The nearest neighbor interpolation is the gray value of the nearest neighbor in the four adjacent pixel points around the sampling point as a method of the gray value of the point. The nearest neighbor interpolation algorithm is the fastest, but it produces obvious aliasing and mosaic phenomena. bilinear interpolation
Bilinear interpolation uses the gray values of the surrounding four neighbors to do a linear interpolation in two directions to the gray value of the sample point. This method eliminates the sawtooth phenomenon to a large extent, but becomes more fuzzy three linear interpolation on the Edge
The double three interpolation not only considers the gray value of four neighboring points, but also considers the influence of the change rate of gray value among the neighboring points. is an improved algorithm for bilinear interpolation. Compared with the first two classical interpolation methods, it can achieve better interpolation effect. However, it still has low-pass filtering, which loses the high-frequency portion of the interpolated image, thus blurring the edge of the image. 2.2.2 Edge-based image interpolation algorithm
The traditional interpolation method is simple and fast, but because of their low-pass filtering, the image edge contour is blurred. In view of the advantages and disadvantages of traditional methods, different scholars put forward many interpolation methods based on image edge. The basic view of this interpolation method is: in the non-marginal region, the traditional image interpolation method has good effect, fast processing speed and small computational amount, so the traditional interpolation method is used in the non-edge region, and in the edge region of the image, a special interpolation method is used to enhance the edge and effectively preserve the image details. 2.2.1 Region-based image interpolation algorithm
First, the original low-resolution image is segmented into different regions, then the interpolation points are mapped to the low-resolution image, the region is judged, and the interpolation points are calculated according to the interpolation points ' neighborhood pixels.