10
\$\begingroup\$

I am using a bicubic interpolation algorithm in order to upscale a 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): enter image description here

Bicubic interpolation (artifacts visible at pixels boundaries): enter image description here

Cubic interpolation (no noticeable artifacts): enter image description here

I tried several bicubic formulas, which gave me the same results. Here are some examples:

\$\endgroup\$
2
  • \$\begingroup\$ for me the bicubic version is the best, it keeps high frequencies and looks pretty good. you say there are artefacts but they are minor and not worth the horrible loss b splines are giving you. my opinion though. \$\endgroup\$
    – v.oddou
    Feb 13, 2014 at 1:21
  • \$\begingroup\$ @v.oddou I think that the high frequency feeling you describe is partly due to the artifacts themselves. It doesn't show well in this image, but the terrain is really squarish from some angles, and depending on the sun position. It's even more apparent when the normals or the slopes are displayed. That being said, it's true that the b-splines smooth out the terrain a lot (no more sharp peaks). I am still searching for a better alternative. \$\endgroup\$
    – deck
    Feb 13, 2014 at 9:16

2 Answers 2

5
\$\begingroup\$

In Ken Perlin's paper on improved noise, he mentions a very similar problem. The cubic used in the original noise paper creates discontinuities at the integer boundaries due to the properties of its derivatives. In his revised paper, he proposes an interplant of 6t^5 - 15t^4 + 10t^3 to address those issues.

\$\endgroup\$
1
  • \$\begingroup\$ That sounds interesting, even if I am not sure of how to use it in my code. I will explore this. \$\endgroup\$
    – deck
    Feb 12, 2014 at 20:41
4
\$\begingroup\$

I made some searches and found that B-Spline have a continuous C2. 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): enter image description here

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .