Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resampling or interpolation?

it is not clear for me which are the differences between resampling and interpolation in the image processing. If I have a geotiff and I would like to improve its resolution, should I use a resampling method such as nearest neighbour, is it right? For instance I have found the gdalwarp function to do this.
What about interpolation methods, i.e. kriging? Is it better if I have data not uniformly distributed? And what if I would like to take into account also the digital elevation model to correct my image? Many thanks for the help and sorry for confusion.

Laura

like image 297
user2617702 Avatar asked Mar 24 '23 01:03

user2617702


1 Answers

There are some relationships between interpolation and resampling.

Resampling implies changing the sample rate of a set of samples. In the case of an image, these are the pixel values sampled at each pixel coordinate in the image. In the case of audio, these are the amplitude values sampled at each time point.

Resampling is used to either increase the sample rate (make the image larger) or decrease it (make the image smaller). Interpolation is the process of calculating values between sample points.

So, if you resample an image you can use interpolation to do it. There are a lot of interpolation methods - nearest neighbor, linear, cubic, lanczos etc. Each method has different quality/performance.

If you reduce the sampling rate, you can get aliasing. This is where you are trying to represent frequencies that can't be represented by the new (lower) sampling rate. Often resampling will also incorporate filtering (which is NOT interpolation) to avoid aliasing.

If you double the size of an image, you'll end up with gaps in it every other pixel. Using interpolation you can fill these gaps. If you increase or decrease the size of an image by some fractional amount, you'd look up interpolated values in the source image which are at fractional pixel positions when doing the resize.

Kriging is typically used to interpolate terrain rather than images.

Increasing the resolution of an image will not improve it - you are not adding any new information to it.

like image 61
Pete Avatar answered May 03 '23 18:05

Pete