8

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): Linear interpolation

Bicubic interpolation (artifacts visible at pixels boundaries): Bicubic interpolation

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

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): b-spline

deck
  • 343
  • 2
  • 11
  • What software are you using to generate those images? Looks really nice! – ajwood Feb 12 '14 at 20:51
  • I am working on my own OpenGL engine. – deck Feb 12 '14 at 20:59
  • 1
    There's a bunch of related bicubic filters of which B-Spline is one. See http://www.cs.utexas.edu/~fussell/courses/cs384g/lectures/mitchell/Mitchell.pdf for the original paper and http://entropymine.com/imageworsener/bicubic/ for the simplified version. You might try the one recommended by Mitchell and Netravali with B=1/3, C=1/3. – Mark Ransom Feb 12 '14 at 22:03
  • @MarkRansom Nice paper. I implemented the generic function proposed there and tried several parameters. They all shows more or less artifacts (except b-spline). Mitchell is a good one though. – deck Feb 13 '14 at 10:56

1 Answers1

5

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

Community
  • 1
  • 1
Bharat
  • 2,139
  • 2
  • 16
  • 35