# Image transformation

- FASTCV\_API int fcvScaleDownBy2u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst)

    - Down-scale the image to half width and height by averaging 2x2 pixels into one.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvScaleDownBy2u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga7427fac2f9602a04db6faa188a099c4e). In the 2.0.0 release, fcvScaleDownBy2u8\_v2 will be renamed to fcvScaleDownBy2u8 and the signature of fcvScaleDownBy2u8 as it appears now, will be removed.

A box filter downsampling the next pixel, the pixel below, and the next pixel to the pixel below into one pixel.

| px00 px01 px02 px03 |

| px10 px11 px12 px13 |

to:

 | (px00+px01+px10+px11)/4 (px02+px03+px12+px13)/4 |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height. **NOTE:must** be a multiple of 2
- **dst** – Output 8-bit image. Size of buffer is srcWidth\*srcHeight/4 bytes. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API int fcvScaleDownBy2u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstStride)

    - Down-scale the image to half width and height by averaging 2x2 pixels into one.

**ATTENTION:** This function is a duplication of [fcvScaleDownBy2u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga724a25bd380da83469a3c6e02df2cf76) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvScaleDownBy2u8*, *fcvScaleDownBy2u8\_v2* will be removed, and the current signature for *fcvScaleDownBy2u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvScaleDownBy2u8* when transitioning to 2.0.0.

A box filter downsampling the next pixel, the pixel below, and the next pixel to the pixel below into one pixel.

| px00 px01 px02 px03 |

| px10 px11 px12 px13 |

to:

 | (px00+px01+px10+px11)/4 (px02+px03+px12+px13)/4 |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height. **NOTE:must** be a multiple of 2
- **srcStride** – Image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*srcHeight/2 bytes. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth/2. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth/2 if not 0.

- FASTCV\_API void fcvScaleDownBy2Gaussian5x5u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst)

    - Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvScaleDownBy2Gaussian5x5u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gaad5cc923bca49da4d5daf18e6b02042e). In the 2.0.0 release, fcvScaleDownBy2Gaussian5x5u8\_v2 will be renamed to fcvScaleDownBy2Gaussian5x5u8 and the signature of fcvScaleDownBy2Gaussian5x5u8 as it appears now, will be removed.

Downsamples the image using a 5x5 Gaussian filter kernel.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height. **NOTE:must** be a multiple of 2
- **dst** – Output 8-bit downscale image of size (width / 2) x (height / 2). **NOTE:** border values have been taken cared w.r.t. the pixel coordinate.

- FASTCV\_API void fcvScaleDownBy2Gaussian5x5u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstStride)

    - Downscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.

**ATTENTION:** This function is a duplication of [fcvScaleDownBy2Gaussian5x5u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga842b8fe16e9792c578be058223054263) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvScaleDownBy2Gaussian5x5u8*, *fcvScaleDownBy2Gaussian5x5u8\_v2* will be removed, and the current signature for *fcvScaleDownBy2Gaussian5x5u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvScaleDownBy2Gaussian5x5u8* when transitioning to 2.0.0.

Downsamples the image using a 5x5 Gaussian filter kernel.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit downscale image of size (width / 2) x (height / 2). **NOTE:** border values have been taken cared w.r.t. the pixel coordinate.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth/2. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth/2 if not 0.

- FASTCV\_API int fcvScaleDownBy4u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst)

    - Downscale the image to quarter width and height by averaging 4x4 pixels into one..

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvScaleDownBy4u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga67687a15475f0442d33712b962025cc3). In the 2.0.0 release, fcvScaleDownBy4u8\_v2 will be renamed to fcvScaleDownBy4u8 and the signature of fcvScaleDownBy4u8 as it appears now, will be removed.

A 4x4 downsampling box filter across adjacent pixels is applied.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height. **NOTE:must** be a multiple of 4
- **dst** – Output 8-bit image. Size of buffer is srcWidth\*srcHeight/16 bytes. **WARNING:** should be 128-bit aligned.

- FASTCV\_API int fcvScaleDownBy4u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstStride)

    - Downscale the image to quarter width and height by averaging 4x4 pixels into one..

**ATTENTION:** This function is a duplication of [fcvScaleDownBy4u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga67687a15475f0442d33712b962025cc3) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvScaleDownBy4u8\_v2*, *fcvScaleDownBy4u8\_v2* will be removed, and the current signature for *fcvScaleDownBy4u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvScaleDownBy4u8* when transitioning to 2.0.0.

A 4x4 downsampling box filter across adjacent pixels is applied.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height. **NOTE:must** be a multiple of 4
- **srcStride** – Image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*srcHeight/4 bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth/4. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth/4 if not 0.

- FASTCV\_API int fcvScaleDown3To2u8(const uint8\_t \*\_\_restrict src, unsigned srcWidth, unsigned srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstStride)

    - Downscale the image to 2/3 width and height by averaging 3x3 pixels into one..

A 3x3 downsampling box filter across adjacent pixels is applied.

- Parameters:

    - - **src** – Input 8-bit image. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** In case of non multiple of 3, it will crop to the closest multiple of 3
- **srcHeight** – Image height. **NOTE:** In case of non multiple of 3, it will crop to the closest multiple of 3
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, srcStride is set to srcWidth.
- **dst** – Output 8-bit image. **WARNING:** should be 128-bit aligned. Memory must be pre-allocated at least srcWidth \* srcHeight \* 2 / 3 dstWidth = srcWidth/3\*2 dstHeight = srcHeight/3\*2
- **dstStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, dstStride is set to dstWidth which is srcWidth \*2/3.

- Returns:

    - 0 if successful

- FASTCV\_API int fcvScaleDownNNu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride)

    - Downsample Horizontaly and/or Vertically by an *integer* scale.

Uses Nearest Neighbor method

- Parameters:

    - - **src** – Input 8-bit image. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Source Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Source Image height.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, srcStride is set to srcWidth.
- **dst** – Output 8-bit image. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Destination Image width.
- **dstHeight** – Destination Image height.
- **dstStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). If 0 is passed, dstStride is set to dstWidth which is srcWidth \*2/3.

- Returns:

    - 0 if successful

- FASTCV\_API void fcvScaleDownu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight)

    - Downsample Horizontaly and/or Vertically by an *integer* scale.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvScaleDownu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gaa31682a6554d7f7d47afa61cf5070867). In the 2.0.0 release, fcvScaleDownu8\_v2 will be renamed to fcvScaleDownu8 and the signature of fcvScaleDownu8 as it appears now, will be removed.

Uses an box averaging filter of size MxN where M is the scale factor in horizontal dimension and N is the scale factor in the vertical dimension. **NOTE:**

