The Resample operation resamples a raster map from the map's current georeference. to another target georeference. The coordinate of each output pixel is used to calculate a new value from close-by pixel values in the input map. Three resampling methods are available: nearest neighbour, bilinear interpolation, and bicubic interpolation.
The resampling process consists of several steps:
Nearest neighbour resampling is the fastest method, but results in discontinuities because some input values may be used more than once as output value, while other input values may not be used at all. Bilinear resampling takes much less time than a bicubic resampling. A bilinear interpolation results in discontinuity of the first derivative. A bicubic interpolation remains continuous up to the second derivative.
Nearest neighbour resampling:
With nearest neighbour resampling, first the coordinate of each pixel in the output map is determined. Then, for each output pixel, the pixel value of input pixel closest to this coordinate is used as output value.
Figure 1 below shows the position of a 'new' pixel in the output map, and the position and values of 4 surrounding pixels in the input map.
Fig. 1: Nearest Neighbour resampling. The coordinates of input pixels are represented by black and grey dots. The coordinate of an output pixel is represented by a cross. The red arrow shows how the value of the nearest input pixel is assigned to the output pixel.
The value for the 'new' pixel in the output map is the value in the input map closest to the new coordinate (19).
Bilinear resampling:
With bilinear resampling, first the coordinate of each pixel in the output map is determined. Then the values of 4 surrounding pixels of the input map are used to calculate an interpolated value for each pixel in the output map.
Figure 2 below shows the position of a 'new' pixel in the output map, and the position and values of 4 surrounding pixels in the input map.
Fig. 2: Bilinear interpolation in Bilinear Resampling. The coordinates of 4 neighbouring input pixels are represented by black dots. The coordinate of an output pixel is represented by a black cross. The straight black lines represent the interpolations; intermediate answers are represented by red dots.
The value of the 'new' pixel in the output map is calculated by:
A straight line is drawn through each set of 2 points, and from this the value of the third point is known. A bilinear interpolation should not be used when you intend to calculate a derivative of the output map.
Bicubic resampling:
With bicubic resampling, first the coordinate of each pixel in the output map is determined; then the values of 16 surrounding pixels of the input map are used to calculate an interpolated value for each pixel in the output map.
Figure 3 below shows the position of a 'new' pixel in the output map, and the position and values of 16 surrounding pixels in the input map.
Fig. 3: Bicubic interpolation in Bicubic resampling. The coordinates of 16 neighbouring input pixels are represented by black dots. The coordinate of an output pixel is represented by a black cross. The straight black lines represent the interpolations; intermediate answers are represented by red dots.
The value of the 'new' pixel in the output map is calculated by:
A third order polynomial is fitted through each set of 4 known points and from this the value of the fifth point is known. A bicubic interpolation gives a better estimate of the output value than a bilinear interpolation.
See also: