I am using a bicubic interpolation algorithm in order to upscale an height map, and I am noticing some artifacts around the pixels boundaries. However, these artifacts don't seem to appear when I use a simple cubic interpolation (spline).
Could it be because the bicubic interpolation doesn't guarantee the second derivative to be continuous, unlike the cubic spline ? If so, is there known algorithms that have a continuous second derivative ? Otherwise, is there a way to deal with these artifacts ?
Linear interpolation (shows the pixels boundaries):
Bicubic interpolation (artifacts visible at pixels boundaries):
Cubic interpolation (no noticeable artifacts):
I tried several bicubic formulas, which gave me the same results. Here are some examples:
Edit: I made some searches and found that B-Spline have a continuous C2 (also suggested by Bharat). I implemented it and it looks fine, even if it's an approximation and not an interpolation (it doesn't go through the samples).
B-spline (approximation):
Bicubic interpolation is a 2D system of using cubic splines or other polynomial technique for sharpening and enlarging digital images. It is commonly used in computer image editing software, by retouchers and editors when upscaling or resampling an image.
In image processing, bicubic interpolation is often chosen over bilinear or nearest-neighbor interpolation in image resampling, when speed is not an issue. In contrast to bilinear interpolation, which only takes 4 pixels (2×2) into account, bicubic interpolation considers 16 pixels (4×4).
Bilinear interpolation Linear (or bilinear, in two dimensions) interpolation is typically good for changing the size of an image, but causes some undesirable softening of details and can still be somewhat jagged.
Image interpolation is generally achieved through one of three methods: nearest neighbor, bilinear interpolation, or bicubic interpolation.
second derivative of cubic B-Spline is continuous while that of bicubic interpolation is not.
http://en.wikipedia.org/wiki/Spline_interpolation http://en.wikipedia.org/wiki/Cubic_interpolation
https://math.stackexchange.com/questions/485935/piecewise-interpolation-with-derivatives-that-is-also-twice-differentiable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With