Вы находитесь на странице: 1из 7

Different types of interpolation

The Inverse Distance to a Power method


The inverse distance to a power method is a weighted average
interpolator, which can be either exact or smoothing. With this
method, data are weighted during interpolation, so that the
influence of one point, relative to another, declines with
distance from the grid node. Weighting is assigned to data
through the use of a weighting power which controls how the
weighting factors drop off as distance from the node increases.
Normally, it acts as an exact interpolator.
The Kriging Method
It is a geostatical gridding method. This method produces
visually appealing maps from irregularly spaced data. It is very
flexible gridding method. It can be either an exact or a
smoothing interpolator, depending on the user-specified
parameters.
The Minimum Curvature Method
The interpolated surface generated by this method is analogous
to a thin, linearly elastic plate passing through each of the data
values, with a minimum amount of bending. It generates the
smoothest possible surface while attempting to honour your
data as closely as possible. However it is not an exact
interpolator (data is not honoured always exactly).
The Modified Shepards Method
It uses inverse distance weighted least squares method. It is
similar to the inverse distance to a power interpolator but the
use of local least squares eliminates or reduces the bulls-eye
appearance of the generated contours. It also can be an exact
or a smoothing interpolator.
The Natural Neighbour
This algorithm is a method of a spatial interpolation. This had
advantages over simple methods of interpolation, such as
nearest-neighbour interpolation, in that it provides a smoother
approximation to the underlying true function.

The Polynomial Regression Method


It is used to define large-scale trends and pattern in data. It is
no really an interpolation because it does not attempt to predict
unknown Z values.
The Radial Basis Function Interpolation Method
It is a diverse group of data interpolation methods. In terms of
ability to fit data and produce smooth surface. The multiquadratic method is considered by many to be the best. All of
the radial basis function interpolation methods are exact
interpolator, so data is honoured. Smoothing factor can be
introduced to all of the methods in attempt to produce a
smoother surface.
The Triangulation with Linear Interpolation Method
It uses the optimal Delaunay triangulation. This algorithm
creates triangles by drawing lines between data points. The
original points are connected in such way that no triangle edges
are intersected by other triangles. The result is a patchwork of
triangular faces over the extent of the grid. This method is an
exact interpolator. Because the original data are used to define
the triangles, the data are honoured very closely. It works best
when the data is distributed evenly over the grid area.
The Moving Average Method
This method assigns values to grid nodes by averaging the data
within grid nodes search ellipse. To use this method, a search
ellipse must be defined and the minimum number of data to
use specified. For each grid node, the neighbouring data are
identified by centring the search ellipse on the node. The output
grid node value is set equal to the arithmetic average of the
identified neighbouring data.
The Data Metrics Methods
These methods create grids of information about the data on a
node-by-node basis. In general these methods are not weighted
average interpolators of the Z-values. Can obtain information
such as: number of data points used to interpolate each grid
node, the standard deviation, variance, coefficient of variation

and median absolute deviation of the data at each grid node


and also the distance to the nearest data point.
The Local Polynomial Method
This method assigns values to grid nodes by using weighted
least squares fit, with data within the grid nodes search ellipse.

Differences using built-in functions of MATLAB


I resized the pictures to 256x256 and edited them to greyscale.
Using nearest neighbour interpolation the pixels of the picture
stood out the most, because it just takes one pixel and enlarges
it 200% (1 pixel comes 2x2 are of 4 pixels) with the same
colour. As said in lecture, this method produces undesired
blocking (aliasing).
Bilinear interpolation had much smoother looking images the
nearest neighbour one because it takes the 2x2 neighbourhood
of the unknown pixel and then takes the weighted average of
these to get the final interpolated value.
Bicubic had the smoothest looking images because it takes 4x4
neighbourhood (16 pixels) to calculate the unknown pixels
value. Picture was sharper.
Spline interpolation is higher order interpolation. It is useful
when image requires multiple rotations or distortions in
separate steps. Single step enlargements or rotations, then
these higher-order algorithms provide diminishing visual
improvement but the processing time increases. It came out in
pictures also. There was not that big difference between bicubic
and spline interpolations.
Input images were. The left side image is actually 2336x2724
and right size 960x960

After editing.

Output images.

I had some problems with the Lanczos algorithm


implementation. I got the Lancoz algorithm code but when I
started inserting the picture as input, I had to edit the picture
file to double instead of uint8 and then the original picture
turned white and Lanczos turned black. Somehow I couldnt get
this problem fixed. So I used the built-in function of MATLAB to
describe the output images of Lanczos. The Lanczos
interpolation on obelix image seemed to be as good as bicubic
interpolation. If I zoomed in to get the best look at the pixels
then Lanczos and bicubic seemed to be both as good. But it can
be seen that it is still little bit blurry, some parts of the picture.
But on my own picture the Lanczos algorithm seemed to be
little bit better visually.
Function code for Lanczos algorithm:
function f = lanczos(x)

f = (sind(pi*x) .* sind(pi*x/2) + eps) ./ ((pi^2 * x.^2 / 2) + eps);


f = f .* (abs(x) < 2);
end

Code part:
I = imread('C:\Users\Jrgen\Desktop\Kool\Digitaalne
pildittlus\Images\kairi.jpg');
I = rgb2gray(I);
I = imresize(I, [256, 256]);
I = double(I);
nearest = imresize(I, 2, 'nearest');
bilinear = imresize(I, 2, 'bilinear');
bicubic = imresize(I, 2, 'bicubic');
% class_of_I = class(I);
% [x y] = meshgrid(1:sy,1:sx);
% [xi yi] = meshgrid(1:0.5:sy,1:0.5:sx);
% class_of_I
% size(x)
% size(y)
% size(double(I))
% size(xi)
% size(yi)
% img = cast(interp2(x,y,double(I),xi,yi,'spline'),class_of_I);
imshow(I);

Вам также может понравиться