Developer Reference

  • 2020
  • 10/21/2020
  • Public Content
Contents

Linear Interpolation

The linear interpolation is slower but more accurate than the nearest neighbor interpolation. On the other hand, it is faster but less accurate than cubic interpolation. The linear interpolation algorithm uses source image intensities at the four pixels (
x
S0
,
y
S0
), (
x
S1
,
y
S0
), (
x
S0
,
y
S1
), (
x
S1
,
y
S1
) that are closest to (
x
S
,
y
S
) in the source image:
x
S0
= int(
x
S
),
x
S1
=
x
S0
+ 1,
y
S0
= int(
y
S
),
y
S1
=
y
S0
+ 1.
First, the intensity values are interpolated along the x-axis to produce two intermediate results
I
0
and
I
1
(see Figure 
Linear Interpolation
):
I
0
=
S
(
x
S
,
y
S0
) =
S
(
x
S0
,
y
S0
)*(
x
S1
-
x
S
) +
S
(
x
S1
,
y
S0
)*(
x
S
-
x
S0
)
I
1
=
S
(
x
S
,
y
S1
) =
S
(
x
S0
,
y
S1
)*(
x
S1
-
x
S
) +
S
(
x
S1
,
y
S1
)*(
x
S
-
x
S0
).
Then, the sought-for intensity
D
(
x
D
,
y
D
) is computed by interpolating the intermediate values
I
0
and
I
1
along the
y
-axis:
D
(
x
D
,
y
D
) =
I
0
*(
y
S1
-
y
S
) +
I
1
*(
y
S
-
y
S0
).
To use the linear interpolation, set the
interpolation
parameter to
IPPI_INTER_LINEAR
or use the functions with the
Linear
suffix (pass
interpolation
=
ippLinear
to
GetSize
functions). For images with 8-bit unsigned color channels, the
ippiWarpAffine
and
ippiResizeLinear
functions compute the coordinates (
x
S
,
y
S
) with the accuracy 2
-16
= 1/65536. For images with 16-bit unsigned color channels, these functions compute the coordinates with floating-point precision.
Linear Interpolation

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserverd for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804