## Developer Reference

• 2021
• 06/28/2021
• Public Content
Contents

# Cubic Interpolation

The cubic interpolation algorithm (see Figure
Cubic Interpolation
) uses source image intensities at sixteen pixels in the neighborhood of the point (
x
S
,
y
S
) in the source image:
x
S0
= int(
x
S
) - 1;
x
S1
=
x
S0
+ 1;
x
S2
=
x
S0
+ 2;
x
S3
=
x
S0
+ 3;
y
S0
= int(
y
S
) - 1;
y
S1
=
y
S0
+ 1;
y
S2
=
y
S0
+ 2;
y
S3
=
y
S0
+ 3.
First, for each
y
Sk
the algorithm determines four cubic polynomials
F
0
(
x
),
F
1
(
x
),
F
2
(
x
), and
F
3
(
x
):
F
k
(
x
) =
a
k
x
3 +
b
k
x
2 +
c
k
x
+
d
k
, 0 ≤
k
≤ 3
such that
F
k
(
x
S0
) =
S
(
x
S0
,
y
Sk
);
F
k
(
x
S1
) =
S
(
x
S1
,
y
Sk
),
F
k
(
x
S2
) =
S
(
x
S2
,
y
Sk
);
F
k
(
x
S3
) =
S
(
x
S3
,
y
Sk
).
In Figure
Cubic Interpolation
, these polynomials are shown by solid curves.
Then, the algorithm determines a cubic polynomial
F
y
(
y
) such that
F
y
(
y
S0
) =
F
0
(
x
S
),
F
y
(
y
S1
) =
F
1
(
x
S
),
F
y
(
y
S2
) =
F
2
(
x
S
),
F
y
(
y
S3
) =
F
3
(
x
S
).
The polynomial
F
y
(
y
) is represented by the dashed curve in Figure
Cubic Interpolation
.
Finally, the sought intensity
D
(
x
D
,
y
D
) is set to the value
F
y
(
y
S
).
To use the cubic interpolation, set the
interpolation
parameter to
IPPI_INTER_CUBIC
.