input dimensions should be multiple of output dimensions.

NOTE: On different processors, some output pixel values may be off by 1

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Source Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Source Image height.
- **dst** – Output 8-bit image. Size of buffer is dstWidth\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Destination Image width.
- **dstHeight** – Destination Image height.

- FASTCV\_API void fcvScaleDownu8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride)

    - Downsample Horizontaly and/or Vertically by an *integer* scale.

**ATTENTION:** This function is a duplication of [fcvScaleDownu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga3cf8272e5d96f55ae7c809048cb88c2f) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvScaleDownu8*, *fcvScaleDownu8\_v2* will be removed, and the current signature for *fcvScaleDownu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvScaleDownu8* when transitioning to 2.0.0.

Uses an box averaging filter of size MxN where M is the scale factor in horizontal dimension and N is the scale factor in the vertical dimension **NOTE:**

input dimensions should be multiple of output dimensions.

NOTE: On different processors, some output pixel values may be off by 1

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Source Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Source Image height.
- **srcStride** – Image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Destination Image width.
- **dstHeight** – Destination Image height.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as dstWidth if not 0.

- FASTCV\_API void fcvScaleUpBy2Gaussian5x5u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst)

    - Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvScaleUpBy2Gaussian5x5u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga81022edcbf6fb4c3672cf06318ee3a2c). In the 2.0.0 release, fcvScaleUpBy2Gaussian5x5u8\_v2 will be renamed to fcvScaleUpBy2Gaussian5x5u8 and the signature of fcvScaleUpBy2Gaussian5x5u8 as it appears now, will be removed.

Upsamples the image using a 5x5 Gaussian filter kernel. /n/b NOTE: border values have been taken care with Gaussion coefficients.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height.
- **dst** – Output 8-bit upsampled image of size (2\*width) x (2\*height). **WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcvScaleUpBy2Gaussian5x5u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstStride)

    - Upscale a grayscale image by a factor of two using a 5x5 Gaussian filter kernel.

**ATTENTION:** This function is a duplication of [fcvScaleUpBy2Gaussian5x5u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga8cb92cb14339ac3b8fc6951795126ad0) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvScaleUpBy2Gaussian5x5u8*, *fcvScaleUpBy2Gaussian5x5u8\_v2* will be removed, and the current signature for *fcvScaleUpBy2Gaussian5x5u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvScaleUpBy2Gaussian5x5u8* when transitioning to 2.0.0.

Upsamples the image using a 5x5 Gaussian filter kernel. /n/b NOTE: border values have been taken care with Gaussion coefficients.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcStride** – Image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **srcHeight** – Image height.
- **dst** – Output 8-bit upsampled image of size (2\*dstStride) x (2\*srcHeight). **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth\*2. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth\*2 if not 0.

- FASTCV\_API int fcvTransformAffine8x8u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, const int32\_t \*\_\_restrict nPos, const int32\_t \*\_\_restrict nAffine, uint8\_t \*\_\_restrict nPatch)

    - Warps the patch centered at nPos in the input image using the affine transform in nAffine.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvTransformAffine8x8u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gaf88b283549143edc9a2bbd8a94a59fd7). In the 2.0.0 release, fcvTransformAffine8x8u8\_v2 will be renamed to fcvTransformAffine8x8u8 and the signature of fcvTransformAffine8x8u8 as it appears now, will be removed.

**WARNING:** should be 128-bit aligned.

- Parameters:

    - - **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **nPos[** – 2 ] Position in the image in 32 bit fixed point (Q16) **NOTE:**

    if any 1 coordinates of the warped square are inside the image, return 1 and

    leave function. Otherwise, return 0.

**WARNING:** must be 64-bit aligned.
- **nAffine[** –

    2 ][ 2 ] Transformation matrix in 32 bit fixed point (Q16). The matrix stored in nAffine is using row major ordering:

    a11, a12, a21, a22 where the matrix is:

    | a11, a12 |

    | a21, a22 |
- **nPatch** – Transformed patch.

- Returns:

    - 0 if the transformation is valid

- FASTCV\_API int fcvTransformAffine8x8u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, const int32\_t \*\_\_restrict nPos, const int32\_t \*\_\_restrict nAffine, uint8\_t \*\_\_restrict patch, unsigned int patchStride)

    - Warps the patch centered at nPos in the input image using the affine transform in nAffine.

**ATTENTION:** This function is a duplication of [fcvTransformAffine8x8u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga38706cd9f070efeb86ce15ead704050a) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvTransformAffine8x8u8*, *fcvTransformAffine8x8u8\_v2* will be removed, and the current signature for *fcvTransformAffine8x8u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvTransformAffine8x8u8* when transitioning to 2.0.0.

**WARNING:** should be 128-bit aligned.

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Stride of image (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** must be at least as much as srcWidth if not 0.
- **nPos[** – 2 ] Position in the image in 32 bit fixed point (Q16) **NOTE:**

    if any 1 coordinates of the warped square are inside the image, return 1 and

    leave function. Otherwise, return 0.

**WARNING:** must be 64-bit aligned.
- **nAffine[** –

    2 ][ 2 ] Transformation matrix in 32 bit fixed point (Q16). The matrix stored in nAffine is using row major ordering:

    a11, a12, a21, a22 where the matrix is:

    | a11, a12 |

    | a21, a22 |
- **patch** – Transformed patch.
- **patchStride** – Stride of patch (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. **NOTE:** if 0, srcStride is set as 8. **WARNING:** must be at least as much as 8 if not 0.

- Returns:

    - 0 if the transformation is valid

- FASTCV\_API void fcvWarpPerspectiveu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight, float \*\_\_restrict projectionMatrix)

    - Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. Bi-linear interpolation is used where applicable.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvWarpPerspectiveu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gac2662e4f41b8042e8d677b0ee33a7c5e). In the 2.0.0 release, fcvWarpPerspectiveu8\_v2 will be renamed to fcvWarpPerspectiveu8 and the signature of fcvWarpPerspectiveu8 as it appears now, will be removed.

Warps an image taking into consideration the perspective scaling.

Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Input image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Input image height. **WARNING:** should be multiple of 8.
- **dst** – Warped output image. Size of buffer is dstWidth\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Dst image width. **NOTE:** data should be multiple of 8.
- **dstHeight** – Dst image height. **NOTE:** should be multiple of 8
- **projectionMatrix** –

    3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering:

    a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 | a31, a32, a33 |**WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcvWarpPerspectiveu8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride, float \*\_\_restrict projectionMatrix)

    - Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines. Bi-linear interpolation is used where applicable.

**ATTENTION:** This function is a duplication of [fcvWarpPerspectiveu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga023495d13900f6736e61641c959fc47f) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvWarpPerspectiveu8*, *fcvWarpPerspectiveu8\_v2* will be removed, and the current signature for *fcvWarpPerspectiveu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvWarpPerspectiveu8* when transitioning to 2.0.0.

Warps an image taking into consideration the perspective scaling.

Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Input image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Input image height. **WARNING:** should be multiple of 8.
- **srcStride** – Input image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Warped output image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Dst image width. **NOTE:** data should be multiple of 8.
- **dstHeight** – Dst image height. **NOTE:** should be multiple of 8
- **dstStride** – Output image stride (in bytes). **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as dstWidth if not 0.
- **projectionMatrix** –

    3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering:

    a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 | a31, a32, a33 |**WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcv3ChannelWarpPerspectiveu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight, float \*\_\_restrict projectionMatrix)

    - Warps a 3 color channel image based on a 3x3 perspective projection matrix using bilinear interpolation.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcv3ChannelWarpPerspectiveu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga20a33e0de8830eb6654e6c8ab4dfd748). In the 2.0.0 release, fcv3ChannelWarpPerspectiveu8\_v2 will be renamed to fcv3ChannelWarpPerspectiveu8 and the signature of fcv3ChannelWarpPerspectiveu8 as it appears now, will be removed.

Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input image. Size of buffer is srcWidth\*srcHeight\*3 bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Input image width. **NOTE:** should be multiple of 8
- **srcHeight** – Input image height. **NOTE:** should be multiple of 8
- **dst** – Warped output image. Size of buffer is dstWidth\*dstHeight\*3 bytes. **NOTE:** data should be 128-bit aligned.
- **dstWidth** – Output image width. **NOTE:** should be multiple of 8.
- **dstHeight** – Output image height. **NOTE:** should be multiple of 8.
- **projectionMatrix** –

    3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering:

    a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 | a31, a32, a33 |**WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcv3ChannelWarpPerspectiveu8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstWidth, unsigned int dstHeight, unsigned int dstStride, float \*\_\_restrict projectionMatrix)

    - Warps a 3 color channel image based on a 3x3 perspective projection matrix using bilinear interpolation.

**ATTENTION:** This function is a duplication of [fcv3ChannelWarpPerspectiveu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga2c43a3456bc39f39cc68208d25108f6b) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcv3ChannelWarpPerspectiveu8*, *fcv3ChannelWarpPerspectiveu8\_v2* will be removed, and the current signature for *fcv3ChannelWarpPerspectiveu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcv3ChannelWarpPerspectiveu8* when transitioning to 2.0.0.

Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Input image width. **WARNING:** should be multiple of 8
- **srcHeight** – Input image height. **WARNING:** should be multiple of 8
- **srcStride** – Input image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth\*3. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth\*3 if not 0.
- **dst** – Warped output image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Output image width. **WARNING:** should be multiple of 8.
- **dstHeight** – Output image height. **WARNING:** should be multiple of 8.
- **dstStride** – Output image stride (in bytes). **NOTE:** if 0, dstStride is set as dstWidth\*3. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as dstWidth\*3 if not 0.
- **projectionMatrix** –

    3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering:

    a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 | a31, a32, a33 |**WARNING:** should be 128-bit aligned.

- FASTCV\_API int fcvTransformAffineu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, const float \*\_\_restrict position, const float \*\_\_restrict affine, uint8\_t \*\_\_restrict patch, unsigned int patchWidth, unsigned int patchHeight)

    - Warps the patch centered at nPos in the input image using the affine transform in nAffine.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvTransformAffineu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga4692d7bd8ac8ec83990783e7ddccda17). In the 2.0.0 release, fcvTransformAffineu8\_v2 will be renamed to fcvTransformAffineu8 and the signature of fcvTransformAffineu8 as it appears now, will be removed.

**WARNING:** should be 128-bit aligned.

- Parameters:

    - - **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **position[** – 2 ] Position in the image **WARNING:** must be 64-bit aligned.
- **affine[** –

    2 ][ 2 ] Transformation matrix. The matrix stored in affine is using row major ordering:

    a11, a12, a21, a22 where the matrix is:

    | a11, a12 |

    | a21, a22 |
- **patch** – Transformed patch.
- **patchWidth** – Patch width.
- **patchHeight** – Patch height.

- Returns:

    - 0 if the transformation is valid

- FASTCV\_API int fcvTransformAffineu8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, const float \*\_\_restrict position, const float \*\_\_restrict affine, uint8\_t \*\_\_restrict patch, unsigned int patchWidth, unsigned int patchHeight, unsigned int patchStride)

    - Warps the patch centered at nPos in the input image using the affine transform in nAffine.

**ATTENTION:** This function is a duplication of [fcvTransformAffineu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gafa9520a1c8b7638ed5bfcd7f6651cea4) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvTransformAffineu8*, *fcvTransformAffineu8\_v2* will be removed, and the current signature for *fcvTransformAffineu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvTransformAffineu8* when transitioning to 2.0.0.

**WARNING:** should be 128-bit aligned.

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Stride of image (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** must be at least as much as srcWidth if not 0.
- **position[** – 2 ] Position in the image **WARNING:** must be 64-bit aligned.
- **affine[** –

    2 ][ 2 ] Transformation matrix. The matrix stored in affine is using row major ordering:

    a11, a12, a21, a22 where the matrix is:

    | a11, a12 |

    | a21, a22 |
- **patch** – Transformed patch.
- **patchWidth** – Patch width.
- **patchHeight** – Patch height.
- **patchStride** – Stride of patch (in bytes) - i.e., how many bytes between column 0 of row N and column 0 of row N+1. **NOTE:** if 0, patchStride is set as patchWidth. **WARNING:** must be at least as much as patchWidth if not 0.

- Returns:

    - 0 if the transformation is valid

- FASTCV\_API void fcvCopyRotated17x17u8(const uint8\_t \*\_\_restrict src, uint8\_t \*\_\_restrict dst, int orientation)

    - Extracts a 17x17 rotation corrected patch from a 25x25 image.

- Parameters:

    - - **src** – 25x25 input image in continuous memory.
- **dst** – 17x17 output patch.
- **orientation** –

    Rotation angle of patch relative to src.

    10-bit fixed-point angle around unit circle.

 NOTE: 0 = 0 degrees and 1024 = 360 degrees.

- FASTCV\_API void fcvDWTHarrTransposeu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs forward Haar discrete wavelet transform on input image and transpose the result.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvDWTHaarTransposeu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga0f5e56bd98466970794f0baa303c6364). In the 2.0.0 release, the signature of fcvDWTHarrTransposeu8 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1) If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1) If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvDWTHaarTransposeu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs forward Haar discrete wavelet transform on input image and transposes the result.

This function performs forward discrete wavelet transform on input image using the Haar kernel: Low pass: [ 1 1 ] \* 2^(-1/2) High pass: [ 1 -1 ] \* 2^(-1/2) This function also transposes the result.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image that has been transformed and transposed **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvDWT53TabTransposes16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs forward 5-3 Tab discrete wavelet transform on input image and transposes the result.

This function performs forward discrete wavelet transform on input image using the 5-tab low pass filter and the 3-tab high pass filter: 5-tab low pass: [ -1/8 1/4 3/4 1/4 -1/8 ] \* 2^(1/2) 3-tab high pass: [ -1/2 1 -1/2 ] \* 2^(-1/2) This function also transposes the result.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Output image that has been transformed and transposed **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvIDWT53TabTransposes16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs inverse 5-3 Tab discrete wavelet transform on input image and transposes the result.

This function performs inverse discrete wavelet transform on input image using the 3-tab low pass filter and the 5-tab high pass filter: 3-tab low pass: [ -1/2 1 -1/2 ] \* 2^(-1/2) 5-tab high pass: [ -1/8 1/4 3/4 1/4 -1/8 ] \* 2^(1/2) This function also transposes the result.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Output image that has been transformed and transposed **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvIDWTHarrTransposes16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs inverse Haar discrete wavelet transform on input image and transpose the result.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvIDWTHaarTransposes16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gae4babde3dc4ca9d1a135739d9e61bc82). In the 2.0.0 release, the signature of fcvIDWTHarrTransposes16 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth. **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvIDWTHaarTransposes16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs inverse Haar discrete wavelet transform on input image and transposes the result.

This function performs inverse discrete wavelet transform on input image using the Haar kernel: Low pass: [ 1 1 ] \* 2^(-1/2) High pass: [ 1 -1 ] \* 2^(-1/2) This function also transposes the result.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Output image that has been transformed and transposed **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to srcWidth. **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvDWTHaaru8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs forward Haar discrete wavelet transform on input image.

This function performs forward discrete wavelet transform on the input image using Haar kernel.

- Parameters:

    - - **src** – Pointer to input single plane image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of the input image **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of the input image
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvDWT53Tabs16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs forward 5-3 Tab discrete wavelet transform on input image.

This function performs forward discrete wavelet transform on the input image using 5-3 Tab kernel.

- Parameters:

    - - **src** – Pointer to input single plane image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of the input image **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of the input image
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvIDWT53Tabs16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs inverse 5-3 Tab discrete wavelet transform on input image.

This function performs inverse discrete wavelet transform on the input image using 5-3 Tab kernel.

- Parameters:

    - - **src** – Pointer to input single plane image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of the input image **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of the input image
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvIDWTHaars16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs inverse Haar discrete wavelet transform on input image.

This function performs inverse discrete wavelet transform on the input image using Haar kernel.

- Parameters:

    - - **src** – Pointer to input single plane image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of the input image **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of the input image
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth. **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvDCTu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs forward discrete Cosine transform on uint8\_t pixels.

This function performs 8x8 forward discrete Cosine transform on input image

- Parameters:

    - - **src** – Pointer to input single plane image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of the input image **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of the input image
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvIDCTs16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs inverse discrete cosine transform on int16\_t coefficients.

This function performs 8x8 inverse discrete Cosine transform on input image

- Parameters:

    - - **src** – Pointer to input single plane image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of the input image **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of the input image
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, srcStride is default to srcWidth \* sizeof(int16\_t). **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image **NOTE:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 1 and column 0 of row 2). If left at 0, dstStride is default to srcWidth. **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvScaleUpPolyu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride)

    - Perform image upscaling using polyphase filters.

Perform image upscaling using polyphase filters. The image data type is unsigned byte.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width **NOTE:** should be a multiple of 8.
- **dstHeight** – Output image height
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value.

- FASTCV\_API void fcvScaleUpPolyInterleaveu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride)

    - Interleaved image (CbCr or CrCb) upscaling using polyphase filters.

Perform interleaved image (CbCr or CrCb) upscaling using polyphase filters. Data type is unsigned byte.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width, number of (CrCb/CbCr) pairs **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth \* 2. **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width, number of (CrCb/CbCr) pairs **NOTE:** should be a multiple of 8.
- **dstHeight** – Output image height
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth \* 2. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value.

- FASTCV\_API void fcvScaleDownMNu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride)

    - Image downscaling using MN method **NOTE:** This MN downscalar supports up to 1/20x downscaling.

The M over N downscale algorithm works on an arbitrary length (N) of input data, and generates another arbitrary length (M) of output data, with the output length M less or equal to the input length N.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width
- **srcHeight** – Input image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width
- **dstHeight** – Output image height
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1) If left at 0, dstStride is default to dstWidth. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value.

- FASTCV\_API void fcvScaleDownMNInterleaveu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride)

    - Interleaved image downscaling using MN method.

The M over N downscale algorithm works on an arbitrary length (N) of input data, and generates another arbitrary length (M) of output data, with the output length M less or equal to the input length N.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width, number of (CrCb/CbCr) pair **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth \* 2. **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width , number of (CrCb/CbCr) pair **NOTE:** should be a multiple of 8.
- **dstHeight** – Output image height
- **dstStride** – Stride of output image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth \* 2. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value.

- FASTCV\_API void fcvGetPerspectiveTransformf32(const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) src1, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) src2, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) transformCoefficient)

    - Calculates a perspective transform from four pairs of the corresponding points. NOTE: in order to guarantee a valid output transform, any three points in src1 or src2 cannot be collinear.

- Parameters:

    - - **src1** – Coordinates of quadrangle vertices in the source image
- **src2** – Coordinates of the corresponding quadrangle vertices in the destination image
- **transformCoefficient** – 3x3 matrix of a perspective transform

- FASTCV\_API void fcvRemapRGBA8888NNu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapX, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapY, uint32\_t mapStride)

    - Applies a generic geometrical transformation to a 4-channel uint8 image. The interpolation method is nearest neighbor.

The brightness of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.

- Parameters:

    - - **src** – Input uint8\_t image. The size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width. **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height.
- **srcStride** – Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth\*4. **NOTE:** should be a multiple of 8.
- **dst** – Output image which has the same type, and size as the input image. The size of buffer is dstStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width.
- **dstHeight** – Output image height.
- **dstStride** – Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to dstWidth\*4. **NOTE:** should be a multiple of 8.
- **mapX** – a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapY** – a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapStride** – the stride of the mapX and mapY if mapStride is equal to 0, it will be set to dstWidth\*4. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value

- FASTCV\_API void fcvRemapRGBA8888BLu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapX, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapY, uint32\_t mapStride)

    - Applies a generic geometrical transformation to a 4-channel uint8 image with bilinear interpolation.

The brightness of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.

- Parameters:

    - - **src** – Input uint8\_t image. The size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width. **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height.
- **srcStride** – Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth\*4. **NOTE:** should be a multiple of 8.
- **dst** – Output image which has the same type, and size as the input image. The size of buffer is dstStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width.
- **dstHeight** – Output image height.
- **dstStride** – Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride equals to 0, it will be set to dstWidth\*4. **NOTE:** should be a multiple of 8.
- **mapX** – a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapY** – a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapStride** – the stride of the mapX and mapY if mapStride equals to 0, it will be set to dstWidth\*4. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value

- FASTCV\_API void fcvTransformAffineClippedu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict affineMatrix, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, uint32\_t \*\_\_restrict dstBorder)

    - Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels are sampled using bi-linear interpolation. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.

**ATTENTION:** This function’s signature will become **OBSOLETE** in a future release of this library (2.0.0). The new interface is specified in the function: [fcvTransformAffineClippedu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga04beaa387de1c73f40e7118100380cce). In the 2.0.0 release, fcvTransformAffineClippedu8\_v2 will be renamed to fcvTransformAffineClippedu8 and the signature of fcvTransformAffineClippedu8 as it appears now, will be removed.

Warning: The convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there’s unexpected result, it could be due to different rotation convention. If that’s the case, negate the angle before calculating transform matrix.

The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools. **NOTE:** data should be 128-bit aligned.

- Parameters:

    - - **src** – Input 8-bit image. **NOTE:** data should be 128-bit aligned. Size of buffer is srcStride\*srcHeight bytes.
- **srcWidth** – Input image width. The number of pixels in a row.
- **srcHeight** – Input image height.
- **srcStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **affineMatrix** –

    2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering:

    a11, a12, a13, a21, a22, a23 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |
- **dst** – Transformed output 8-bit image. **NOTE:** data should be 128-bit aligned.
- **dstWidth** – Dst image width.
- **dstHeight** – Dst image height.
- **dstStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 dstStride is default to dstWidth. **NOTE:** should be a multiple of 8.
- **dstBorder** – Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,… where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2\*dstHeight integers in size. If dstBorder is set as NULL, then the border isn’t processed. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvTransformAffineClippedu8\_v2(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict affineMatrix, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, uint32\_t \*\_\_restrict dstBorder, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation)

    - Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.

**ATTENTION:** This function is a duplication of [fcvTransformAffineClippedu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga94a49faea870c6b3259f67d2d5e52321) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvTransformAffineClippedu8*, *fcvTransformAffineClippedu8\_v2* will be removed, and the current signature for *fcvTransformAffineClippedu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvTransformAffineClippedu8* when transitioning to 2.0.0.

The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools. **NOTE:** data should be 128-bit aligned.

- Parameters:

    - - **src** – Input 8-bit image. **NOTE:** data should be 128-bit aligned. Size of buffer is srcStride\*srcHeight bytes.
- **srcWidth** – Input image width. The number of pixels in a row.
- **srcHeight** – Input image height.
- **srcStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **affineMatrix** –

    2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering:

    a11, a12, a13, a21, a22, a23 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 Warning: The convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there’s unexpected result, it could be due to different rotation convention. If that’s the case, negate the angle before calculating transform matrix.
- **dst** – Transformed output 8-bit image. **NOTE:** data should be 128-bit aligned.
- **dstWidth** – Dst image width.
- **dstHeight** – Dst image height.
- **dstStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 dstStride is default to dstWidth. **NOTE:** should be a multiple of 8.
- **dstBorder** – Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,… where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2\*dstHeight integers in size. If the dstBorder is set as NULL, then the border isn’t processed. **NOTE:** data should be 128-bit aligned.
- **interpolation** – Specifies the interpolation method to use for sampling.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvTransformAffineClippedu8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict affineMatrix, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, uint32\_t \*\_\_restrict dstBorder, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Applies an affine transformation on a grayscale image using a 2x3 matrix. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.

**ATTENTION:** This function is a duplication of [fcvTransformAffineClippedu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga94a49faea870c6b3259f67d2d5e52321) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvTransformAffineClippedu8*, *fcvTransformAffineClippedu8\_v3* will be removed, and the current signature for *fcvTransformAffineClippedu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvTransformAffineClippedu8* when transitioning to 2.0.0.

The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools. **NOTE:** data should be 128-bit aligned.

- Parameters:

    - - **src** – Input 8-bit image. **NOTE:** data should be 128-bit aligned. Size of buffer is srcStride\*srcHeight bytes.
- **srcWidth** – Input image width. The number of pixels in a row.
- **srcHeight** – Input image height.
- **srcStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **affineMatrix** –

    2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering:

    a11, a12, a13, a21, a22, a23 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 Warning: The convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there’s unexpected result, it could be due to different rotation convention. If that’s the case, negate the angle before calculating transform matrix.
- **dst** – Transformed output 8-bit image. **NOTE:** data should be 128-bit aligned.
- **dstWidth** – Dst image width.
- **dstHeight** – Dst image height.
- **dstStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 dstStride is default to dstWidth. **NOTE:** should be a multiple of 8.
- **dstBorder** – Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,… where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2\*dstHeight integers in size. If the dstBorder is set as NULL, then the border isn’t processed. **NOTE:** data should be 128-bit aligned.
- **interpolation** – Specifies the interpolation method to use for sampling.
- **borderType** – The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV\_BORDER\_UNDEFINED and FASTCV\_BORDER\_CONSTANT.
- **borderValue** – The user-specified constant pixel value, in case FASTCV\_BORDER\_CONSTANT is chosen for borderType.

- FASTCV\_API void fcv3ChannelTransformAffineClippedBCu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict affineMatrix, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, uint32\_t \*\_\_restrict dstBorder)

    - Applies an affine transformation on a 3-color channel image using a 2x3 matrix using bicubic interpolation. Pixels that would be sampled from outside the source image are not modified in the target image. The left-most and right-most pixel coordinates of each scanline are written to dstBorder.

The affine matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the affine matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of affine matrices are assumed. If not, please transform the affine matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Input image width.
- **srcHeight** – Input image height.
- **srcStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. **NOTE:** if 0, srcStride is set as srcWidth\*3. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth\*3 if not 0.
- **affineMatrix** –

    2x3 perspective transformation matrix. The matrix stored in affineMatrix is using row major ordering:

    a11, a12, a13, a21, a22, a23 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 Warning: the convention for rotation angle is: positive for clockwise rotation and negative for counter-clockwise rotation. If there’s unexpected result, it could be due to different rotation convention. If that’s the case, negate the angle before calculating transform matrix.
