#4218 closed enhancement (fixed)
[PATCH] Split bicubicInterpolation to 1D and 2D so both are available
Reported by: | FeXoR | Owned by: | FeXoR |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 22 |
Component: | Maps | Keywords: | patch |
Cc: | Patch: |
Description
This is just an improvement of BicubicInterpolation.js
.
It splits the 1D part and uses it in the 2D part.
That way it is much more readable as well as the 1D function is now also available.
Also the swapped x/y coordinates where fixed.
Thanks Vladislav for the changes!
Attachments (5)
Change History (13)
by , 8 years ago
Attachment: | interpolationSplit2016_9_16.diff added |
---|
by , 8 years ago
Attachment: | interpolationSplit2016_9_16b.diff added |
---|
Removed some unneeded vars, removed licence links, changed eol to native
comment:1 by , 8 years ago
Milestone: | Backlog → Alpha 21 |
---|
Tested the first version and couldnt notice a difference to the previous algorithm. Didn't solve the equations, so I don't know if there are hidden bugs. Like Vladislav said, the interpolation file could be renamed to mention the most common denominator of the functions present (perhaps interpolation?).
comment:2 by , 8 years ago
We are using the algorithm e.g. described at https://en.wikipedia.org/wiki/Bicubic_interpolation (see "Bicubic convolution algorithm")
An alternative would be using simple bicubic interpolation 2 times. That would be more precise throughout fx, fy in [-1; 2] but also slower. It's also more prone for oscillations (Runge's phenomenon) but that should'nt be a problem at 3rd degree polynimials.
Third degree polynomial: f(x) = ax^3^ + bx^2^ + cx + d f(-1) = p0 <=> -a + b - c + d = p0 f(0) = p1 <=> d = p1 f(1) = p2 <=> a + b + c + d = p2 f(2) = p3 <=> 8a +4b +2c + d = p3 <=> (Matrix) -1 1 -1 1 = p0 | -II 0 0 0 1 = p1 1 1 1 1 = p2 | -II 8 4 2 1 = p3 | -II <=> -1 1 -1 0 = p0 -p1 | +III 0 0 0 1 = p1 1 1 1 0 = p2 -p1 8 4 2 0 = p3 -p1 | -2III <=> 0 2 0 0 = p0 -2p1 + p2 0 0 0 1 = p1 1 1 1 0 = - p1 + p2 | *2 -I 6 2 0 0 = p1 -2p2 +p3 | -I <=> 0 2 0 0 = p0 -2p1 + p2 0 0 0 1 = p1 2 0 2 0 = -p0 + p2 | *3 -IV 6 0 0 0 = -p0 +3p1 -3p2 +p3 <=> 0 2 0 0 = p0 -2p1 + p2 0 0 0 1 = p1 0 0 6 0 = -2p0 -3p1 +6p2 -p3 6 0 0 0 = - p0 +3p1 -3p2 +p3
by , 8 years ago
Attachment: | interpolationSplit2016_9_17.diff added |
---|
Added non-spline implementation , renamed file to interpolation.js
by , 8 years ago
Attachment: | interpolationSplit2016_9_24.diff added |
---|
Patch as I think should be committed (removed "convolution" argument)
comment:4 by , 8 years ago
L2
- Perhaps replace "Two dimensional interpolation within four equidistant points using polynomials of 3rd degree." by "One dimensional interpolation within four uniformly spaced points using polynomials of 3rd degree.
- Perhaps add somewhere it's a Catmull-Rom spline.
L31
- To be remove (useless now)
L18-L19
- Use the same case for x and y
Else you can commit.
by , 8 years ago
Attachment: | interpolationSplit2016_9_26.diff added |
---|
Some style and comment changes, removed a wrong colon
comment:7 by , 7 years ago
Keywords: | review removed |
---|
Splits 1D and 2D interpolation, fixes x/y swaping