Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more
Fork of mbed-dev by
Bilinear Interpolation
[Interpolation Functions]
  Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. More...
Functions | |
| CMSIS_INLINE __STATIC_INLINE  float32_t  | arm_bilinear_interp_f32 (const arm_bilinear_interp_instance_f32 *S, float32_t X, float32_t Y) | 
| Floating-point bilinear interpolation.   | |
| CMSIS_INLINE __STATIC_INLINE q31_t | arm_bilinear_interp_q31 (arm_bilinear_interp_instance_q31 *S, q31_t X, q31_t Y) | 
| Q31 bilinear interpolation.   | |
| CMSIS_INLINE __STATIC_INLINE q15_t | arm_bilinear_interp_q15 (arm_bilinear_interp_instance_q15 *S, q31_t X, q31_t Y) | 
| Q15 bilinear interpolation.   | |
| CMSIS_INLINE __STATIC_INLINE q7_t | arm_bilinear_interp_q7 (arm_bilinear_interp_instance_q7 *S, q31_t X, q31_t Y) | 
| Q7 bilinear interpolation.   | |
Detailed Description
Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid.
The underlying function f(x, y) is sampled on a regular grid and the interpolation process determines values between the grid points. Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. Bilinear interpolation is often used in image processing to rescale images. The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types.
Algorithm
- The instance structure used by the bilinear interpolation functions describes a two dimensional data table. For floating-point, the instance structure is defined as: 
typedef struct { uint16_t numRows; uint16_t numCols; float32_t *pData; } arm_bilinear_interp_instance_f32; 
- where 
numRowsspecifies the number of rows in the table;numColsspecifies the number of columns in the table; andpDatapoints to an array of sizenumRows*numColsvalues. The data tablepTableis organized in row order and the supplied data values fall on integer indexes. That is, table element (x,y) is located atpTable[x + y*numCols]where x and y are integers. 
- Let 
(x, y)specify the desired interpolation point. Then define:XF = floor(x) YF = floor(y) 
- The interpolated output point is computed as: 
f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF)) + f(XF+1, YF) * (x-XF)*(1-(y-YF)) + f(XF, YF+1) * (1-(x-XF))*(y-YF) + f(XF+1, YF+1) * (x-XF)*(y-YF)Note that the coordinates (x, y) contain integer and fractional components. The integer components specify which portion of the table to use while the fractional components control the interpolation processor. 
- if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output.
 
Function Documentation
| CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32 | ( | const arm_bilinear_interp_instance_f32 * | S, | 
| float32_t | X, | ||
| float32_t | Y | ||
| ) | 
Floating-point bilinear interpolation.
- Parameters:
 - 
  
[in,out] S points to an instance of the interpolation structure. [in] X interpolation coordinate. [in] Y interpolation coordinate.  
- Returns:
 - out interpolated value.
 
Definition at line 6833 of file arm_math.h.
| CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15 | ( | arm_bilinear_interp_instance_q15 * | S, | 
| q31_t | X, | ||
| q31_t | Y | ||
| ) | 
Q15 bilinear interpolation.
- Parameters:
 - 
  
[in,out] S points to an instance of the interpolation structure. [in] X interpolation coordinate in 12.20 format. [in] Y interpolation coordinate in 12.20 format.  
- Returns:
 - out interpolated value.
 
Definition at line 6973 of file arm_math.h.
| CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31 | ( | arm_bilinear_interp_instance_q31 * | S, | 
| q31_t | X, | ||
| q31_t | Y | ||
| ) | 
Q31 bilinear interpolation.
- Parameters:
 - 
  
[in,out] S points to an instance of the interpolation structure. [in] X interpolation coordinate in 12.20 format. [in] Y interpolation coordinate in 12.20 format.  
- Returns:
 - out interpolated value.
 
Definition at line 6899 of file arm_math.h.
| CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7 | ( | arm_bilinear_interp_instance_q7 * | S, | 
| q31_t | X, | ||
| q31_t | Y | ||
| ) | 
Q7 bilinear interpolation.
- Parameters:
 - 
  
[in,out] S points to an instance of the interpolation structure. [in] X interpolation coordinate in 12.20 format. [in] Y interpolation coordinate in 12.20 format.  
- Returns:
 - out interpolated value.
 
Definition at line 7051 of file arm_math.h.
Generated on Thu Jul 14 2022 04:46:52 by
 1.7.2 
    