- **dst** – Warped output image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Output image width.
- **dstHeight** – Output image height.
- **dstStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. **NOTE:** if 0, dstStride is set as dstWidth\*3. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as dstWidth\*3 if not 0. **NOTE:** data should be 128-bit aligned.
- **dstBorder** – Output array receiving the x-coordinates of left-most and right-most pixels for each scanline. The format of the array is: l0,r0,l1,r1,l2,r2,… where l0 is the left-most pixel coordinate in scanline 0 and r0 is the right-most pixel coordinate in scanline 0. The buffer must therefore be 2\*dstHeight integers in size. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvScaleDownBLu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride)

    - Image downscaling using bilinear method.

- Parameters:

    - - **src** – Input image **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width
- **srcHeight** – Input image height
- **srcStride** – Stride of input image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, srcStride is default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width
- **dstHeight** – Output image height
- **dstStride** – Stride of image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, dstStride is default to dstWidth. **NOTE:** should be a multiple of 8.

- Returns:

    - No return value.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvTableLookupu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, const uint8\_t \*\_\_restrict lut, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Applies a Table Look-up transformation to a single-channel uint8 image.

Each pixel in the input image is used to index into a look-up table and the indexed look-up table value is then put into the output image

- Parameters:

    - - **src** – Input uint8\_t image. The size of buffer is srcStride\*srcHeight bytes **NOTE:** should be 128-bit aligned
- **srcWidth** – Input image width
- **srcHeight** – Input image height
- **srcStride** – Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth **NOTE:** should be a multiple of 8
- **lut** – The Look-up Table given as a 256-element array of type uint8\_t
- **dst** – Output image which has the same dimension as the input image in uint8\_t type **NOTE:** should be 128-bit aligned
- **dstStride** – Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to srcWidth **NOTE:** should be a multiple of 8

- Returns:

    - FASTCV\_SUCCESS upon success, other values upon failure.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvWarpPerspectiveu8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, float \*\_\_restrict projectionMatrix, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation)

    - Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines.

**ATTENTION:** This function is a duplication of [fcvWarpPerspectiveu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga023495d13900f6736e61641c959fc47f) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvWarpPerspectiveu8*, *fcvWarpPerspectiveu8\_v3* will be removed, and the current signature for *fcvWarpPerspectiveu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvWarpPerspectiveu8* when transitioning to 2.0.0.

Warps an image taking into consideration the perspective scaling.

Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Input image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Input image height. **WARNING:** should be multiple of 8.
- **srcStride** – Input image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Warped output image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Dst image width. **NOTE:** data should be multiple of 8.
- **dstHeight** – Dst image height. **NOTE:** should be multiple of 8
- **dstStride** – Output image stride (in bytes). **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as dstWidth if not 0.
- **projectionMatrix** –

    3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering:

    a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 | a31, a32, a33 |**WARNING:** should be 128-bit aligned.
- **interpolation** – Specifies the interpolation method to be used.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvWarpPerspectiveu8\_v4(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, float \*\_\_restrict projectionMatrix, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Warps a grayscale image using the a perspective projection transformation matrix (also known as a homography). This type of transformation is an invertible transformation which maps straight lines to straight lines.

**ATTENTION:** This function is a duplication of [fcvWarpPerspectiveu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga023495d13900f6736e61641c959fc47f) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvWarpPerspectiveu8*, *fcvWarpPerspectiveu8\_v4* will be removed, and the current signature for *fcvWarpPerspectiveu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvWarpPerspectiveu8* when transitioning to 2.0.0.

Warps an image taking into consideration the perspective scaling.

Note: The projection matrix follows the so-called inverse mapping convention. It is applied to the dst coordinates to produce the corresponding src coordinates. In other 3rd party tools, the so-called forward mapping convention may be used, where the projection matrix refers to the one applied to the src coordinates to produce the dst coordinates. When comparing with 3rd party results, please make sure the same convention of projection matrices are assumed. If not, please transform the projection matrix into an equivalent form under the forward mapping convention before feeding it into 3rd party tools.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Input image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Input image height. **WARNING:** should be multiple of 8.
- **srcStride** – Input image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Warped output image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Dst image width. **NOTE:** data should be multiple of 8.
- **dstHeight** – Dst image height. **NOTE:** should be multiple of 8
- **dstStride** – Output image stride (in bytes). **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as dstWidth if not 0.
- **projectionMatrix** –

    3x3 perspective transformation matrix (generally a homography). The matrix stored in homography is row major ordering:

    a11, a12, a13, a21, a22, a23, a31, a32, a33 where the matrix is:

    | a11, a12, a13 |

    | a21, a22, a23 |

 | a31, a32, a33 |**WARNING:** should be 128-bit aligned.
- **interpolation** – Specifies the interpolation method to be used.
- **borderType** – The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV\_BORDER\_UNDEFINED and FASTCV\_BORDER\_CONSTANT.
- **borderValue** – The user-specified constant pixel value, in case FASTCV\_BORDER\_CONSTANT is chosen for borderType.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvRemapu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapX, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapY, uint32\_t mapStride, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation)

    - Applies a generic geometrical transformation to a greyscale uint8 image. The interpolation method is specified through a parameter.

The greyscale of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.

- Parameters:

    - - **src** – Input uint8\_t image. The size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width. **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height.
- **srcStride** – Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image which has the same type, and size as the input image. The size of buffer is dstStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width.
- **dstHeight** – Output image height.
- **dstStride** – Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to dstWidth. **NOTE:** should be a multiple of 8.
- **mapX** – a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapY** – a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapStride** – the stride of the mapX and mapY if mapStride is equal to 0, it will be set to dstWidth\*sizeof(float32\_t). **NOTE:** should be a multiple of 8.
- **interpolation** – the interpolation method to derive the dst pixel value. supported methods are nearest neighbor, bilinear and area.

