Questions tagged [interpolation]

Anything related to function interpolation, i.e. the mathematical techniques for estimating the (unknown) value of a function in a point on the basis of a set of known values in other (usually nearby) points. For interpolation of strings, see the [string-interpolation] tag.

Anything related to function interpolation, i.e. the mathematical techniques for estimating the (unknown) value of a function in a point on the basis of a set of known values in other (usually nearby) points.

See Wikipedia on interpolation.

In scientific software for statistical computing and graphics, function approx implements linear interpolation and function spline implements cubic spline interpolation.

For interpolation of strings, see .

5155 questions
24
votes
3 answers

Fast linear interpolation in Numpy / Scipy "along a path"

Let's say that I have data from weather stations at 3 (known) altitudes on a mountain. Specifically, each station records a temperature measurement at its location every minute. I have two kinds of interpolation I'd like to perform. And I'd like…
8one6
  • 13,078
  • 12
  • 62
  • 84
23
votes
6 answers

3d geometry: how to interpolate a matrix

i store the position of an object in 3d space in a 4by4 transformation matrix. now in order to move the object from the position stored in matrix A to the position stored in matrix B, i would like to interpolate them. so do i just do this by…
clamp
  • 33,000
  • 75
  • 203
  • 299
23
votes
4 answers

Image rotation by Matlab without using imrotate

I am trying to rotate an image with Matlab without using imrotate function. I actually made it by using transformation matrix.But it is not good enough.The problem is, the rotated image is "sliding".Let me tell you with pictures. This is my image…
Zapdos
  • 617
  • 1
  • 6
  • 23
23
votes
5 answers

How to get the image pixel at real locations in opencv?

I want to retrieve the rgb of a pixel in the image. But the location is not integer location but real values (x,y). I want a bilinear interpolated value. How could I do it opencv? Thanks a lot
Shan
  • 18,563
  • 39
  • 97
  • 132
22
votes
3 answers

Interpolate NA values

I have two set of samples that are time independent. I would like to merge them and calculate the missing values for the times where I do not have values of both. Simplified example: A <- cbind(time=c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100), …
hlovdal
  • 26,565
  • 10
  • 94
  • 165
22
votes
3 answers

Fast interpolation of regularly sampled 3D data with different intervals in x,y, and z

I have some volumetric imaging data consisting of values sampled on a regular grid in x,y,z, but with a non-cubic voxel shape (the space between adjacent points in z is greater than in x,y). I would eventually like to be able to interpolate the…
ali_m
  • 71,714
  • 23
  • 223
  • 298
22
votes
6 answers

How do you do bicubic (or other non-linear) interpolation of re-sampled audio data?

I'm writing some code that plays back WAV files at different speeds, so that the wave is either slower and lower-pitched, or faster and higher-pitched. I'm currently using simple linear interpolation, like so: int newlength =…
MusiGenesis
  • 74,184
  • 40
  • 190
  • 334
21
votes
6 answers

Interpolation algorithms when downscaling

Im trying to understand downscaling. I can see how interpolation algorithms such as bicubic and nearest neighbour can be used when when upscaling, to "fill in the blanks" between the old, known points (pixels, in case of images). But downscaling? I…
Mizipzor
  • 51,151
  • 22
  • 97
  • 138
21
votes
2 answers

Linear interpolation in R

I have a dataset of real data, for example looking like this: # Dataset 1 with known data known <- data.frame( x = c(0:6), y = c(0, 10, 20, 23, 41, 39, 61) ) plot (known$x, known$y, type="o") Now I want to get an aswer to the…
R_User
  • 10,682
  • 25
  • 79
  • 120
21
votes
3 answers

Image interpolation mode in Chrome/Safari?

I need to have an image render with nearest-neighbor resizing and not the bicubic way that is currently used. I currently use the following: ms-interpolation-mode: nearest-neighbor; image-rendering: -moz-crisp-edges; This works in IE and Firefox,…
Deniz Zoeteman
  • 9,691
  • 26
  • 70
  • 97
21
votes
1 answer

What to do if I want 3D spline/smooth interpolation of random unstructured data?

I was inspired by this answer by @James to see how griddata and map_coordinates might be used. In the examples below I'm showing 2D data, but my interest is in 3D. I noticed that griddata only provides splines for 1D and 2D, and is limited to linear…
uhoh
  • 3,713
  • 6
  • 42
  • 95
21
votes
1 answer

Python pandas time series interpolation and regularization

I am using Python Pandas for the first time. I have 5-min lag traffic data in csv format: ... 2015-01-04 08:29:05,271238 2015-01-04 08:34:05,329285 2015-01-04 08:39:05,-1 2015-01-04 08:44:05,260260 2015-01-04 08:49:05,263711 ... There are several…
riccamini
  • 1,161
  • 1
  • 13
  • 29
21
votes
3 answers

Combine two Pandas dataframes, resample on one time column, interpolate

This is my first question on stackoverflow. Go easy on me! I have two data sets acquired simultaneously by different acquisition systems with different sampling rates. One is very regular, and the other is not. I would like to create a single…
ollerend
  • 500
  • 5
  • 17
21
votes
2 answers

Fast interpolation of grid data

I have a large 3d np.ndarray of data that represents a physical variable sampled over a volume in a regular grid fashion (as in the value in array[0,0,0] represents the value at physical coords (0,0,0)). I would like to go to a finer grid spacing…
Rowan
  • 277
  • 1
  • 2
  • 6
20
votes
3 answers

Best way to interpolate a numpy.ndarray along an axis

I have 4-dimensional data, say for the temperature, in an numpy.ndarray. The shape of the array is (ntime, nheight_in, nlat, nlon). I have corresponding 1D arrays for each of the dimensions that tell me which time, height, latitude, and longitude a…
chw21
  • 7,970
  • 1
  • 16
  • 31