- Returns:

    - FASTCV\_SUCCESS upon success. Other status codes upon failure.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvRemapu8\_v2(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapX, const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict mapY, uint32\_t mapStride, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Applies a generic geometrical transformation to a greyscale uint8 image. The interpolation method is specified through a parameter.

**ATTENTION:** This function is a duplication of [fcvRemapu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1gadae9342e99cd5c15f2f7cd01d4d202e5) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvRemapu8*, *fcvRemapu8\_v2* will be removed, and the current signature for *fcvRemapu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvRemapu8* when transitioning to 2.0.0.

The greyscale of each pixel in the destination image is obtained from a location of the source image through a per-element mapping as defined in the mapping matrices. The mapping has subpixel precision, thus interpolations are involved.

- Parameters:

    - - **src** – Input uint8\_t image. The size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Input image width. **NOTE:** should be a multiple of 8.
- **srcHeight** – Input image height.
- **srcStride** – Input image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if srcStride is equal to 0, it will be set to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Output image which has the same type, and size as the input image. The size of buffer is dstStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **dstWidth** – Output image width.
- **dstHeight** – Output image height.
- **dstStride** – Output image stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row if dstStride is equal to 0, it will be set to dstWidth. **NOTE:** should be a multiple of 8.
- **mapX** – a floating point matrix, each element is the column coordinate of the mapped location in the src image. E.g. if dst(i,j) is mapped to src(ii,jj), then mapX(i,j) =jj. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapY** – a floating point matrix, each element is the row coordinate of the mapped location in the src image.E.g. if dst(i,j) is mapped to src(ii,jj), then mapY(i,j) =ii. the matrix has the same width, height as the dst image. The size of buffer is mapStride\*dstHeight bytes. **NOTE:** should be 128-bit aligned.
- **mapStride** – the stride of the mapX and mapY if mapStride is equal to 0, it will be set to dstWidth\*sizeof(float32\_t). **NOTE:** should be a multiple of 8.
- **interpolation** – the interpolation method to derive the dst pixel value. supported methods are nearest neighbor, bilinear and area.
- **borderType** – The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV\_BORDER\_UNDEFINED and FASTCV\_BORDER\_CONSTANT.
- **borderValue** – The user-specified constant pixel value, in case FASTCV\_BORDER\_CONSTANT is chosen for borderType.

- Returns:

    - FASTCV\_SUCCESS upon success. Other status codes upon failure.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvMagnitudes16(const int16\_t \*\_\_restrict src1, uint32\_t width, uint32\_t height, uint32\_t src1Stride, const int16\_t \*\_\_restrict src2, uint32\_t src2Stride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Gradient Magnitude Computation from two int16\_t type matrices.

The function takes two gradient matrices in int16\_t and computes the magnitude in int16\_t. **NOTE:** Saturation is used when computed magnitude value is larger than max limit of int16\_t.

- Parameters:

    - - **src1** – The gradient matrix in X direction. **NOTE:** array should be 128-bit aligned
- **width** – Width of the source matrix.
- **height** – Height of the source matrix.
- **src1Stride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src1Stride is default to width\*2. **WARNING:** should be multiple of 8
- **src2** – The gradient matrix in Y direction. **NOTE:** array should be 128-bit aligned
- **src2Stride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src2Stride is default to width\*2. **WARNING:** should be multiple of 8
- **dst** – the result matrix (int16\_t type). **NOTE:** array should be 128-bit aligned
- **dstStride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 dstStride is default to width\*2. **WARNING:** should be multiple of 8

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvPhases16(const int16\_t \*\_\_restrict src1, uint32\_t width, uint32\_t height, uint32\_t src1Stride, const int16\_t \*\_\_restrict src2, uint32\_t src2Stride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Gradient Phase Computation from two int16\_t type matrices.

The function takes two gradient matrices in int16\_t and computes the phase for each pixel, storing results in a uint8\_t matrix. The phase angle is translated to [0, 2\*PI) and then mapped to range [0, 255).

- Parameters:

    - - **src1** – The gradient matrix in X direction. **NOTE:** array should be 128-bit aligned
- **width** – Width of the source matrix.
- **height** – Height of the source matrix.
- **src1Stride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src1Stride is default to width\*2. **WARNING:** should be multiple of 8
- **src2** – The gradient matrix in Y direction. **NOTE:** array should be 128-bit aligned
- **src2Stride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 src2Stride is default to width\*2. **WARNING:** should be multiple of 8
- **dst** – the result matrix (uint8\_t type). **NOTE:** array should be 128-bit aligned
- **dstStride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 dstStride is default to width. **WARNING:** should be multiple of 8

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFFTu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict dst, uint32\_t dstStride)

    - Computes the 1D or 2D Fast Fourier Transform of a matrix.

Computes the 1D or 2D Fast Fourier Transform of a real valued matrix. For the 2D case, The width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.

- Parameters:

    - - **src** – An 8 bit unsigned real valued input matrix. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2. **NOTE:** array should be 128-bit aligned
- **srcWidth** – Width of the source matrix. **NOTE:** Must be a power of 2
- **srcHeight** – Height of the source matrix. **NOTE:** Must be a power of 2 for the 2D case, and must be set to 1 for the 1D case
- **srcStride** – Stride of the input matrix. Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is set to srcWidth. **WARNING:** should be multiple of 8
- **dst** – The computed FFT matrix. The FFT coefficients are stored in interleaved fashion, i.e., Re1 Im1 Re2 Im2 and so on. Hence the dimensions of the dst are (2 x srcWidth, srcHeight) **NOTE:** array should be 128-bit aligned
- **dstStride** – Stride of the output matrix. Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0, dstStride is set to 2 x srcWidth x sizeof(float32\_t). **WARNING:** should be multiple of 8

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvIFFTf32(const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Computes the 1D or 2D Inverse Fast Fourier Transform of a matrix.

Computes the 1D or 2D Inverse Fast Fourier Transform of a complex valued matrix. For the 2D case, The width and height of the input and output matrix must be powers of 2. For the 1D case, the height of the matrices must be 1, while the width must be a power of 2.

- Parameters:

    - - **src** – An 32 bit floating point complex valued input matrix. The data in the matrix must be stored in an interleaved fashion, i.e., Re1 Im1 Re2 Im2 and so on. The dimensions of the matrix must be powers of 2 for the 2D case, and in the 1D case, the height must be 1, while the width must be a power of 2. **NOTE:** array should be 128-bit aligned
- **srcWidth** – Width of the source matrix. The width here is the number of floating point units in the matrix. Since the data is interleaved fashion, i.e., Re1 Im1 Re2 Im2 and so on, the width is the total number of real and complex units in the matrix. For example, if the Matrix has data values Re1 Im1 Re2 Im2 Re3 Im3 Re4 Im4, then the width here is 8 units. **NOTE:** Must be a power of 2
- **srcHeight** – Height of the source matrix. **NOTE:** Must be a power of 2 for the 2D case, and must be set to 1 for the 1D case
- **srcStride** – Stride of the input matrix. Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0 srcStride is set to srcWidth x sizeof(float32\_t). **WARNING:** should be multiple of 8
- **dst** – The computed IFFT matrix. The matrix is real valued and has no imaginary components. Hence the dimensions of the dst are (srcWidth / 2 , srcHeight) **NOTE:** array should be 128-bit aligned
- **dstStride** – Stride of the output matrix. Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. If left at 0, dstStride is set to (srcWidth / 2). **WARNING:** should be multiple of 8

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvScaleu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation)

    - Scale an image Horizontaly and/or Vertically by arbitrary ratio. The scaling ratios are automatically determined from the specified source image size and destination image size.

Scale up or down the source image of size srcWidth-by-srcHeight to the destination image of size dstWidth-by-dstHeight. NOTE: dstWidth &gt; 0 && dstHeight &gt; 0.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Source Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Source Image height.
- **srcStride** – Stride of source image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, srcStride=srcWidth as default
- **dst** – Output 8-bit image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Destination Image width.
- **dstHeight** – Destination Image height.
- **dstStride** – Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, dstStride=dstWidth as default
- **interpolation** – The interpolation method used for scaling. Please see fcvInterpolationType. FASTCV\_INTERPOLATION\_TYPE\_NEAREST\_NEIGHBOR: Nearest neighbor interpolation. FASTCV\_INTERPOLATION\_TYPE\_BILINEAR: Bilinear interpolation. FASTCV\_INTERPOLATION\_TYPE\_AREA: Interpolation by area. Output values are determined by weighted averages of the source pixels covered by the destination pixel. The averaging weight for each source pixel is proportional to its area overlapping with the destination pixel. Interpolation by area may produce more precise images for scale down operations.

- Returns:

    - FASTCV\_SUCCESS upon success. Other values otherwise.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvScaleu8\_v2(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dstStride, [fcvInterpolationType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1aa4775f7713872af8f19bbe4627538078.html#_CPPv420fcvInterpolationType) interpolation, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Scale an image Horizontaly and/or Vertically by arbitrary ratio. The scaling ratios are automatically determined from the specified source image size and destination image size.

**ATTENTION:** This function is a duplication of [fcvScaleu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_transformation.html#a00024_1ga2e74b812a30ebca3618c849893258bd2) with the addition of extra parameters. This function has been added to allow for backward compatibility with the original function. When the 2.0.0 release of this library is made, this function will be renamed to: *fcvScaleu8*, *fcvScaleu8\_v2* will be removed, and the current signature for *fcvScaleu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvWarpPerspectiveu8* when transitioning to 2.0.0.

Scale up or down the source image of size srcWidth-by-srcHeight to the destination image of size dstWidth-by-dstHeight. NOTE: dstWidth &gt; 0 && dstHeight &gt; 0.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Source Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Source Image height.
- **srcStride** – Stride of source image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, srcStride=srcWidth as default
- **dst** – Output 8-bit image. Size of buffer is dstStride\*dstHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstWidth** – Destination Image width.
- **dstHeight** – Destination Image height.
- **dstStride** – Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, dstStride=dstWidth as default
- **interpolation** – The interpolation method used for scaling. Please see fcvInterpolationType. FASTCV\_INTERPOLATION\_TYPE\_NEAREST\_NEIGHBOR: Nearest neighbor interpolation. FASTCV\_INTERPOLATION\_TYPE\_BILINEAR: Bilinear interpolation. FASTCV\_INTERPOLATION\_TYPE\_AREA: Interpolation by area. Output values are determined by weighted averages of the source pixels covered by the destination pixel. The averaging weight for each source pixel is proportional to its area overlapping with the destination pixel. Interpolation by area may produce more precise images for scale down operations.
- **borderType** – The border mode for dst pixels not mapped to the src image. Supported modes are FASTCV\_BORDER\_UNDEFINED, FASTCV\_BORDER\_CONSTANT and FASTCV\_BORDER\_REPLICATE.
- **borderValue** – The user-specified constant pixel value, in case FASTCV\_BORDER\_CONSTANT is chosen for borderType.

- Returns:

    - FASTCV\_SUCCESS upon success. Other values otherwise.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcv2PlaneWarpPerspectiveu8(const uint8\_t \*\_\_restrict src1, const uint8\_t \*\_\_restrict src2, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t src1Stride, uint32\_t src2Stride, uint8\_t \*\_\_restrict dst1, uint8\_t \*\_\_restrict dst2, uint32\_t dstWidth, uint32\_t dstHeight, uint32\_t dst1Stride, uint32\_t dst2Stride, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict warpmatrix)

    - Perspective warp two images using the same transformation. Bi-linear interpolation is used where applicable.

Perspective warp two images (or buffer) using the same transformation in one function call. This can be used, for example, to warp a grayscale image and an alpha image at the same time, or warp two color channels (for example u and v de-interleaved for YUV).

- Parameters:

    - - **src1** – First input 8-bit image. Size of buffer is src1Stride\*srcHeight bytes.
- **src2** – Second input 8-bit image. Size of buffer is src2Stride\*srcHeight bytes.
- **srcWidth** – Input image width.
- **srcHeight** – Input image height.
- **src1Stride** – Input image 1 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to srcWidth.
- **src2Stride** – Input image 2 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to srcWidth.
- **dst1** – First warped output image (correspond to src1). Size of buffer is dst1Stride\*dstHeight bytes.
- **dst2** – Second warped output image (correspond to src2). Size of buffer is dst2Stride\*dstHeight bytes.
- **dstWidth** – Dst image width.
- **dstHeight** – Dst image height.
- **dst1Stride** – Output image 1 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to dstWidth.
- **dst2Stride** – Output image 2 stride, i.e. the gap (in terms of bytes) between the first element of a row and that of the successive row. If srcStride is equal to 0, it will be set to dstWidth.
- **warpmatrix** – 3x3 perspective transformation matrix (generally a homography).

- Returns:

    - FASTCV\_SUCCESS upon success. Other status codes upon failure.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvScaleDownBy2Gaussian3x3u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Downscale a grayscale image by a factor of two using a 3x3 Gaussian filter kernel.

This function first blurs the input image using a 3x3 Gaussian kernel, and then downsamples the image by selecting every other row and column. The dimensions of the destination image are computed as follows : dstWidth = (srcWidth + 1)/2 , dstHeight = (srcHeight + 1)/2

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes.
- **srcWidth** – Width of the input image.
- **srcHeight** – Height of the input image
- **srcStride** – Image stride (in bytes). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit downscale image of size (srcWidth + 1) / 2 x (srcHeight + 1) / 2. **NOTE:** border values have been taken care of w.r.t. the pixel coordinate.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as (srcWidth+1)/2. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as (srcWidth+1)/2 if not 0.

- Returns:

    - FASTCV\_SUCCESS upon success. Other status codes upon failure.

Last Published: Aug 30, 2024

[Previous Topic
Image processing](https://docs.qualcomm.com/bundle/publicresource/80-79511-2/topics/image_processing.md) [Next Topic
Machine Learning](https://docs.qualcomm.com/bundle/publicresource/80-79511-2/topics/machine_learning.md)