# Image processing

- FASTCV\_API void fcvFilterMedian3x3u8(const uint8\_t \*\_\_restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dstImg)

    - Blurs an image with 3x3 median filter.

**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: [fcvFilterMedian3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga956bde66847cec0361a74fccde6ceada). In the 2.0.0 release, fcvFilterMedian3x3u8\_v2 will be renamed to fcvFilterMedian3x3u8 and the signature of fcvFilterMedian3x3u8 as it appears now, will be removed.

Border values are ignored. The 3x3 mask convolves with the image area | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **srcImg** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight byte. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **dstImg** – Output 8-bit image. Size of buffer is srcWidth\*srcHeight byte. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvFilterMedian3x3u8\_v2(const uint8\_t \*\_\_restrict srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dstImg, unsigned int dstStride)

    - Blurs an image with 3x3 median filter.

**ATTENTION:** This function is a duplication of [fcvFilterMedian3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga988b50b64144308aa3e54eff5b58882a) 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: *fcvFilterMedian3x3u8*, *fcvFilterMedian3x3u8\_v2* will be removed, and the current signature for *fcvFilterMedian3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterMedian3x3u8* when transitioning to 2.0.0.

Border values are ignored. The 3x3 mask convolves with the image area | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **srcImg** – Input 8-bit image. Size of buffer is srcStride\*srcHeight byte. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dstImg** – Output 8-bit image. Size of buffer is dstStride\*srcHeight byte. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

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

    - Blurs an image with 3x3 Gaussian filter.

**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: [fcvFilterGaussian3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga0e0b9bac6f1e4b70301f345f5633b9f3). In the 2.0.0 release, fcvFilterGaussian3x3u8\_v2 will be renamed to fcvFilterGaussian3x3u8 and the signature of fcvFilterGaussian3x3u8 as it appears now, will be removed.

Gaussian kernel:

1 2 1

2 4 2

1 2 1

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight byte. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height.
- **dst** – Output 8-bit image. Destination buffer size is srcWidth\*srcHeight. **NOTE:** data should be 128-bit aligned.
- **blurBorder** – If set to 1, border is blurred by 0-padding adjacent values. If set to 0, borders up to half-kernel width are ignored (e.g. 1 pixel in the 3x3 case).

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

    - Blurs an image with 3x3 Gaussian filter.

**ATTENTION:** This function is a duplication of [fcvFilterGaussian3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga071881df27b5ab82a7762683d7c3868e) 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: *fcvFilterGaussian3x3u8*, *fcvFilterGaussian3x3u8\_v2* will be removed, and the current signature for *fcvFilterGaussian3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterGaussian3x3u8* when transitioning to 2.0.0.

Convolution with 3x3 Gaussian kernel:

1 2 1

2 4 2

1 2 1

- 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.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as dstWidth if not 0.
- **blurBorder** – If set to 1, border is blurred by 0-padding adjacent values. If set to 0, borders up to half-kernel width are ignored (e.g. 1 pixel in the 3x3 case).

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

    - Blurs an image with 5x5 Gaussian filter.

**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: [fcvFilterGaussian5x5u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaae5df7a5450cd77141aa938f564063c7). In the 2.0.0 release, fcvFilterGaussian5x5u8\_v2 will be renamed to fcvFilterGaussian5x5u8 and the signature of fcvFilterGaussian5x5u8 as it appears now, will be removed.

Convolution with 5x5 Gaussian kernel:

1 4 6 4 1

4 16 24 16 4

6 24 36 24 6

4 16 24 16 4

1 4 6 4 1

- Parameters:

    - - **src** – Input int data (can be sq. of gradient, etc). 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.
- **dst** – Output 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **blurBorder** – If set to 1, border is blurred by 0-padding adjacent values. If set to 0, borders up to half-kernel width are ignored (e.g. 2 pixel in the 5x5 case).

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

    - Blurs an image with 5x5 Gaussian filter.

**ATTENTION:** This function is a duplication of [fcvFilterGaussian5x5u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gae60817633f5e30785667ba93867da9d9) 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: *fcvFilterGaussian5x5u8*, *fcvFilterGaussian5x5u8\_v2* will be removed, and the current signature for *fcvFilterGaussian5x5u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterGaussian5x5u8* when transitioning to 2.0.0.

Convolution with 5x5 Gaussian kernel:

1 4 6 4 1

4 16 24 16 4

6 24 36 24 6

4 16 24 16 4

1 4 6 4 1

- Parameters:

    - - **src** – Input int data (can be sq. of gradient, etc). 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.
- **srcStride** – Image stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as dstWidth if not 0.
- **blurBorder** – If set to 1, border is blurred by 0-padding adjacent values. If set to 0, borders up to half-kernel width are ignored (e.g. 2 pixel in the 5x5 case).

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

    - Blurs an image with 11x11 Gaussian filter.

**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: [fcvFilterGaussian11x11u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga5257a86ac1e135566d517126fc20f526). In the 2.0.0 release, fcvFilterGaussian11x11u8\_v2 will be renamed to fcvFilterGaussian11x11u8 and the signature of fcvFilterGaussian11x11u8 as it appears now, will be removed.

Convolution with 11x11 Gaussian kernel:

1 10 45 120 210 252 210 120 45 10 1

10 100 450 1200 2100 2520 2100 1200 450 100 10

45 450 2025 5400 9450 11340 9450 5400 2025 450 45

120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120

210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210

252 2520 11340 30240 52920 63504 52920 30240 11340 2520 252

210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210

120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120

45 450 2025 5400 9450 11340 9450 5400 2025 450 45

10 100 450 1200 2100 2520 2100 1200 450 100 10

1 10 45 120 210 252 210 120 45 10 , 1

- 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.
- **dst** – Output 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **blurBorder** – If set to 1, border is blurred by 0-padding adjacent values. If set to 0, borders up to half-kernel width are ignored (e.g. 5 pixel in the 11x11 case).

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

    - Blurs an image with 11x11 Gaussian filter.

**ATTENTION:** This function is a duplication of [fcvFilterGaussian11x11u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga60d69f1aa98a358f8e730334426c8200) 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: *fcvFilterGaussian11x11u8*, *fcvFilterGaussian11x11u8\_v2* will be removed, and the current signature for *fcvFilterGaussian11x11u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterGaussian11x11u8* when transitioning to 2.0.0.

Convolution with 11x11 Gaussian kernel:

1 10 45 120 210 252 210 120 45 10 1

10 100 450 1200 2100 2520 2100 1200 450 100 10

45 450 2025 5400 9450 11340 9450 5400 2025 450 45

120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120

210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210

252 2520 11340 30240 52920 63504 52920 30240 11340 2520 252

210 2100 9450 25200 44100 52920 44100 25200 9450 2100 210

120 1200 5400 14400 25200 30240 25200 14400 5400 1200 120

45 450 2025 5400 9450 11340 9450 5400 2025 450 45

10 100 450 1200 2100 2520 2100 1200 450 100 10

1 10 45 120 210 252 210 120 45 10 , 1

- 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.
- **srcStride** – Image stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **blurBorder** – If set to 1, border is blurred by 0-padding adjacent values. If set to 0, borders up to half-kernel width are ignored (e.g. 5 pixel in the 11x11 case).

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

    - 3x3 Sobel edge filter

**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: [fcvFilterSobel3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga393bc0b4d34a4c6d7e28c6b6d4e33d56). In the 2.0.0 release, fcvFilterSobel3x3u8\_v2 will be renamed to fcvFilterSobel3x3u8 and the signature of fcvFilterSobel3x3u8 as it appears now, will be removed.

This function calculates an image derivative by convolving the image with an appropriate 3x3 kernel. Border values are ignored. The 3x3 mask convolves with the image area | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **dst** – Output 8-bit image of |dx|+|dy|. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** dst is saturated to 255 **WARNING:** data should be 128-bit aligned.

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

    - 3x3 Sobel edge filter

**ATTENTION:** This function is a duplication of [fcvFilterSobel3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaa45365fca9184bc7f12ca88a172bfd77) 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: *fcvFilterSobel3x3u8*, *fcvFilterSobel3x3u8\_v2* will be removed, and the current signature for *fcvFilterSobel3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterSobel3x3u8* when transitioning to 2.0.0.

This function calculates an image derivative by convolving the image with an appropriate 3x3 kernel. Border values are ignored. The 3x3 mask convolves with the image area | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image of |dx|+|dy|. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** dst is saturated to 255 **WARNING:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as dstWidth if not 0.

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

    - Canny edge filter.

**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: [fcvFilterCanny3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gabc2c418ad55dc24dec192e1d93d45397). In the 2.0.0 release, fcvFilterCanny3x3u8\_v2 will be renamed to fcvFilterCanny3x3u8 and the signature of fcvFilterCanny3x3u8 as it appears now, will be removed.

Canny edge detector applied to a 8 bit grayscale image. The min threshold is set to 0 and the max threshold is set to 15. The aperture size used is set to 3. This function will output the edge, since its working with a 3x3 window, it leaves one row/col of pixels at the corners map stored as a binarized image (0x0 - not an edge, 0xFF - edge). | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **dst** – Output 8-bit image containing the edge detection results. Size of buffer is srcWidth\*srcHeight bytes.
- **lowThresh** – For all the intermediate pixels along the edge, the magnitude of the gradient at the pixel locations should be greater than ‘low’ (sqrt(gx^2 + gy^2) &gt; low, where gx and gy are X and Y gradient)
- **highThresh** – For an edge starting point, i.e. either the first or last pixel of the edge, the magnitude of the gradient at the pixel should be greater than ‘high’ (sqrt(gx^2 + gy^2) &gt; high, where gx and gy are X and Y gradient).

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

    - Canny edge filter.

**ATTENTION:** This function is a duplication of [fcvFilterCanny3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gab3362782c0ddd9a0f6123767c317d90b) 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: *fcvFilterCanny3x3u8*, *fcvFilterCanny3x3u8\_v2* will be removed, and the current signature for *fcvFilterCanny3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCanny3x3u8* when transitioning to 2.0.0.

Canny edge detector applied to a 8 bit grayscale image. The Canny edge detector uses min/max threshold to classify an edge. The min threshold is set to 0 and the max threshold is set to 15. The aperture size used in the Canny edge detector will be same as the filter footprint in the Sobel edge detector and is set to 3. This function will output the edge map stored as a binarized image (0x0 - not an edge, 0xFF - edge), since it works with 3x3 windows, it leaves 1 row/col of pixels at the corners. | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image containing the edge detection results. Size of buffer is dstStride\*srcHeight bytes.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **lowThresh** – For all the intermediate pixels along the edge, the magnitude of the gradient at the pixel locations should be greater than ‘low’ (sqrt(gx^2 + gy^2) &gt; low, where gx and gy are X and Y gradient)
- **highThresh** – For an edge starting point, i.e. either the first or last pixel of the edge, the magnitude of the gradient at the pixel should be greater than ‘high’ (sqrt(gx^2 + gy^2) &gt; high, where gx and gy are X and Y gradient).

- FASTCV\_API void fcvFilterCanny3x3u8\_v3(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*\_\_restrict dst, unsigned int dstStride, int16\_t \*\_\_restrict gx, int16\_t \*\_\_restrict gy, unsigned int gradStride, int lowThresh, int highThresh)

    - Canny edge filter.

**ATTENTION:** This function is in the extension lib. **ATTENTION:** This function is a duplication of [fcvFilterCanny3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gab3362782c0ddd9a0f6123767c317d90b) 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: *fcvFilterCanny3x3u8*, *fcvFilterCanny3x3u8\_v3* will be removed, and the current signature for *fcvFilterCanny3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCanny3x3u8* when transitioning to 2.0.0.

Canny edge detector applied to a 8 bit grayscale image. The Canny edge detector uses min/max threshold to classify an edge. The min threshold is set to 0 and the max threshold is set to 15. The aperture size used in the Canny edge detector will be same as the filter footprint in the Sobel edge detector and is set to 3. This function will output the edge map stored as a binarized image (0x0 - not an edge, 0xFF - edge), since it works with 3x3 windows, it leaves 1 row/col of pixels at the corners. | a(1,1) , a12, …, a(1,srcWidth-2) |

| … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image containing the edge detection results. Size of buffer is dstStride\*srcHeight bytes.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gx** – gradient in X direction. **NOTE:** use NULL if do not need the gradient output.
- **gy** – gradient in Y direction. **NOTE:** use NULL if do not need the gradient output.
- **gradStride** – Output stride for gx and gy. **NOTE:** if 0, dstStride is set as srcWidth\*2. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **lowThresh** – For all the intermediate pixels along the edge, the magnitude of the gradient at the pixel locations should be greater than ‘low’ (sqrt(gx^2 + gy^2) &gt; low, where gx and gy are X and Y gradient)
- **highThresh** – For an edge starting point, i.e. either the first or last pixel of the edge, the magnitude of the gradient at the pixel should be greater than ‘high’ (sqrt(gx^2 + gy^2) &gt; high, where gx and gy are X and Y gradient).

- FASTCV\_API void fcvImageDiffu8(const uint8\_t \*\_\_restrict src1, const uint8\_t \*\_\_restrict src2, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*\_\_restrict dst)

    - Performs image difference by subracting src2 from src1. dst=src1-src2.

**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: [fcvImageDiffu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gac24a56315459724e7e56a11a093a0986). In the 2.0.0 release, fcvImageDiffu8\_v2 will be renamed to fcvImageDiffu8 and the signature of fcvImageDiffu8 as it appears now, will be removed.

dst[i,j] = (uint8\_t) max( min((short)(src1[i,j]-src2[i,j]), 255), 0 );

- Parameters:

    - - **src1** – First source image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **src2** – Second source image, must be same size as src1. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be a multiple of 8.
- **srcHeight** – Image height.
- **dst** – Destination. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** Must be same size as src1 and src2. **WARNING:** should be 128-bit aligned.

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

    - Performs image difference by subracting src2 from src1. dst=src1-src2.

**ATTENTION:** This function is a duplication of [fcvImageDiffu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga10f999c1113b7d05ea478b338df7a05b) 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: *fcvImageDiffu8*, *fcvImageDiffu8\_v2* will be removed, and the current signature for *fcvImageDiffu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageDiffu8* when transitioning to 2.0.0.

dst[i,j] = (uint8\_t) max( min((short)(src1[i,j]-src2[i,j]), 255), 0 );

- Parameters:

    - - **src1** – First source image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **src2** – Second source image, must be same size as src1. **WARNING:** 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., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Destination. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** Must be same size as src1 and src2. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as dstWidth if not 0.

- FASTCV\_API void fcvImageDiffs16(const int16\_t \*\_\_restrict src1, const int16\_t \*\_\_restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict dst, unsigned int dstStride)

    - Compute image difference src1-src2.

- Parameters:

    - - **src1** – Input image1 of int16 type. Size of buffer is srcStride\*srcHeight\*2 bytes. **WARNING:** should be 128-bit aligned.
- **src2** – Input image2, must have same size as src1 **WARNING:** should be 128-bit aligned.
- **srcWidth** – Input image width **WARNING:** should be multiple of 8
- **srcHeight** – Input image height
- **srcStride** – Stride of input image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output image, saturated for int16 type. Size of buffer is dstStride\*srcHeight\*2 bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- FASTCV\_API void fcvImageDifff32(const float \*\_\_restrict src1, const float \*\_\_restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict dst, unsigned int dstStride)

    - Performs image difference by subracting src2 from src1. dst=src1-src2.

- Parameters:

    - - **src1** – First source image. Size of buffer is srcStride\*srcHeight\*4 bytes. **WARNING:** should be 128-bit aligned.
- **src2** – Second source image, must be same size as src1. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Stride of input image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Destination. Size of buffer is dstStride\*srcHeight\*4 bytes. **NOTE:** Must be same size as src1 and src2. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- FASTCV\_API void fcvImageDiffu8f32(const uint8\_t \*\_\_restrict src1, const uint8\_t \*\_\_restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict dst, unsigned int dstStride)

    - Performs image difference by promoting both src1 and src 2 to floating point values and then subracting src2 from src1. dst=src1-src2.

- Parameters:

    - - **src1** – First source image
- **src2** – Second source image, must be same size as src1.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Stride of input image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **WARNING:** should be multiple of 8.
- **dst** – Destination image in float type **NOTE:** Must be same size as src1 and src2. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **WARNING:** should be multiple of 8.

- FASTCV\_API void fcvImageDiffu8s8(const uint8\_t \*\_\_restrict src1, const uint8\_t \*\_\_restrict src2, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int8\_t \*\_\_restrict dst, unsigned int dstStride)

    - Performs image difference by subracting src2 from src1. dst = ( src1 &gt;&gt; 1) - ( src2 &gt;&gt; 1).

- Parameters:

    - - **src1** – First source image
- **src2** – Second source image, must be same size as src1.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Stride of input image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **WARNING:** should be multiple of 8.
- **dst** – Destination image in int8 type **NOTE:** Must be same size as src1 and src2. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **WARNING:** should be multiple of 8.

- FASTCV\_API void fcvImageGradientInterleaveds16(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict gradients)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**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: [fcvImageGradientInterleaveds16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gacc29a3da7cd1a46397dd354d31a9c679). In the 2.0.0 release, fcvImageGradientInterleaveds16\_v2 will be renamed to fcvImageGradientInterleaveds16 and the signature of fcvImageGradientInterleaveds16 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gradients** – Buffer to store gradient. Must be 2\*(width-1)\*(height-1) in size.

- FASTCV\_API void fcvImageGradientInterleaveds16\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict gradients, unsigned int gradStride)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**ATTENTION:** This function is a duplication of [fcvImageGradientInterleaveds16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gadfdde5ebafca13427b8ccf170a84ed2b) 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: *fcvImageGradientInterleaveds16*, *fcvImageGradientInterleaveds16\_v2* will be removed, and the current signature for *fcvImageGradientInterleaveds16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientInterleaveds16* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gradients** – Buffer to store gradient. Must be 2\*(width-1)\*(height-1) in size.
- **gradStride** – Stride in bytes of the interleaved gradients array. **NOTE:** if 0, srcStride is set as 4\*(srcWidth-2). **WARNING:** should be multiple of 16 ( 8 \* 2-byte values ), and at least as much as 4\*(srcWidth-2) if not 0.

- FASTCV\_API void fcvImageGradientInterleavedf32(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict gradients)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**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: [fcvImageGradientInterleavedf32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gab7c2319854723ab38ba5bdbc7a7dc9a7). In the 2.0.0 release, fcvImageGradientInterleavedf32\_v2 will be renamed to fcvImageGradientInterleavedf32 and the signature of fcvImageGradientInterleavedf32 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2).
- **gradients** – Buffer to store gradient. Must be 2\*(width-1)\*(height-1) in size. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientInterleavedf32\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict gradients, unsigned int gradStride)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**ATTENTION:** This function is a duplication of [fcvImageGradientInterleavedf32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga511b0b6903157abc6e7c3ce0058ca47b) 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: *fcvImageGradientInterleavedf32*, *fcvImageGradientInterleavedf32\_v2* will be removed, and the current signature for *fcvImageGradientInterleavedf32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientInterleavedf32* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gradients** – Buffer to store gradient. Must be 2\*(width-1)\*(height-1) in size. **NOTE:** data should be 128-bit aligned.
- **gradStride** – Stride (in bytes) of the interleaved gradients array. **NOTE:** if 0, srcStride is set as (srcWidth-2)\*2\*sizeof(float). **WARNING:** should be multiple of 32 ( 8 \* 4-byte values ), and at least as much as 8 \* srcWidth if not 0.

- FASTCV\_API void fcvImageGradientPlanars16(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**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: [fcvImageGradientPlanars16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga97c5f1b5143808009b313302ce9bd29b). In the 2.0.0 release, fcvImageGradientPlanars16\_v2 will be renamed to fcvImageGradientPlanars16 and the signature of fcvImageGradientPlanars16 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2).
- **dx** – Buffer to store horizontal gradient. Must be (srcWidth)\*(srcHeight) in size. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (srcWidth)\*(srcHeight) in size. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientPlanars16\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy, unsigned int dxyStride)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**ATTENTION:** This function is a duplication of [fcvImageGradientPlanars16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga8bd0b92f81ac2df27b79831289df10b5) 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: *fcvImageGradientPlanars16*, *fcvImageGradientPlanars16\_v2* will be removed, and the current signature for *fcvImageGradientPlanars16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientPlanars16* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dx** – Buffer to store horizontal gradient. Must be (srcWidth)\*(srcHeight) in size. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (srcWidth)\*(srcHeight) in size. **NOTE:** data should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ arrays. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 16 (8 \* 2-bytes per gradient value), and at least as much as srcWidth if not 0.

- FASTCV\_API void fcvImageGradientPlanarf32(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict dx, float \*\_\_restrict dy)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**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: [fcvImageGradientPlanarf32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga9c4784b8aa7370341ad5987f1bf27495). In the 2.0.0 release, fcvImageGradientPlanarf32\_v2 will be renamed to fcvImageGradientPlanarf32 and the signature of fcvImageGradientPlanarf32 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth.
- **dx** – Buffer to store horizontal gradient. Must be (width)\*(height) in size. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (width)\*(height) in size. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientPlanarf32\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict dx, float \*\_\_restrict dy, unsigned int dxyStride)

    - Creates 2D gradient from source illuminance data. This function considers only the left/right neighbors for x-gradients and top/bottom neighbors for y-gradients.

**ATTENTION:** This function is a duplication of [fcvImageGradientPlanarf32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga5bbd9256086c2361d3e58dd1c22b299d) 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: *fcvImageGradientPlanarf32*, *fcvImageGradientPlanarf32\_v2* will be removed, and the current signature for *fcvImageGradientPlanarf32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientPlanarf32* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dx** – Buffer to store horizontal gradient. Must be (srcWidth)\*(srcHeight) in size. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (srcWidth)\*(srcHeight) in size. **NOTE:** data should be 128-bit aligned.
- **dxyStride** – Stride of Gradient values (‘dx’ and ‘dy’ arrays) measured in bytes. **NOTE:** if 0, srcStride is set as 4\*srcWidth. **WARNING:** should be multiple of 32 (8 \* 4-bytes per gradient value), and at least as much as 4\*srcWidth if not 0.

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

    - 3x3 correlation with non-separable 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: [fcvFilterCorr3x3s8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaff6be27949295f2383beba10da3dc663). In the 2.0.0 release, fcvFilterCorr3x3s8\_v2 will be renamed to fcvFilterCorr3x3s8 and the signature of fcvFilterCorr3x3s8 as it appears now, will be removed.

- Parameters:

    - - **kernel** – 2-D 3x3 kernel. **NOTE:** Normalized to Q4.4
- **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** must be an even number
- **srcHeight** – Image height. **NOTE:** must be an even number
- **dst** – Output convolution. Border values are ignored in this function. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.

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

    - 3x3 correlation with non-separable kernel.

**ATTENTION:** This function is a duplication of [fcvFilterCorr3x3s8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga93a9c58507656784979053fd015aa71a) 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: *fcvFilterCorr3x3s8*, *fcvFilterCorr3x3s8\_v2* will be removed, and the current signature for *fcvFilterCorr3x3s8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCorr3x3s8* when transitioning to 2.0.0.

- Parameters:

    - - **kernel** – 2-D 3x3 kernel. **NOTE:** Normalized to Q4.4
- **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** must be an even number
- **srcHeight** – Image height. **NOTE:** must be an even number
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output convolution. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride. Border values are ignored in this function. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFilterCorrNxNu8f32(const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict kernel, uint32\_t N, 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)

    - NxN correlation with non-separable kernel. Border values are ignored in this function. The filling of dst starts at (N/2,N/2) and ends at (srcWidth-1-N/2,srcHeight-1-N/2). **NOTE:** The border is N/2 wide pixel strips at top, bottom, left and right of image.

- Parameters:

    - - **kernel** – 2-D NxN kernel of float32\_t.
- **N** – Dimension of kernel.
- **src** – Input image of unit8\_t. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Src image stride, 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. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output correlation. Size of buffer is dstStride\*srcHeight\*sizeof(float32\_t) bytes. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride, 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 srcWidth\*sizeof(float32\_t). **WARNING:** should be multiple of 8, and at least as much as srcWidth\*sizeof(float32\_t) if not 0.

- 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) fcvFilterCorrNxNu8s16(const int8\_t \*\_\_restrict kernel, uint32\_t N, int8\_t shift, const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride)

    - NxN correlation with non-separable kernel. Border values are ignored in this function. The filling of dst starts at (N/2,N/2) and ends at (srcWidth-1-N/2,srcHeight-1-N/2). **NOTE:** The border is N/2 wide pixel strips at top, bottom, left and right of image.

- Parameters:

    - - **kernel** – 2-D NxN kernel of int8\_t.
- **N** – Dimension of kernel.
- **shift** – The right shift count used to normalize output. Shift can be considered as Q factor of kernel.
- **src** – Input image of unit8\_t. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Src image stride, 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. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output correlation. Size of buffer is dstStride\*srcHeight\*sizeof(int16\_t) bytes. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride, 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 srcWidth\*sizeof(int16\_t). **WARNING:** should be multiple of 8, and at least as much as srcWidth\*sizeof(int16\_t) if not 0.

- 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) fcvFilterCorrNxNu8(const int8\_t \*\_\_restrict kernel, uint32\_t N, int8\_t shift, const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - NxN correlation with non-separable kernel. Border values are ignored in this function. The filling of dst starts at (N/2,N/2) and ends at (srcWidth-1-N/2,srcHeight-1-N/2). **NOTE:** The border is N/2 wide pixel strips at top, bottom, left and right of image.

- Parameters:

    - - **kernel** – 2-D NxN kernel of int8\_t.
- **N** – Dimension of kernel.
- **shift** – The right shift count used to normalize output. Shift can be considered as Q factor of kernel.
- **src** – Input image of unit8\_t. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Src image stride, 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. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output correlation. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride, 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 srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- Returns:

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

- FASTCV\_API void fcvFilterCorrSep9x9s16(const int16\_t \*\_\_restrict kernel, const int16\_t \*src, unsigned int srcWidth, unsigned int srcHeight, int16\_t \*\_\_restrict tmp, int16\_t \*dst)

    - 9x9 correlation with separable kernel. If src and dst point to the same address, it will do in-place.

**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: [fcvFilterCorrSep9x9s16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gab7c2f5fc8fc3b1fa72e8ea79815411ff). In the 2.0.0 release, fcvFilterCorrSep9x9s16\_v2 will be renamed to fcvFilterCorrSep9x9s16 and the signature of fcvFilterCorrSep9x9s16 as it appears now, will be removed.

- Parameters:

    - - **kernel** – 1-D kernel in Q15. **WARNING:** should be 128-bit aligned.
- **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image height.
- **tmp** – Temporary image buffer used internally. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dst** – Output correlation. Border values are ignored in this function. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** Must be same size as src **WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcvFilterCorrSep9x9s16\_v2(const int16\_t \*\_\_restrict kernel, const int16\_t \*srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict tmpImg, int16\_t \*dstImg, unsigned int dstStride)

    - 9x9 FIR filter (convolution) with seperable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

**ATTENTION:** This function is a duplication of [fcvFilterCorrSep9x9s16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga8fc8ea7e4ce3a9455384a45dba667b73) 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: *fcvFilterCorrSep9x9s16*, *fcvFilterCorrSep9x9s16\_v2* will be removed, and the current signature for *fcvFilterCorrSep9x9s16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCorrSep9x9s16* when transitioning to 2.0.0.

- Parameters:

    - - **kernel** – 1-D kernel.
- **srcImg** – Input image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image tile width.
- **srcHeight** – Image tile height.
- **srcStride** – source Image width
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Size = width \* ( height + knlSize - 1 ) **NOTE:** data should be 128-bit aligned
- **dstImg** – Output correlation. Border values are ignored in this function. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** Size = width \* heigth **NOTE:** data should be 128-bit aligned
- **dstStride** – dst Image width

- FASTCV\_API void fcvFilterCorrSep11x11s16(const int16\_t \*\_\_restrict kernel, const int16\_t \*src, unsigned int srcWidth, unsigned int srcHeight, int16\_t \*\_\_restrict tmpImg, int16\_t \*dst)

    - 11x11 correlation with separable kernel. If src and dst point to the same address, it will do in-place.

**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: [fcvFilterCorrSep11x11s16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaf42b8e352ed96b6fd353bb899a93d16a). In the 2.0.0 release, fcvFilterCorrSep11x11s16\_v2 will be renamed to fcvFilterCorrSep11x11s16 and the signature of fcvFilterCorrSep11x11s16 as it appears now, will be removed.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** array must be &gt;=12 elements with kernel[11]=0 **WARNING:** should be 128-bit aligned. **NOTE:** Normalized to Q1.15
- **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image height.
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dst** – Output correlation. Border values are ignored in this function. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcvFilterCorrSep11x11s16\_v2(const int16\_t \*\_\_restrict kernel, const int16\_t \*srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict tmpImg, int16\_t \*dstImg, unsigned int dstStride)

    - 11x11 FIR filter (convolution) with seperable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

**ATTENTION:** This function is a duplication of [fcvFilterCorrSep11x11s16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gad32a64104a251f3141065a32f90ca204) 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: *fcvFilterCorrSep11x11s16*, *fcvFilterCorrSep11x11s16\_v2* will be removed, and the current signature for *fcvFilterCorrSep11x11s16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCorrSep11x11s16* when transitioning to 2.0.0.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** data should be 128-bit aligned
- **srcImg** – Input image. Size of buffer is srStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image tile width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image tile height.
- **srcStride** – source Image width
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Size = width \* ( height + knlSize - 1 ) **NOTE:** data should be 128-bit aligned
- **dstImg** – Output correlation. Border values are ignored in this function. **NOTE:** Size = dstStride \* srcHeigth **NOTE:** data should be 128-bit aligned
- **dstStride** – dst Image width

- FASTCV\_API void fcvFilterCorrSep13x13s16(const int16\_t \*\_\_restrict kernel, const int16\_t \*src, unsigned int srcWidth, unsigned int srcHeight, int16\_t \*\_\_restrict tmpImg, int16\_t \*dst)

    - 13x13 correlation with separable kernel. If src and dst point to the same address, it will do in-place.

**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: [fcvFilterCorrSep13x13s16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaf71f7a8539f24d6bbc2372080dc7ac6b). In the 2.0.0 release, fcvFilterCorrSep13x13s16\_v2 will be renamed to fcvFilterCorrSep13x13s16 and the signature of fcvFilterCorrSep13x13s16 as it appears now, will be removed.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** Normalized to Q1.15 **WARNING:** should be 128-bit aligned.
- **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image height.
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dst** – Output correlation. Border values are ignored in this function. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcvFilterCorrSep13x13s16\_v2(const int16\_t \*\_\_restrict kernel, const int16\_t \*srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict tmpImg, int16\_t \*dstImg, unsigned int dstStride)

    - 13x13 FIR filter (convolution) with seperable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

**ATTENTION:** This function is a duplication of [fcvFilterCorrSep13x13s16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7a459aad57544b408a60186813d2226a) 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: *fcvFilterCorrSep13x13s16*, *fcvFilterCorrSep13x13s16\_v2* will be removed, and the current signature for *fcvFilterCorrSep13x13s16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCorrSep13x13s16* when transitioning to 2.0.0.

- Parameters:

    - - **kernel** – 1-D kernel. **WARNING:** should be 128-bit aligned.
- **srcImg** – Input image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image tile width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image tile height.
- **srcStride** – source Image width
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Size = width \* ( height + knlSize - 1 ) **NOTE:** data should be 128-bit aligned
- **dstImg** – Output correlation. Border values are ignored in this function. **NOTE:** Size = dstStride \* srcHeigth **NOTE:** data should be 128-bit aligned
- **dstStride** – dst Image width

- FASTCV\_API void fcvFilterCorrSep15x15s16(const int16\_t \*\_\_restrict kernel, const int16\_t \*src, unsigned int srcWidth, unsigned int srcHeight, int16\_t \*\_\_restrict tmpImg, int16\_t \*dst)

    - 15x15 correlation with separable kernel. If src and dst point to the same address, it will do in-place.

**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: [fcvFilterCorrSep15x15s16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7e334c3e1cd1d0309c029efb6694dd50). In the 2.0.0 release, fcvFilterCorrSep15x15s16\_v2 will be renamed to fcvFilterCorrSep15x15s16 and the signature of fcvFilterCorrSep15x15s16 as it appears now, will be removed.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** array must be 16 elements with kernel[15]=0 **NOTE:** Normalized to Q1.15 **NOTE:** data should be 128-bit aligned
- **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image height.
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Must be same size as src **NOTE:** data should be 128-bit aligned
- **dst** – Output correlation. Border values are ignored in this function. **NOTE:** Must be same size as src **NOTE:** data should be 128-bit aligned

- FASTCV\_API void fcvFilterCorrSep15x15s16\_v2(const int16\_t \*\_\_restrict kernel, const int16\_t \*srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict tmpImg, int16\_t \*dstImg, unsigned int dstStride)

    - 15x15 FIR filter (convolution) with seperable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

**ATTENTION:** This function is a duplication of [fcvFilterCorrSep15x15s16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7ce6b0f7e300b16a3dc33c053f7d7584) 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: *fcvFilterCorrSep15x15s16*, *fcvFilterCorrSep15x15s16\_v2* will be removed, and the current signature for *fcvFilterCorrSep15x15s16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCorrSep15x15s16* when transitioning to 2.0.0.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** array must be 16 elements with kernel[15]=0 **NOTE:** Normalized to Q1.15 **NOTE:** data should be 128-bit aligned
- **srcImg** – Input image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image tile width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image tile height.
- **srcStride** – source Image width
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Size = width \* ( height + knlSize - 1 ) **NOTE:** data should be 128-bit aligned
- **dstImg** – Output correlation. Border values are ignored in this function. **NOTE:** Size = dstStride \* srcHeigth **NOTE:** data should be 128-bit aligned
- **dstStride** – dst Image width

- FASTCV\_API void fcvFilterCorrSep17x17s16(const int16\_t \*\_\_restrict kernel, const int16\_t \*src, unsigned int srcWidth, unsigned int srcHeight, int16\_t \*\_\_restrict tmpImg, int16\_t \*dst)

    - 17x17 correlation with separable kernel. If src and dst point to the same address, it will do in-place.

**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: [fcvFilterCorrSep17x17s16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga135d5e35568c7e04b3c37c5c719cb273). In the 2.0.0 release, fcvFilterCorrSep17x17s16\_v2 will be renamed to fcvFilterCorrSep17x17s16 and the signature of fcvFilterCorrSep17x17s16 as it appears now, will be removed.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** Normalized to Q1.15 **WARNING:** should be 128-bit aligned.
- **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8. **WARNING:** must be &gt; 8.
- **srcHeight** – Image height.
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.
- **dst** – Output correlation.. Border values are ignored in this function. **NOTE:** Must be same size as src **WARNING:** should be 128-bit aligned.

- FASTCV\_API void fcvFilterCorrSep17x17s16\_v2(const int16\_t \*\_\_restrict kernel, const int16\_t \*srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict tmpImg, int16\_t \*dstImg, unsigned int dstStride)

    - 17x17 FIR filter (convolution) with seperable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

**ATTENTION:** This function is a duplication of [fcvFilterCorrSep17x17s16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga012d98674cb68a55160fa6e2baa08e9c) 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: *fcvFilterCorrSep17x17s16*, *fcvFilterCorrSep17x17s16\_v2* will be removed, and the current signature for *fcvFilterCorrSep17x17s16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterCorrSep17x17s16* when transitioning to 2.0.0.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** data should be 128-bit aligned
- **srcImg** – Input image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image tile width.
- **srcHeight** – Image tile height.
- **srcStride** – source Image width
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Size = width \* ( height + knlSize - 1 ) **NOTE:** data should be 128-bit aligned
- **dstImg** – Output correlation. Border values are ignored in this function. **NOTE:** Size = dstStride \* srcHeigth **NOTE:** data should be 128-bit aligned
- **dstStride** – dst Image width

- FASTCV\_API void fcvFilterCorrSepNxNs16(const int16\_t \*\_\_restrict kernel, int knlSize, const int16\_t \*srcImg, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict tmpImg, int16\_t \*dstImg, unsigned int dstStride)

    - NxN correlation with separable kernel. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

- Parameters:

    - - **kernel** – 1-D kernel. **NOTE:** data should be 128-bit aligned
- **knlSize** – Seperable kernel size.
- **srcImg** – Input image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image tile width.
- **srcHeight** – Image tile height.
- **srcStride** – source Image width
- **tmpImg** – Temporary image scratch space used internally. **NOTE:** Size = width \* ( height + knlSize - 1 ) **NOTE:** data should be 128-bit aligned
- **dstImg** – Output correlation. Border values are ignored in this function. **NOTE:** Size = dstStride \* srcHeigth **NOTE:** data should be 128-bit aligned
- **dstStride** – dst Image width

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFilterCorrSepMxNu8(const int8\_t \*kernelX, uint32\_t knlSizeX, const int8\_t \*kernelY, uint32\_t knlSizeY, int8\_t shift, const uint8\_t \*srcImg, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*dstImg, uint32\_t dstStride)

    - MxN correlation with separable kernel.

- Parameters:

    - - **kernelX** – 1-D kernel of int8\_t. The kernel is first applied to rows. kernelX has Q factor equal to shift. **NOTE:** data should be 128-bit aligned
- **knlSizeX** – Seperable kernel size of kernelX. **NOTE:** kenrelX must be &lt;= 32.
- **kernelY** – 1-D kernel of int8\_t. The kernel is applied to columns after kernelX is applied. It could be the same buffer as kernelX which makes it a NxN symetric kernel. kernelY has Q factor equal to shift. **NOTE:** data should be 128-bit aligned
- **knlSizeY** – Seperable kernel size of kernelY.
- **shift** – The Q factor of kernels. Output is right-shifted by 2\*shift to compensate for two rounds of filtering
- **srcImg** – Input image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Src image stride, 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. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dstImg** – Output correlation. Can do in-place filtering (i.e. dstImg=srcImg). **NOTE:** Size = dstStride \* srcHeigth **NOTE:** data should be 128-bit aligned
- **dstStride** – Output stride, 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 srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- Returns:

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

- FASTCV\_API void fcvImageIntensityStats(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, int xBegin, int yBegin, unsigned int recWidth, unsigned int recHeight, float \*mean, float \*variance)

    - Calculates the mean and variance of intensities of a rectangle in a grayscale image.

**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: [fcvImageIntensityStats\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7ec151a4553d512d5727a0f1e18dd4c9). In the 2.0.0 release, fcvImageIntensityStats\_v2 will be renamed to fcvImageIntensityStats and the signature of fcvImageIntensityStats as it appears now, will be removed. This API is the same as fcvImageIntensityStats\_v2 with FASTCV\_UNBIASED\_VARIANCE\_ESTIMATOR

- Parameters:

    - - **src** – pointer to 8-bit grayscale image **WARNING:** should be 128-bit aligned.
- **srcWidth** – Width of source image **WARNING:** should be multiple of 8.
- **xBegin** – x coordinate of top left of rectangle
- **yBegin** – y coordinate of top left of rectangle
- **recWidth** – width of rectangular region
- **recHeight** – height of rectangular region
- **mean** – output of mean of region
- **variance** – output of variance of region

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvImageIntensityStats\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, int xBegin, int yBegin, uint32\_t recWidth, uint32\_t recHeight, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*mean, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*variance, [fcvVarianceEstimator](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a78c8aef43cd5403432de083ecd119132.html#_CPPv420fcvVarianceEstimator) varianceEstimator)

    - Calculates the mean and variance of intensities of a rectangle in a grayscale image.

- Parameters:

    - - **src** – pointer to 8-bit grayscale image **WARNING:** should be 128-bit aligned.
- **srcWidth** – Width of source image **WARNING:** should be multiple of 8.
- **xBegin** – x coordinate of top left of rectangle
- **yBegin** – y coordinate of top left of rectangle
- **recWidth** – width of rectangular region
- **recHeight** – height of rectangular region
- **mean** – output of mean of region
- **variance** – output of variance of region
- **varianceEstimator** – variance estimator

- FASTCV\_API void fcvImageIntensityHistogram(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, int xBegin, int yBegin, unsigned int recWidth, unsigned int recHeight, int32\_t \*histogram)

    - Creates a histogram of intensities for a rectangular region of a grayscale image. Bins each pixel into a histogram of size 256, depending on the intensity of the pixel (in the range 0 to 255).

- Parameters:

    - - **src** – pointer to 8-bit grayscale image **WARNING:** should be 128-bit aligned.
- **srcWidth** – Width of source image **WARNING:** should be multiple of 8.
- **xBegin** – x coordinate of top left of rectangle
- **yBegin** – y coordinate of top left of rectangle
- **recWidth** – Width of rectangular region
- **recHeight** – Height of rectangular region
- **histogram** – Array of size 256 for storing the histogram **WARNING:** should be 128-bit aligned.

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

    - Builds an integral image of the incoming 8-bit image and adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**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: [fcvIntegratePatchu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga67d775c2eac860f71210a397b80251d9). In the 2.0.0 release, fcvIntegratePatchu8\_v2 will be renamed to fcvIntegratePatchu8 and the signature of fcvIntegratePatchu8 as it appears now, will be removed.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input 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. **NOTE:** height must be &lt;= 2048
- **dst** – Output integral-image. Should point to a memory of size (width+1)\*(height+1). Zero borders for 1st column. **WARNING:** should be 128-bit aligned.

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

    - Builds an integral image of the incoming 8-bit image and adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**ATTENTION:** This function is a duplication of [fcvIntegrateImageu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gae057b26c2178afb28fa43ac8458327dd) 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: *fcvIntegrateImageu8*, *fcvIntegrateImageu8\_v2* will be removed, and the current signature for *fcvIntegrateImageu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvIntegrateImageu8* when transitioning to 2.0.0.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height. **NOTE:** height must be &lt;= 2048
- **srcStride** – Stride (in bytes) of the image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **WARNING:** should be multiple of 8.
- **dst** – Output integral-image. Should point to a memory of size at least (width+1)\*(height+1). Zero borders for 1st column. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride (in bytes) of integral image. **WARNING:** should be multiple of 32 (8 \* 4-byte values).

- FASTCV\_API void fcvIntegratePatchu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, int patchX, int patchY, unsigned int patchW, unsigned int patchH, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t \*\_\_restrict intgrlSqrdImgOut)

    - Builds an integral image of the incoming 8-bit patch values and their squares and adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**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: [fcvIntegratePatchu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga67d775c2eac860f71210a397b80251d9). In the 2.0.0 release, fcvIntegratePatchu8\_v2 will be renamed to fcvIntegratePatchu8 and the signature of fcvIntegratePatchu8 as it appears now, will be removed.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input 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. **WARNING:** height must be &lt;= 2048
- **patchX** – Patch location on image of upper-left patch corner.
- **patchY** – Patch location on image of upper-left patch corner.
- **patchW** – Patch width.
- **patchH** – Patch height.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (patchW+1)(patchH+1)
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (patchW+1)(patchH+1)

- FASTCV\_API void fcvIntegratePatchu8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int patchX, int patchY, unsigned int patchW, unsigned int patchH, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t \*\_\_restrict intgrlSqrdImgOut)

    - Builds an integral image of the incoming 8-bit patch values and their squares and adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**ATTENTION:** This function is a duplication of [fcvIntegratePatchu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaf518bbfef469db6666fdd6bf0f83045c) 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: *fcvIntegratePatchu8*, *fcvIntegratePatchu8\_v2* will be removed, and the current signature for *fcvIntegratePatchu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvIntegratePatchu8* when transitioning to 2.0.0.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height. **WARNING:** height must be &lt;= 2048
- **srcStride** – Image stride (in bytes). **WARNING:** should be multiple of 8 (8 \* 1-byte values).
- **patchX** – Patch location on image of upper-left patch corner.
- **patchY** – Patch location on image of upper-left patch corner.
- **patchW** – Patch width. **WARNING:** (patchW \* patchH) should be less than 66051, to avoid overflow.
- **patchH** – Patch height. **WARNING:** (patchW \* patchH) should be less than 66051, to avoid overflow.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (patchW+1)(patchH+1)
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (patchW+1)(patchH+1)

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvIntegratePatchu8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t patchX, uint32\_t patchY, uint32\_t patchW, uint32\_t patchH, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t intgrlStride, uint32\_t \*\_\_restrict intgrlSqrdImgOut, uint32\_t intgrlSqrdStride)

    - Builds an integral image of the incoming 8-bit patch values and their squares and adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**ATTENTION:** This function is a duplication of [fcvIntegratePatchu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaf518bbfef469db6666fdd6bf0f83045c) and [fcvIntegratePatchu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga67d775c2eac860f71210a397b80251d9) 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: *fcvIntegratePatchu8*, *fcvIntegratePatchu8\_v2* and fcvIntegratePatchu8\_v3 will be removed, and the current signature for *fcvIntegratePatchu8* and fcvIntegratePatchu8\_v2 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvIntegratePatchu8* when transitioning to 2.0.0.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height. **WARNING:** height must be &lt;= 2048
- **srcStride** – Image stride (in bytes). **WARNING:** should be multiple of 8 .
- **patchX** – X coordinate of upper-left patch corner.
- **patchY** – Y coordinate of upper-left patch corner.
- **patchW** – Patch width. **WARNING:** (patchW \* patchH) should be less than 66051, to avoid overflow.
- **patchH** – Patch height. **WARNING:** (patchW \* patchH) should be less than 66051, to avoid overflow.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (patchW+1)(patchH+1)
- **intgrlStride** – Stride in bytes of the Integral Image **WARNING:** should be multiple of 8.
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (patchW+1)(patchH+1)
- **intgrlSqrdStride** – Stride in bytes of the Squared Integral Image **WARNING:** should be multiple of 8.

- FASTCV\_API void fcvIntegratePatch12x12u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, int patchX, int patchY, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t \*\_\_restrict intgrlSqrdImgOut)

    - Builds an integral image of the incoming 12x12 8-bit patch values and their squares. It also adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**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: [fcvIntegratePatch12x12u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga934f3c8700884c9fbc4a42f36698a4f9). In the 2.0.0 release, fcvIntegratePatch12x12u8\_v2 will be renamed to fcvIntegratePatch12x12u8 and the signature of fcvIntegratePatch12x12u8 as it appears now, will be removed.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input 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.
- **patchX** – Patch location on image of upper-left patch corner.
- **patchY** – Patch location on image of upper-left patch corner.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (12+1)(12+1)
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (12+1)(12+1)

- FASTCV\_API void fcvIntegratePatch12x12u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int patchX, int patchY, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t \*\_\_restrict intgrlSqrdImgOut)

    - Builds an integral image of the incoming 12x12 8-bit patch values and their squares. It also adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**ATTENTION:** This function is a duplication of [fcvIntegratePatch12x12u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7373a0d3d7943b0cbd93802cd8f22f01) 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: *fcvIntegratePatch12x12u8*, *fcvIntegratePatch12x12u8\_v2* will be removed, and the current signature for *fcvIntegratePatch12x12u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvIntegratePatch12x12u8* when transitioning to 2.0.0.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y) **WARNING:** do not use - under construction.

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height.
- **srcStride** – Image stride (in bytes). **WARNING:** should be multiple of 8 (8 \* 1-byte values).
- **patchX** – Patch location on image of upper-left patch corner.
- **patchY** – Patch location on image of upper-left patch corner.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (12+1)(12+1)
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (12+1)(12+1)

- FASTCV\_API void fcvIntegratePatch18x18u8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, int patchX, int patchY, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t \*\_\_restrict intgrlSqrdImgOut)

    - Builds an integral image of the incoming 18x18 8-bit patch values and their squares. It also adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**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: [fcvIntegratePatch18x18u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga819cff51362c5849ca84d1633c67f162). In the 2.0.0 release, fcvIntegratePatch18x18u8\_v2 will be renamed to fcvIntegratePatch18x18u8 and the signature of fcvIntegratePatch18x18u8 as it appears now, will be removed.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input image. Size of buffer is srcWidth\*srcHeight bytes.
- **srcWidth** – Image srcWidth. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height.
- **patchX** – Patch location on image of upper-left patch corner.
- **patchY** – Patch location on image of upper-left patch corner.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (18+1)(18+1)
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (18+1)(18+1)

- FASTCV\_API void fcvIntegratePatch18x18u8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int patchX, int patchY, uint32\_t \*\_\_restrict intgrlImgOut, uint32\_t \*\_\_restrict intgrlSqrdImgOut)

    - Builds an integral image of the incoming 18x18 8-bit patch values and their squares. It also adds an unfilled border on top and to the left.

NOTE: border usually zero filled elsewhere.

**ATTENTION:** This function is a duplication of [fcvIntegratePatch18x18u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga901ccb7d456198f8c2871b7b2a0cc229) 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: *fcvIntegratePatch18x18u8*, *fcvIntegratePatch18x18u8\_v2* will be removed, and the current signature for *fcvIntegratePatch18x18u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvIntegratePatch18x18u8* when transitioning to 2.0.0.

sum (X,Y) = sum\_{x&lt;X,y&lt;Y} I(x,y)

- Parameters:

    - - **src** – Input image. Size of buffer is srStride\*srcHeight bytes.
- **srcWidth** – Image srcWidth. **WARNING:** should be multiple of 8.
- **srcHeight** – Image height.
- **srcStride** – Image stride (in bytes). **WARNING:** should be multiple of 8 (8 \* 1-byte values).
- **patchX** – Patch location on image of upper-left patch corner.
- **patchY** – Patch location on image of upper-left patch corner.
- **intgrlImgOut** – Integral image. Zero borders for 1st column. **NOTE:** Memory must be &gt; (18+1)(18+1)
- **intgrlSqrdImgOut** – Integral image of squared values. **NOTE:** Memory must be &gt; (18+1)(18+1)

- FASTCV\_API void fcvIntegrateImageLineu8(const uint8\_t \*\_\_restrict src, uint16\_t srcWidth, uint32\_t \*intgrl, uint32\_t \*intgrlSqrd)

    - Integrates one line of an image or any portion of an image that is contiguous in memory.

- Parameters:

    - - **src** – Input image. Size of buffer is srcWidth bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** –

    Number of pixels.

    NOTE: bit width enforces numPxls &lt; 2^16
- **intgrl** – Sum of values from specified pixels.
- **intgrlSqrd** – Sum of squared values from specified pixels.

- FASTCV\_API void fcvIntegrateImageLine64u8(const uint8\_t \*\_\_restrict src, uint16\_t \*intgrl, uint32\_t \*intgrlSqrd)

    - Integrates 64 contiguous pixels of an image.

- Parameters:

    - - **src** – Input image. **WARNING:** should be 128-bit aligned.
- **intgrl** – Sum of values from specified pixels.
- **intgrlSqrd** – Sum of squared values from specified pixels.

- FASTCV\_API void fcvFilterThresholdu8(const uint8\_t \*src, unsigned int srcWidth, unsigned int srcHeight, uint8\_t \*dst, unsigned int threshold)

    - Binarizes a grayscale image based on a threshold value.

**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: [fcvFilterThresholdu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gac165a71002287d201f60f7654876ee10). In the 2.0.0 release, fcvFilterThresholdu8\_v2 will be renamed to fcvFilterThresholdu8 and the signature of fcvFilterThresholdu8 as it appears now, will be removed.

Sets the pixel to max(255) if it’s value is greater than the threshold; else, set the pixel to min(0).

- 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 binarized image. Size of buffer is srcWidth\*srcHeight bytes. If src equals to dst, it will do in-place. **WARNING:** should be 128-bit aligned.
- **threshold** – Threshold value for binarization. **WARNING:** must be larger than 0.

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

    - Binarizes a grayscale image based on a threshold value.

**ATTENTION:** This function is a duplication of [fcvFilterThresholdu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gabcd0f7c077d1ce4e9362bf530ffe0657) 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: *fcvFilterThresholdu8*, *fcvFilterThresholdu8\_v2* will be removed, and the current signature for *fcvFilterThresholdu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterThresholdu8* when transitioning to 2.0.0.

Sets the pixel to max(255) if it’s value is greater than the threshold; else, set the pixel to min(0).

- 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
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit binarized image. Size of buffer is dstStride\*srcHeight bytes. If src equals to dst and srcStride equals to dstStride, it will do in-place. **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **threshold** – Threshold value for binarization. **WARNING:** must be larger than 0.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFilterThresholdu8\_v3(const uint8\_t \*src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, uint8\_t \*dst, unsigned int dstStride, unsigned int threshold, uint8\_t trueValue, uint8\_t falseValue)

    - Binarizes a grayscale image based on a threshold value. The binarized image will be in the two values selected by user.

**ATTENTION:** This function is a duplication of [fcvFilterThresholdu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gabcd0f7c077d1ce4e9362bf530ffe0657) 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: *fcvFilterThresholdu8*, *fcvFilterThresholdu8\_v3* will be removed, and the current signature for *fcvFilterThresholdu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterThresholdu8* when transitioning to 2.0.0.

Sets the pixel to max(255) if it’s value is greater than the threshold; else, set the pixel to min(0).

- 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
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit binarized image. Size of buffer is dstStride\*srcHeight bytes. If src equals to dst and srcStride equals to dstStride, it will do in-place. **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values), and at least as much as srcWidth if not 0.
- **threshold** – Threshold value for binarization. **WARNING:** must be larger than 0.
- **trueValue** – The value in type of uint8\_t assigned to the destination pixel if the source is larger than threshold
- **falseValue** – The value in type of uint8\_t assigned to the destination pixel if the source is smaller than or equal to threshold

- 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) fcvFilterThresholdRangeu8(const uint8\_t \*src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*dst, uint32\_t dstStride, uint8\_t lowThresh, uint8\_t highThresh)

    - Binarizes a grayscale image based on a pair of threshold values.

**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: [fcvFilterThresholdRangeu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaed9936157053d65d2e26a19b2118ece4). In the 2.0.0 release, fcvFilterThresholdRangeu8\_v2 will be renamed to fcvFilterThresholdRangeu8 and the signature of fcvFilterThresholdRangeu8 as it appears now, will be removed.

Sets the pixel to min(0) if it’s value is greater than the higher threshold or smaller than the lower threshold; else, set the pixel to max(255).

- 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
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit binarized image. Size of buffer is dstStride\*srcHeight bytes. If src equals to dst and srcStride equals to dstStride, it will do in-place. **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **lowThresh** – The lower threshold value for binarization.
- **highThresh** – The higher threshold value for binarization.

- 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) fcvFilterThresholdRangeu8\_v2(const uint8\_t \*src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*dst, uint32\_t dstStride, uint8\_t lowThresh, uint8\_t highThresh, uint8\_t trueValue, uint8\_t falseValue)

    - Binarizes a grayscale image based on a pair of threshold values. The binarized image will be in the two values selected by user.

**ATTENTION:** This function is a duplication of [fcvFilterThresholdRangeu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga73d923187b23987ad63db7dbb4ca3afb) 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: *fcvFilterThresholdRangeu8*, *fcvFilterThresholdRangeu8\_v2* will be removed, and the current signature for *fcvFilterThresholdRangeu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterThresholdRangeu8* when transitioning to 2.0.0.

Sets the pixel to min(0) if it’s value is greater than the higher threshold or smaller than the lower threshold; else, set the pixel to max(255).

- 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
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit binarized image. Size of buffer is dstStride\*srcHeight bytes. If src equals to dst and srcStride equals to dstStride, it will do in-place. **WARNING:** should be 128-bit aligned.
- **dstStride** – Output stride (in bytes). **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **lowThresh** – The lower threshold value for binarization.
- **highThresh** – The higher threshold value for binarization.
- **trueValue** – The value in type of uint8\_t assigned to the destination pixel if the source is within the range inclusively defined by the pair of threshold values
- **falseValue** – The value in type of uint8\_t assigned to the destination pixel if the source is out of the range defined by the pair of threshold values

- Returns:

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

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

    - Dilate a grayscale image by taking the local maxima of 3x3 neighborhood window.

**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: [fcvFilterDilate3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga6e0eedef0c8a88fce9cacd30e553e54e). In the 2.0.0 release, fcvFilterDilate3x3u8\_v2 will be renamed to fcvFilterDilate3x3u8 and the signature of fcvFilterDilate3x3u8 as it appears now, will be removed.

- 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 dilated image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.

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

    - Dilate a grayscale image by taking the local maxima of 3x3 neighborhood window.

**ATTENTION:** This function is a duplication of [fcvFilterDilate3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gafd8fec2f12045297be17b509a2acce43) 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: *fcvFilterDilate3x3u8*, *fcvFilterDilate3x3u8\_v2* will be removed, and the current signature for *fcvFilterDilate3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterDilate3x3u8* when transitioning to 2.0.0.

- 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.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit dilated image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

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

    - Erode a grayscale image by taking the local minima of 3x3 neighborhood window.

**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: [fcvFilterErode3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga2355e99d55384430a97def022adda77c). In the 2.0.0 release, fcvFilterErode3x3u8\_v2 will be renamed to fcvFilterErode3x3u8 and the signature of fcvFilterErode3x3u8 as it appears now, will be removed.

- 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 eroded image. Size of buffer is srcWidth\*srcHeight bytes. **WARNING:** should be 128-bit aligned.

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

    - Erode a grayscale image by taking the local minima of 3x3 nbhd window.

**ATTENTION:** This function is a duplication of [fcvFilterErode3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga6586afd7fb2c545c12d9ee1ae9f7722a) 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: *fcvFilterErode3x3u8*, *fcvFilterErode3x3u8\_v2* will be removed, and the current signature for *fcvFilterErode3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterErode3x3u8* when transitioning to 2.0.0.

- 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.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit eroded image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- FASTCV\_API void fcvFilterGaussian5x5s16(const int16\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, int16\_t \*\_\_restrict dst, int blurBorder)

    - Blur with 5x5 Gaussian filter.

**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: [fcvFilterGaussian5x5s16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga8141ce6abc7979b36d77422de17628bc). In the 2.0.0 release, fcvFilterGaussian5x5s16\_v2 will be renamed to fcvFilterGaussian5x5s16 and the signature of fcvFilterGaussian5x5s16 as it appears now, will be removed.

Convolution with 5x5 Gaussian kernel:

1 4 6 4 1

4 16 24 16 4

6 24 36 24 6

4 16 24 16 4

1 4 6 4 1

- Parameters:

    - - **src** – Input int data (can be sq. of gradient, etc). **NOTE:** Size of buffer is srcWidth\*srcHeight\*2 bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **dst** – Output int data. Size of buffer is srcWidth\*srcHeight\*2 bytes. **NOTE:** data should be 128-bit aligned.
- **blurBorder** – If set to 0, border is ignored. If set to 1, border is blurred by 0-padding adjacent values.

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

    - Blur with 5x5 Gaussian filter.

**ATTENTION:** This function is a duplication of [fcvFilterGaussian5x5s16()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga4650d68486bac480c75f5a707a28bbdb) 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: *fcvFilterGaussian5x5s16*, *fcvFilterGaussian5x5s16\_v2* will be removed, and the current signature for *fcvFilterGaussian5x5s16* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterGaussian5x5s16* when transitioning to 2.0.0.

Convolution with 5x5 Gaussian kernel:

1 4 6 4 1

4 16 24 16 4

6 24 36 24 6

4 16 24 16 4

1 4 6 4 1

- Parameters:

    - - **src** – Input int data (can be sq. of gradient, etc). Size of buffer is srcStride\*srcHeight\*2 bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Image stride in bytes. **NOTE:** if 0, srcStride is set as srcWidth\*2. **WARNING:** should be multiple of 8, and at least as much as srcWidth\*2 if not 0.
- **dst** – Output int data. 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, and at least as much as srcWidth\*2 if not 0.
- **blurBorder** – If set to 0, border is ignored. If set to 1, border is blurred by 0-padding adjacent values.

- FASTCV\_API void fcvFilterGaussian5x5s32(const int32\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, int32\_t \*\_\_restrict dst, int blurBorder)

    - Blur with 5x5 Gaussian filter.

**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: [fcvFilterGaussian5x5s32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga971cab6ff78cf650357ef928c5c01aaa). In the 2.0.0 release, fcvFilterGaussian5x5s32\_v2 will be renamed to fcvFilterGaussian5x5s32 and the signature of fcvFilterGaussian5x5s32 as it appears now, will be removed.

Convolution with 5x5 Gaussian kernel:

1 4 6 4 1

4 16 24 16 4

6 24 36 24 6

4 16 24 16 4

1 4 6 4 1

- Parameters:

    - - **src** – Input int data (can be sq. of gradient, etc). Size of buffer is srcWidth\*srcHeight\*4 bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **dst** – Output int data. Size of buffer is srcWidth\*srcHeight\*4 bytes. **NOTE:** data should be 128-bit aligned.
- **blurBorder** – If set to 0, border is ignored. If set to 1, border is blurred by 0-padding adjacent values.

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

    - Blur with 5x5 Gaussian filter.

**ATTENTION:** This function is a duplication of [fcvFilterGaussian5x5s32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7dc5a77eb71ebf814920c60feaa8714a) 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: *fcvFilterGaussian5x5s32*, *fcvFilterGaussian5x5s32\_v2* will be removed, and the current signature for *fcvFilterGaussian5x5s32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterGaussian5x5s32* when transitioning to 2.0.0.

Convolution with 5x5 Gaussian kernel:

1 4 6 4 1

4 16 24 16 4

6 24 36 24 6

4 16 24 16 4

1 4 6 4 1

- Parameters:

    - - **src** – Input int data (can be sq. of gradient, etc). Size of buffer is srcStride\*srcHeight\*4 bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Input Image stride in bytes. **NOTE:** if 0, srcStride is set as srcWidth\*sizeof(int32\_t). **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output int data. Size of buffer is dstStride\*srcHeight\*4 bytes. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output Image stride in bytes. **NOTE:** if 0, dstStride is set as srcWidth\*sizeof(int32\_t). **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **blurBorder** – If set to 0, border is ignored. If set to 1, border is blurred by 0-padding adjacent values.

- FASTCV\_API uint32\_t fcvImageSegmentationRegionGrow(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t numChannel, uint32\_t thresholdSplit, uint32\_t thresholdMerge, uint32\_t \*\_\_restrict segLabel, uint32\_t segLabelStride, uint8\_t \*\_\_restrict data)

    - Segments an image (3 or 1 channel) into meaningful regions, depending on the color or gray scale uniformity of the neighborhood pixels.

- Parameters:

    - - **src** – Pointer to 8-bit color (3-channel) or grayscale (1-channel) image.
- **srcWidth** – Width of src image, measured by pixels.
- **srcHeight** – Height of src image, measured by pixels.
- **srcStride** – Stride of src image, measured by bytes. WARNING: should be multiple of 8, and at least as much as srcWidth\*numChannel if not 0.
- **numChannel** – Number of channels of src image. 1 for gray scale and 3 for color image.
- **thresholdSplit** – Threshold for region split. Higher value: larger uniform region segmented. Range of 3-channel image segmentation 20~500: 20~50 for heavy over-segmentation, 50~100 for median over-segmentation, 100~150 for light over-segmentation, 150~250 for normal segmentation, 250~400 for light under-segmentation, 400~500 for heavy under-segmentation. Range of 1-channel image segmentation 3~150: 3~10 for heavy over-segmentation, 10~15 for median over-segmentation, 15~25 for light over-segmentation, 25~50 for normal segmentation, 50~75 for light under-segmentation, 75~150 for heavy under-segmentation.
- **thresholdMerge** – Threshold for region merge, measured by the region area (pixels). Higher value: larger uniform region segmented. Range 10~1000 for VGA size image. Range of 3-channel image segmentation 10~1000: 10~30 for heavy over-segmentation, 30~60 for median over-segmentation, 60~150 for light over-segmentation, 150~400 for normal segmentation, 400~600 for light under-segmentation, 600~1000 for heavy under-segmentation. Same for the 1-channel image. For other image size, please tune the thresholdMerge value proportional to the VGA size.
- **segLabel** – Segmented labels. 1 channel with same size of src. Pixel belonging to the same region is uniformly labeled by a non-zero number.
- **segLabelStride** – Stride of segmented labels, measured by bytes. WARNING: should be multiple of 8, and at least as much as srcWidth\*4 if not 0.
- **data** – data buffer for inner function buffer allocation. The buffer size is recommended below, for 3-channel image: \*data = (uint8\_t \*) malloc ( srcWidth\*srcHeight\*18\*sizeof(uint8\_t) ); for 1-channel image: \*data = (uint8\_t \*) malloc ( srcWidth\*srcHeight\*16\*sizeof(uint8\_t) );

- Returns:

    - 0 if successful.

- FASTCV\_API int fcvPyramidCreatef32(const float \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int numLevels, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*pyramid)

    - Builds an image pyramid of float32 arising from a single original image - that are successively downscaled w.r.t. the pre-set levels. **NOTE:** Memory should be deallocated using fcvPyramidDelete.

**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: [fcvPyramidCreatef32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga0dbab3e013cba2e6c6a6f806e2184f7c). In the 2.0.0 release, fcvPyramidCreatef32\_v2 will be renamed to fcvPyramidCreatef32 and the signature of fcvPyramidCreatef32 as it appears now, will be removed.

- Parameters:

    - - **src** – Base image. Size of buffer is srcWidth\*srcHeight\*4 bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of base image **WARNING:** must be a multiple of 2^numLevels
- **srcHeight** – Height of base image **WARNING:** must be a multiple of 2^numLevels
- **numLevels** – Number of levels of the pyramid
- **pyramid** – Output pyramid of numLevels+1 images of the same type as src . pyramid[0] will be the same as src . pyramid[1] is the next pyramid layer, a smoothed and down-sized src , and so on.

- FASTCV\_API int fcvPyramidCreatef32\_v2(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, uint32\_t numLevels, [fcvPyramidLevel\_v2](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00018.html#_CPPv418fcvPyramidLevel_v2) \*pyramid)

    - Builds an image pyramid (with stride). **NOTE:** Memory should be deallocated using fcvPyramidDelete\_v2.

**ATTENTION:** This function is a duplication of [fcvPyramidCreatef32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga0e8fd568548b68ceb4ff470e5aed0c2c) 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: *fcvPyramidCreatef32*, *fcvPyramidCreatef32\_v2* will be removed, and the current signature for *fcvPyramidCreatef32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvPyramidCreatef32* when transitioning to 2.0.0.

- Parameters:

    - - **src** – base image
- **srcWidth** – width of base image **NOTE:** Needs to be a multiple of 2^numLevels
- **srcHeight** – height of base image **NOTE:** Needs to be a multiple of 2^numLevel
- **srcStride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory (base image). **NOTE:** Needs to be a multiple of 2^numLevels **NOTE:** If left at 0, pyramid (non-base) image stride is the same as its srcWidth\*sizeof(float32\_t)
- **numLevels** – Number of levels of the pyramid
- **pyramid** – output pyramid (with stride) of numLevels+1 images of the same type as src . pyramid[0] will be the same as src . pyramid[1] is the next pyramid layer, a smoothed and down-sized src , and so on.

- FASTCV\_API int fcvPyramidCreateu8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int numLevels, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*pyramid)

    - Builds an image pyramid of uint8\_t arising from a single original image - that are successively downscaled w.r.t. the pre-set levels. **NOTE:** Memory should be deallocated using fcvPyramidDelete.

**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: [fcvPyramidCreateu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga52a4189c3bca43ad4bf0c15bc42d2f13). In the 2.0.0 release, fcvPyramidCreateu8\_v2 will be renamed to fcvPyramidCreateu8 and the signature of fcvPyramidCreateu8 as it appears now, will be removed.

- Parameters:

    - - **src** – Base image. Size of buffer is srcWidth\*srcHeight bytes.
- **srcWidth** – Width of base image **WARNING:** must be a multiple of 2^(numLevels-1)
- **srcHeight** – height of base image **NOTE:** must be a multiple of 2^(numLevels-1)
- **numLevels** – Number of levels of the pyramid
- **pyramid** – Output pyramid of numLevels+1 images of the same type as src . pyramid[0] will be the same as src . pyramid[1] is the next pyramid layer, a smoothed and down-sized src , and so on.

- FASTCV\_API int fcvPyramidCreateu8\_v2(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t numLevels, [fcvPyramidLevel\_v2](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00018.html#_CPPv418fcvPyramidLevel_v2) \*pyramid)

    - Builds an image pyramid (with stride). **NOTE:** Memory should be deallocated using fcvPyramidDelete.

**ATTENTION:** This function is a duplication of [fcvPyramidCreateu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga5e84725eb376299eae5fd7ebdcfc8e84) 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: *fcvPyramidCreateu8*, *fcvPyramidCreateu8\_v2* will be removed, and the current signature for *fcvPyramidCreateu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvPyramidCreateu8* when transitioning to 2.0.0.

- Parameters:

    - - **src** – base image
- **srcWidth** – width of base image **NOTE:** Needs to be a multiple of 2^numLevels
- **srcHeight** – height of base image **NOTE:** Needs to be a multiple of 2^numLevel
- **srcStride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory (base image). **NOTE:** Needs to be a multiple of 2^numLevels **NOTE:** Pyramid (non-base) image stride is the same as its width
- **numLevels** – Number of levels of the pyramid
- **pyramid** – output pyramid (with stride) of numLevels+1 images of the same type as src . pyramid[0] will be the same as src . pyramid[1] is the next pyramid layer, a smoothed and down-sized src , and so on.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvPyramidCreateu8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t numLevels, [fcvPyramidScale](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a753b43f34bc209915be1aa6a00d337ab.html#_CPPv415fcvPyramidScale) scale, [fcvPyramidLevel\_v2](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00018.html#_CPPv418fcvPyramidLevel_v2) \*\_\_restrict pyramidGaussian)

    - Builds a Gaussian image pyramid. DO NOT USE THIS API unless for testing purposes. This API can be removed without notice.

This function builds a Gaussian image Pyramid given an input image. Each level of the pyramid is computed by first applying a gaussian filter on the previous level, and then scaling the image based on the type of scale factor selected. The memory for the pyramid must be allocated using [fcvPyramidAllocate\_v3()](https://docs.qualcomm.com/doc/80-79511-2/topic/memory_management.html#a00032_1gafdc7450f8ff5ba380fb1305f9f4ec218), and should be deallocated using [fcvPyramidDelete\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/memory_management.html#a00032_1ga953c655f3d22e1e9c739838d2adb7a9e)

**ATTENTION:** This function is a duplication of [fcvPyramidCreateu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga52a4189c3bca43ad4bf0c15bc42d2f13) 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: *fcvPyramidCreateu8*, *fcvPyramidCreateu8\_v3* will be removed, and the current signature for *fcvPyramidCreateu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvPyramidCreateu8* when transitioning to 2.0.0.

- Parameters:

    - - **src** – base image
- **srcWidth** – Width of base image
- **srcHeight** – Height of base image
- **srcStride** – Stride is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory (base image). **NOTE:** The stride of pyramid levels other than the base are set to be the same as their width
- **numLevels** – Number of levels of the pyramid
- **scale** – Defines the type of scaling used for each pyramid level. FASTCV\_PYRAMID\_SCALE\_HALF downscales each level of the pyramid by a factor of 2. FASTCV\_PYRAMID\_SCALE\_ORB downscales each level of the pyramid by a factor of 1/(2)^(1/4), which is approximated as 0.8408964f
- **pyramidGaussian** – output pyramid of “numLevels” images of the same type as src . pyramidGaussian[0] will be the same as src . pyramidGaussian[1] is the next pyramid layer, a smoothed and scaled src, and so on.

- Returns:

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

- FASTCV\_API int fcvPyramidSobelGradientCreatei16(const [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*imgPyr, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*dxPyr, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*dyPyr, unsigned int numLevels)

    - Creates a gradient pyramid of int16\_t from an image pyramid of uint8\_t.

- Parameters:

    - - **imgPyr** – Input Image Pyramid
- **dxPyr** – Horizontal Sobel gradient pyramid
- **dyPyr** – Verical Sobel gradient pyramid
- **numLevels** – Number of levels in the pyramids

- FASTCV\_API int fcvPyramidSobelGradientCreatef32(const [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*imgPyr, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*dxPyr, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*dyPyr, unsigned int numLevels)

    - Creates a gradient pyramid of float32 from an image pyramid of uint8\_t.

- Parameters:

    - - **imgPyr** – input Image Pyramid
- **dxPyr** – Horizontal Sobel gradient pyramid
- **dyPyr** – Verical Sobel gradient pyramid
- **numLevels** – Number of levels in the pyramids

- FASTCV\_API int fcvPyramidSobelGradientCreatei8(const [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*imgPyr, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*dxPyr, [fcvPyramidLevel](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00017.html#_CPPv415fcvPyramidLevel) \*dyPyr, unsigned int numLevels)

    - Creates a gradient pyramid of integer8 from an image pyramid of uint8\_t.

- Parameters:

    - - **imgPyr** – input Image Pyramid
- **dxPyr** – Horizontal Sobel gradient pyramid
- **dyPyr** – Verical Sobel gradient pyramid
- **numLevels** – Number of levels in the pyramids

- FASTCV\_API void fcvImageGradientSobelPlanars16(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelPlanars16\_v3()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga13672fcf6c15c2462beaf1613ffde86a). In the 2.0.0 release, fcvImageGradientSobelPlanars16\_v3 will be renamed to fcvImageGradientSobelPlanars16 and the signature of fcvImageGradientSobelPlanars16 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8
- **dx** – Buffer to store horizontal gradient. Must be (width)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (width)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientSobelPlanars16\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy, unsigned int dxyStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelPlanars16\_v3()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga13672fcf6c15c2462beaf1613ffde86a). In the 2.0.0 release, fcvImageGradientSobelPlanars16\_v3 will be renamed to fcvImageGradientSobelPlanars16 and the signature of fcvImageGradientSobelPlanars16\_v2 and fcvImageGradientSobelPlanars16\_v3 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays. **NOTE:** if 0, dxyStride is set as (srcWidth\*sizeof(int16\_t)). **WARNING:** should be multiple of 16 (8 \* 2-bytes per gradient value), and at least as much as srcWidth if not 0.

- FASTCV\_API void fcvImageGradientSobelPlanars16\_v3(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy, unsigned int dxyStride)

    - Creates a 2D gradient image from source luminance data without normalization. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**ATTENTION:** This function is a duplication of [fcvImageGradientSobelPlanars16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga9e561de5c7ae7e4b81f4933719ef6f1c) with a change in behavior: no normalization at the end of the calculation. 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: *fcvImageGradientSobelPlanars16*, *fcvImageGradientSobelPlanars16\_v2* and fcvImageGradientSobelPlanars16\_v3 will be removed, and the current signature for *fcvImageGradientSobelPlanars16* and fcvImageGradientSobelPlanars16\_v3 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientSobelPlanars16* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. The number of pixels in a row. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **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 multiple of 8.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values **NOTE:** should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values **NOTE:** should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays, is the number of bytes between column 0 of row 1 and column 0 of row 2 in the gradient arrays dx or dy. If left at 0 gradStride is default to 2 \* srcWidth. **NOTE:** should be multiple of 8.

- FASTCV\_API void fcvImageGradientSobelInterleaveds16(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict gradients)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy]….

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelInterleaveds16\_v3()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gae9a834ef9864064bc95e48a403a0ac50). In the 2.0.0 release, fcvImageGradientSobelInterleaveds16\_v3 will be renamed to fcvImageGradientSobelInterleaveds16 and the signature of fcvImageGradientSobelInterleaveds16 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8
- **gradients** – Buffer to store horizontal and vertical gradient. Must be (width-2)\*(height-2) \*2 in size. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientSobelInterleaveds16\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict gradients, unsigned int gradStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy]….

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelInterleaveds16\_v3()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gae9a834ef9864064bc95e48a403a0ac50). In the 2.0.0 release, fcvImageGradientSobelInterleaveds16\_v3 will be renamed to fcvImageGradientSobelInterleaveds16 and the signature of fcvImageGradientSobelInterleaveds16 and fcvImageGradientSobelInterleaveds16\_v2 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gradients** – Buffer to store horizontal and vertical gradient. Must be gradStride\*(height-2) \*2 bytes in size. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **gradStride** – Stride (in bytes) of the interleaved gradients array. **NOTE:** if 0, gradStride is set as (srcWidth-2)\*2\*sizeof(int16\_t). **WARNING:** should be multiple of 8, and at least as much as 4\*srcWidth if not 0.

- FASTCV\_API void fcvImageGradientSobelInterleaveds16\_v3(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int16\_t \*\_\_restrict gradients, unsigned int gradStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy]….

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ]

Compared to the original and v2 functions, this v3 functions does not normalize

the gradients (divide by 8). It just returns the actual dx, dy values.

**ATTENTION:** This function is a duplication of [fcvImageGradientSobelInterleaveds16\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaa76f4c05a4294da4171852757db16eee) with a change in behavior: no normalization at the end of the calculation. 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: *fcvImageGradientSobelInterleaveds16*, *fcvImageGradientSobelInterleaveds16\_v2* and fcvImageGradientSobelInterleaveds16\_v3 will be removed, and the current signature for *fcvImageGradientSobelInterleaveds16* and fcvImageGradientSobelInterleaveds16\_v3 will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientSobelInterleaveds16* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. The number of pixels in a row. **NOTE:** should be a multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **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.
- **gradients** – Buffer to store horizontal and vertical gradient. Must be gradStride\*(height-2) \*2 bytes in size. **NOTE:** should be 128-bit aligned.
- **gradStride** – Stride (in bytes) is the number of bytes between column 0 of row 1 and column 0 of row 2 in the interleaved gradients array. If left at 0 gradStride is default to 4 \* (srcWidth-2). **WARNING:** should be multiple of 8.

- FASTCV\_API void fcvImageGradientSobelInterleavedf32(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict gradients)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy]….

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelInterleavedf32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gac5b6a9364db362d22d947ed4b3af3f56). In the 2.0.0 release, fcvImageGradientSobelInterleavedf32\_v2 will be renamed to fcvImageGradientSobelInterleavedf32 and the signature of fcvImageGradientSobelInterleavedf32 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8
- **gradients** – Buffer to store horizontal and vertical gradient. Must be (width-2)\*(height-2) \*2 floats in size. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientSobelInterleavedf32\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*\_\_restrict gradients, unsigned int gradStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel. The output is in interleaved format (i.e.) [dx][dy][dx][dy]….

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**ATTENTION:** This function is a duplication of [fcvImageGradientSobelInterleavedf32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gafa045631670247329be65ff1a12a349d) 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: *fcvImageGradientSobelInterleavedf32*, *fcvImageGradientSobelInterleavedf32\_v2* will be removed, and the current signature for *fcvImageGradientSobelInterleavedf32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientSobelInterleavedf32* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gradients** – Buffer to store horizontal and vertical gradient. Must be gradStride\*(height-2) \*2 bytes in size. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **gradStride** – Stride (in bytes) of the interleaved gradients array. **NOTE:** if 0, gradStride is set as (srcWidth-2)\*2\*sizeof(float). **WARNING:** should be multiple of 8, and at least as much as (srcWidth-2)\*2\*sizeof(float) if not 0.

- FASTCV\_API void fcvImageGradientSobelPlanars8(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int8\_t \*\_\_restrict dx, int8\_t \*\_\_restrict dy)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvFilterGaussian3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga0e0b9bac6f1e4b70301f345f5633b9f3). In the 2.0.0 release, fcvImageGradientSobelPlanars8\_v2 will be renamed to fcvImageGradientSobelPlanars8 and the signature of fcvImageGradientSobelPlanars8 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8
- **dx** – Buffer to store horizontal gradient. Must be (width)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (width)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientSobelPlanars8\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, int8\_t \*\_\_restrict dx, int8\_t \*\_\_restrict dy, unsigned int dxyStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**ATTENTION:** This function is a duplication of [fcvImageGradientSobelPlanars8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gabb0fb2006c3d9a8f2585b218ef35516c) 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: *fcvImageGradientSobelPlanars8*, *fcvImageGradientSobelPlanars8\_v2* will be removed, and the current signature for *fcvImageGradientSobelPlanars8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientSobelPlanars8* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- FASTCV\_API void fcvImageGradientSobelPlanarf32(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*dx, float \*dy)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelPlanarf32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga7d715a56c87eb3ea2fa940da979708ce). In the 2.0.0 release, fcvImageGradientSobelPlanarf32\_v2 will be renamed to fcvImageGradientSobelPlanarf32 and the signature of fcvImageGradientSobelPlanarf32 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8
- **dx** – Buffer to store horizontal gradient. Must be (width)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (width)\*(height) in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientSobelPlanarf32\_v2(const uint8\_t \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*dx, float \*dy, unsigned int dxyStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**ATTENTION:** This function is a duplication of [fcvImageGradientSobelPlanarf32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaa06e15c782031b835e01e088804fd874) 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: *fcvImageGradientSobelPlanarf32*, *fcvImageGradientSobelPlanarf32\_v2* will be removed, and the current signature for *fcvImageGradientSobelPlanarf32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientSobelPlanarf32* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays. **NOTE:** if 0, dxyStride is set as 4\*srcWidth. **WARNING:** should be multiple of 32 (8 \* 4-bytes per gradient value),and at least as much as srcWidth\*sizeof(float) if not 0.

- FASTCV\_API void fcvImageGradientSobelPlanarf32f32(const float \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*dx, float \*dy)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**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: [fcvImageGradientSobelPlanarf32f32\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gab46809b7ffd48755d1d4a2cf0094ba0b). In the 2.0.0 release, fcvImageGradientSobelPlanarf32f32\_v2 will be renamed to fcvImageGradientSobelPlanarf32f32 and the signature of fcvImageGradientSobelPlanarf32f32 as it appears now, will be removed.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight floats. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride of image (i.e., how many pixels (not bytes) between column 0 of row 1 and column 0 of row 2). **NOTE:** if 0, srcStride is set as srcWidth.
- **dx** – Buffer to store horizontal gradient. Must be (width)\*(height) floats in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (width)\*(height) floats in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.

- FASTCV\_API void fcvImageGradientSobelPlanarf32f32\_v2(const float \*\_\_restrict src, unsigned int srcWidth, unsigned int srcHeight, unsigned int srcStride, float \*dx, float \*dy, unsigned int dxyStride)

    - Creates a 2D gradient image from source luminance data. This function computes central differences on 3x3 neighborhood and then convolves the result with Sobel kernel

[ -1 0 +1 ] [ -1 -2 -1 ]

dx = [ -2 0 +2 ] \* src dy = [ 0 0 0 ] \* src

[ -1 0 +1 ] [ +1 +2 +1 ].

**ATTENTION:** This function is a duplication of [fcvImageGradientSobelPlanarf32f32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga71da290c81a906905d515f0f36c14b56)() 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: *[fcvImageGradientSobelPlanarf32f32()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga71da290c81a906905d515f0f36c14b56)*, *fcvImageGradientSobelPlanarf32f32\_v2* will be removed, and the current signature for *fcvImageGradientSobelPlanarf32f32* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageGradientSobelPlanarf32f32* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight floats. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **srcStride** – Stride (in bytes) of image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **WARNING:** should be multiple of 32 (8 \* 4-bytes), and at least as much as srcWidth\*sizeof(float) if not 0. **NOTE:** if 0, srcStride is set as srcWidth\*4.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. **NOTE:** a border of 1 pixel in size on top, bottom, left, and right contains undefined values. Gradient output is scaled by 1/8. **NOTE:** data should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays. **WARNING:** should be multiple of 32 (8 \* 4-bytes per gradient value). **WARNING:** should be multiple of 32 (8 \* 4-bytes), and at least as much as srcWidth\*sizeof(float) if not 0. **NOTE:** if 0, dxyStride is set as srcWidth\*4.

- FASTCV\_API void fcvBitwiseOru8(const uint8\_t \*\_\_restrict src1, const uint8\_t \*\_\_restrict src2, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, uint8\_t \*\_\_restrict mask, uint32\_t maskStride)

    - Performs per-element bitwise-OR operation on two 8-bit single channel images. Two images should have the same size. dst(I)=src1(I) V src2(I) if mask(I) is not zero.

- Parameters:

    - - **src1** – Pointer to the 8-bit source image 1.
- **src2** – Pointer to the 8-bit source image 2.
- **srcWidth** – Width of source images pointed by src1 and src2.
- **srcHeight** – Height of source images pointed by src1 and src2.
- **srcStride** – Stride of source images (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).
- **dst** – Pointer to the 8-bit destination image.
- **dstStride** – Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).
- **mask** – Pointer to the 8-bit single channel mask. It specifies elements of the destination array to be changed. The mask is optional. If there is no mask, the value is NULL.
- **maskStride** – Stride of the mask (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If there is no mask, the value is 0.

- FASTCV\_API void fcvBitwiseOrs32(const int32\_t \*\_\_restrict src1, const int32\_t \*\_\_restrict src2, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int32\_t \*\_\_restrict dst, uint32\_t dstStride, uint8\_t \*\_\_restrict mask, uint32\_t maskStride)

    - Performs per-element bitwise-OR operation on two 32-bit single channel images. Two images should have the same size. dst(I)=src1(I) V src2(I) if mask(I) is not zero.

- Parameters:

    - - **src1** – Pointer to the 32-bit source image 1.
- **src2** – Pointer to the 32-bit source image 2.
- **srcWidth** – Width of source images pointed by src1 and src2.
- **srcHeight** – Height of source images pointed by src1 and src2.
- **srcStride** – Stride of source images (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).
- **dst** – Pointer to the 8-bit destination image.
- **dstStride** – Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).
- **mask** – Pointer to the 8-bit single channel mask. It specifies elements of the destination array to be changed. The mask is optional. If there is no mask, the value is NULL.
- **maskStride** – Stride of the mask (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If there is no mask, the value is 0.

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

    - Integral of the image tilted by 45 degrees.

Calculates the tilted integral image of an input image and adds an zero-filled border on top. Left border not zero. dst[i,j]=sum (src[m,n]), where n&lt;j, abs(m-i+1) &lt;= j-n-1

- Parameters:

    - - **src** – Source image, single channel, unsigned char type **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – 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 is srcWidth in bytes as default
- **dst** – Destination image of size (srcWidth+1)\*(srcHeight+1) **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).

- FASTCV\_API void fcvConvValids16(const int16\_t \*\_\_restrict src1, uint32\_t src1Width, uint32\_t src1Height, uint32\_t src1Stride, const int16\_t \*\_\_restrict src2, uint32\_t src2Width, uint32\_t src2Height, uint32\_t src2Stride, int32\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Performs a valid convolution of two images.

This function does convolution of two images. Values are computed for the region where one image is completely within the other image.

- Parameters:

    - - **src1** – First source image of int16 type **WARNING:** should be 128-bit aligned.
- **src1Width** – Image width.
- **src1Height** – Image height.
- **src1Stride** – 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 is srcWidth in bytes as default
- **src2** – Second source image of int16 type **WARNING:** should be 128-bit aligned.
- **src2Width** – Image width. Must meet this condition: src2Width &lt;= src1Width
- **src2Height** – Image height. Must meet this condition: src2Height &lt;= src1Height
- **src2Stride** – Stride of source images (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If set to 0, srcStride is src2Width in bytes as default
- **dst** – Destination image of int32 type. Size of destination is (src1Width-src2Width+1) x (src1Height-src2Height+1) **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of destination image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).

- FASTCV\_API void fcvEdgeWeightings16(int16\_t \*\_\_restrict edgeMap, const uint32\_t edgeMapWidth, const uint32\_t edgeMapHeight, const uint32\_t edgeMapStride, const uint32\_t weight, const uint32\_t edge\_limit, const uint32\_t hl\_threshold, const uint32\_t hh\_threshold, const uint32\_t edge\_denoise\_factor)

    - Performs edge weighting on input image.

The following filtes are used for edge weighting.

[  0  1 -1  ]
    Copy to clipboard

 Vertical edge filter: [ 0 2 -2 ] [ 0 1 -1 ]

[ 0 0 0 ] Horizontal edge filter: [ 1 2 1 ] [ -1 -2 -1 ]

- Parameters:

    - - **edgeMap** – Input edge map data **NOTE:** should be 128-bit aligned.
- **edgeMapWidth** – Input edge map width **NOTE:** should be a multiple of 8.
- **edgeMapHeight** – Input edge map height
- **edgeMapStride** – Stride of input edge map (i.e., number of bytes between column 0 of row 0 and column 0 of row 1). If left at 0, edgeMapStride is default to edgeMapWidth \* 2. **NOTE:** should be a multiple of 8.
- **weight** – The given edge weighting weight. It is set to be 6554 (0.2 in Q15 format).
- **edge\_limit** – The threshold to distinguish edges from noises. A pixel is from an edge if the filtered value is greater than the edge\_limit.
- **hl\_threshold** – The limit of a pixel value reduction in HL band.
- **hh\_threshold** – The limit of a pixel value reduction in HH band.
- **edge\_denoise\_factor** – Edge denoising factor to make sure a pixel value is reduced only when the pixel is a noise pixel.

- Returns:

    - No return value

- FASTCV\_API void fcvAdaptiveThresholdGaussian3x3u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t maxValue, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType, int32\_t value, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Binarizes a grayscale image based on an adaptive threshold value calculated from 3x3 Gaussian kernel.

For each pixel, the threshold is computed adaptively based on cross-correlation with a 3x3 Gaussian kernel minus value (parameter). The standard deviation is used for Gaussian kernel. For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- Parameters:

    - - **src** – Pointer to the 8-bit input image.
- **srcWidth** – Width of source images pointed by src.
- **srcHeight** – Height of source images pointed by src.
- **srcStride** – Stride of source image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).
- **maxValue** – The maximum integer value to be used. 0&lt;maxValue&lt;256.
- **thresholdType** – Threshold type. It could be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV.
- **value** – The constant value subtracted after the cross-correlation with Gaussian kernel. It is usually positive but could be 0 or negative too.
- **dst** – Pointer to the 8-bit destination image. Destination iamge has the same size as input image.
- **dstStride** – Stride of destination image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).

- FASTCV\_API void fcvAdaptiveThresholdGaussian5x5u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t maxValue, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType, int32\_t value, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Binarizes a grayscale image based on an adaptive threshold value calculated from 5x5 Gaussian kernel.

For each pixel, the threshold is computed adaptively based on cross-correlation with a 5x5 Gaussian kernel minus value (parameter). The standard deviation is used for Gaussian kernel. For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- Parameters:

    - - **src** – Pointer to the 8-bit input image.
- **srcWidth** – Width of source images pointed by src.
- **srcHeight** – Height of source images pointed by src.
- **srcStride** – Stride of source image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).
- **maxValue** – The maximum integer value to be used. 0&lt;maxValue&lt;256.
- **thresholdType** – Threshold type. It could be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV.
- **value** – The constant value subtracted after the cross-correlation with Gaussian kernel. It is usually positive but could be 0 or negative too.
- **dst** – Pointer to the 8-bit destination image. Destination iamge has the same size as input image.
- **dstStride** – Stride of destination image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).

- FASTCV\_API void fcvAdaptiveThresholdGaussian11x11u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t maxValue, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType, int32\_t value, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Binarizes a grayscale image based on an adaptive threshold value calculated from 11x11 Gaussian kernel.

For each pixel, the threshold is computed adaptively based on cross-correlation with a 11x11 Gaussian kernel minus value (parameter). The standard deviation is used for Gaussian kernel. For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- Parameters:

    - - **src** – Pointer to the 8-bit input image.
- **srcWidth** – Width of source images pointed by src.
- **srcHeight** – Height of source images pointed by src.
- **srcStride** – Stride of source image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).
- **maxValue** – The maximum integer value to be used. 0&lt;maxValue&lt;256.
- **thresholdType** – Threshold type. It could be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV.
- **value** – The constant value subtracted after the cross-correlation with Gaussian kernel. It is usually positive but could be 0 or negative too.
- **dst** – Pointer to the 8-bit destination image. Destination iamge has the same size as input image.
- **dstStride** – Stride of destination image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).

- FASTCV\_API void fcvAdaptiveThresholdMean3x3u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t maxValue, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType, int32\_t value, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Binarizes a grayscale image based on an adaptive threshold value calculated from 3x3 mean.

For each pixel, the threshold is computed adaptively based on the mean of 3x3 block centered on the pixel minus value (parameter). For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- Parameters:

    - - **src** – Pointer to the 8-bit input image.
- **srcWidth** – Width of source images pointed by src.
- **srcHeight** – Height of source images pointed by src.
- **srcStride** – Stride of source image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).
- **maxValue** – The maximum integer value to be used. 0&lt;maxValue&lt;256.
- **thresholdType** – Threshold type. It could be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV.
- **value** – The constant value subtracted from the mean. It is usually positive but could be 0 or negative too.
- **dst** – Pointer to the 8-bit destination image. Destination iamge has the same size as input image.
- **dstStride** – Stride of destination image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).

- FASTCV\_API void fcvAdaptiveThresholdMean5x5u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t maxValue, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType, int32\_t value, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Binarizes a grayscale image based on an adaptive threshold value calculated from 5x5 mean.

For each pixel, the threshold is computed adaptively based on the mean of 5x5 block centered on the pixel minus value (parameter). For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- Parameters:

    - - **src** – Pointer to the 8-bit input image.
- **srcWidth** – Width of source images pointed by src.
- **srcHeight** – Height of source images pointed by src.
- **srcStride** – Stride of source image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).
- **maxValue** – The maximum integer value to be used. 0&lt;maxValue&lt;256.
- **thresholdType** – Threshold type. It could be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV.
- **value** – The constant value subtracted from the mean. It is usually positive but could be 0 or negative too.
- **dst** – Pointer to the 8-bit destination image. Destination iamge has the same size as input image.
- **dstStride** – Stride of destination image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).

- FASTCV\_API void fcvAdaptiveThresholdMean11x11u8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t maxValue, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType, int32\_t value, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Binarizes a grayscale image based on an adaptive threshold value calculated from 11x11 mean.

For each pixel, the threshold is computed adaptively based on the mean of 11x11 block centered on the pixel minus value (parameter). For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- Parameters:

    - - **src** – Pointer to the 8-bit input image.
- **srcWidth** – Width of source images pointed by src.
- **srcHeight** – Height of source images pointed by src.
- **srcStride** – Stride of source image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).
- **maxValue** – The maximum integer value to be used. 0&lt;maxValue&lt;256.
- **thresholdType** – Threshold type. It could be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV.
- **value** – The constant value subtracted from the mean. It is usually positive but could be 0 or negative too.
- **dst** – Pointer to the 8-bit destination image. Destination iamge has the same size as input image.
- **dstStride** – Stride of destination image (i.e., number of bytes between column 0 of row 0 and column 0 of row 1).

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

    - Smooth a uint8\_t image with a 3x3 box filter.

smooth with 3x3 box kernel and normalize:

[ 1 1 1

1 1 1

1 1 1 ]/9

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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

- Returns:

    - No return value

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

    - Smooth a uint8\_t image with a 5x5 box filter.

smooth with 5x5 box kernel and normalize:

[ 1 1 1 1 1

1 1 1 1 1

1 1 1 1 1

1 1 1 1 1

1 1 1 1 1 ]/25

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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

- Returns:

    - No return value

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

    - Smooth a uint8\_t image with a 11x11 box filter.

smooth with 11x11 box kernel and normalize:

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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

- Returns:

    - No return value

- FASTCV\_API void fcvBoxFilterNxNf32(const [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t N, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*dst, uint32\_t dstStride)

    - Smooth a float32\_t image with a NxN box filter. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.

smooth with NxN box kernel and normalize:

- Parameters:

    - - **src** – Input float32\_t image.
- **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
- **N** – Seperable kernel size. N must be greater than 1.
- **dst** – Output image which has the same type, and size as the input image. If srcImg and dstImg point to the same address and srcStride equals to dstStride, it will do in-place.
- **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

- Returns:

    - No return value

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

    - bilateral smoothing with a 5x5 bilateral 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: [fcvBilateralFilter5x5u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga46e1acfdd64beb1c82878fb052552bcb). In the 2.0.0 release, fcvBilateralFilter5x5u8\_v2 will be renamed to fcvBilateralFilter5x5u8 and the signature of fcvBilateralFilter5x5u8 as it appears now, will be removed.

The bilateral filter applied here considered 5-pixel diameter of each pixel’s neighborhood. The filter sigma in color space is set to 50 and the sigma in coordinate space is set to 1.

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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

- Returns:

    - No return value

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

    - bilateral smoothing with a 5x5 bilateral kernel

**ATTENTION:** This function is a duplication of [fcvBilateralFilter5x5u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1gaf7f830f210d012238631021e527b9776) 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: *fcvBilateralFilter5x5u8*, *fcvBilateralFilter5x5u8\_v2* will be removed, and the current signature for *fcvBilateralFilter5x5u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvBilateralFilter5x5u8* when transitioning to 2.0.0.

The bilateral filter applied here considered 5-pixel diameter of each pixel’s neighborhood. If sigmaColor is set to 50 and sigmaSpace is set to 1, then fcvBilateralFilter5x5u8 is called

- Parameters:

    - - **src** – Input uint8\_t image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **dst** – Output uint8\_t image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **sigmaColor** – Filter sigma in the color space. Typical value is 50.0f. Increasing this value means increasing the influence of the neighboring pixels of more different Color to the smoothing result.
- **sigmaSpace** – Filter sigma in the coordinate space. Typical value is 1.0f. Increasing this value means increasing the influence of farther neighboring pixels within the kernel size distance to the smoothing result.

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

    - Bilateral smoothing with 7x7 bilateral 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: [fcvBilateralFilter7x7u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga8c4c3941914fd87c692d8271160bddaa). In the 2.0.0 release, fcvBilateralFilter7x7u8\_v2 will be renamed to fcvBilateralFilter7x7u8 and the signature of fcvBilateralFilter7x7u8 as it appears now, will be removed.

The bilateral filter applied here considered 7-pixel diameter of each pixel’s neighborhood. The filter sigma in color space is set to 50 and the sigma in coordinate space is set to 1.5 .

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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

- Returns:

    - No return value

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

    - Bilateral smoothing with 7x7 bilateral kernel.

**ATTENTION:** This function is a duplication of [fcvBilateralFilter7x7u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga214a0c82b4746f76b7abf6a509574b09) 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: *fcvBilateralFilter7x7u8*, *fcvBilateralFilter7x7u8\_v2* will be removed, and the current signature for *fcvBilateralFilter7x7u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvBilateralFilter7x7u8* when transitioning to 2.0.0.

The bilateral filter applied here considered 7-pixel diameter of each pixel’s neighborhood. If sigmaColor is set to 50 and sigmaSpace is set to 1.5 then fcvBilateralFilter7x7u8 is called.

- Parameters:

    - - **src** – Input uint8\_t image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **dst** – Output uint8\_t image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **sigmaColor** – Filter sigma in the color space. Typical value is 50.0f. Increasing this value means increasing the influence of the neighboring pixels of more different Color to the smoothing result.
- **sigmaSpace** – Filter sigma in the coordinate space. Typical value is 1.5f. Increasing this value means increasing the influence of farther neighboring pixels within the kernel size distance to the smoothing result.

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

    - Bilateral smoothing with 9x9 bilateral 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: [fcvBilateralFilter9x9u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga49fafa5976ec5d380fc063846835aa5b). In the 2.0.0 release, fcvBilateralFilter9x9u8\_v2 will be renamed to fcvBilateralFilter9x9u8 and the signature of fcvBilateralFilter9x9u8 as it appears now, will be removed.

The bilateral filter applied here considered 9-pixel diameter of each pixel’s neighborhood. The filter sigma in color space is set to 50 and the sigma in coordinate space is set to 2.

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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

- Returns:

    - No return value

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

    - Bilateral smoothing with 9x9 bilateral kernel.

**ATTENTION:** This function is a duplication of [fcvBilateralFilter9x9u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga2d8accdd0467214e09378416a607fce8) 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: *fcvBilateralFilter9x9u8*, *fcvBilateralFilter9x9u8\_v2* will be removed, and the current signature for *fcvBilateralFilter9x9u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvBilateralFilter9x9u8* when transitioning to 2.0.0.

The bilateral filter applied here considered 9-pixel diameter of each pixel’s neighborhood. If sigmaColor is set to 50 and sigmaSpace is set to 2, then fcvBilateralFilter9x9u8 is called.

- Parameters:

    - - **src** – Input uint8\_t image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **dst** – Output uint8\_t image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **sigmaColor** – Filter sigma in the color space. Typical value is 50.0f. Increasing this value means increasing the influence of the neighboring pixels of more different Color to the smoothing result.
- **sigmaSpace** – Filter sigma in the coordinate space. Typical value is 2.0f. Increasing this value means increasing the influence of farther neighboring pixels within the kernel size range to the smoothing result.

- FASTCV\_API void fcvSegmentFGMasku8(uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t Polygonal, uint32\_t perimScale)

    - This function will remove small patches in the source image based on the input threshold.

The function will remove the small contoured area of the source image. The input is a 8 bit grayscale image, where zero value denotes the background.

- Parameters:

    - - **src** – The input image/patch. Must be 8 bit grayscale and zero value indicates the background.
- **srcWidth** – The width of the input source image.
- **srcHeight** – The height of the input source image.
- **srcStride** – The stride of the input source image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2).
- **Polygonal** – If it is 0 then we use convex hull to do approximation on the original contour, otherwise we do polygonal approximation. Currently it simple use the original contour, the parameter will be valid after the convex hull or polygonal approximation function is ready.
- **perimScale** – The minimum perimscale of the contours; If a contour’s perimeter is smaller than this value, It will be removed from the original source image.

- Returns:

    - No return value.

- FASTCV\_API void fcvFloodfillSimpleu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, uint32\_t xBegin, uint32\_t yBegin, uint8\_t newVal, [fcvConnectedComponent](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00004.html#_CPPv421fcvConnectedComponent) \*cc, uint8\_t connectivity, void \*lineBuffer)

    - This function fills the image with a starting seed and neighborhood (4 or 8). It then returns the connected component (cc) that’s filled.

This function first obtains the grayscale value at the (xBegin,yBegin) position of the src image. Then it finds all the neighbor pixels that has the same value based on 4 or 8 connectivity. The corresponding positions of all of these pixels in the image dst then will be set to the new value. Note that the new value cannot be zero since zero is indicating a mask background here. The dst image will have the new value at the corresponding positions and 0 at all other positions.

- Parameters:

    - - **src** – The input image/patch. Must be 8 bit grayscale image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:should** be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row **NOTE:** should be a multiple of 8.
- **srcHeight** – 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:** should be a multiple of 8. If left at 0 srcStride is default to srcWidth.
- **dst** – The output image/patch. Must be 8 bit grayscale image. **NOTE:should** be 128-bit aligned.
- **dstStride** – The stride of the output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** should be a multiple of 8. If left at 0 dstStride is default to srcWidth.
- **xBegin** – The x coordinate of the pixel where we start the floodfill.
- **yBegin** – The y coordinate of the pixel where we start the floodfill.
- **newVal** – The new value that will be set on the dst image, correspoinding to the area that’s floodfilled starting from the (xBegin,yBegin) position.
- **cc** – The pointer that’s pointing to the connected component that’s representing the floodfilled area.
- **connectivity** – It can be either 4 or 8, indicating whether we use a 4-neighborhood or 8-neighborhood to do the floodfill.
- **lineBuffer** – The input scratch buffer that needs to be allocated by the user and passed in. The size of the buffer must be: Max(srcWidth,srcHeight)\*48 bytes. **NOTE:should** be 128-bit aligned.

- Returns:

    - No return value.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFloodfillMergedu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, uint32\_t xBegin, uint32\_t yBegin, uint8\_t newVal, [fcvConnectedComponent](https://docs.qualcomm.com/doc/80-79511-2/topic/struct_a00004.html#_CPPv421fcvConnectedComponent) \*\_\_restrict cc, uint8\_t connectivity)

    - This function fills the image with a starting seed and neighborhood (4 or 8). It then returns the connected component (cc) that’s filled.

This function first obtains the grayscale value at the (xBegin,yBegin) position of the src image. Then it finds all the neighbor pixels that has the same value based on 4 or 8 connectivity. The corresponding positions of all of these pixels in the image dst then will be set to the newVal. The dst image will have the same value as src at all other positions.

- Parameters:

    - - **src** – The input image/patch. Must be 8 bit grayscale image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:should** be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row **NOTE:** should be a multiple of 8.
- **srcHeight** – 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:** should be a multiple of 8. If left at 0 srcStride is default to srcWidth.
- **dst** – The output image/patch. Must be 8 bit grayscale image. **NOTE:should** be 128-bit aligned.
- **dstStride** – The stride of the output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** should be a multiple of 8. If left at 0 dstStride is default to srcWidth.
- **xBegin** – The x coordinate of the pixel where we start the floodfill.
- **yBegin** – The y coordinate of the pixel where we start the floodfill.
- **newVal** – The new value that will be set on the dst image, correspoinding to the area that’s floodfilled starting from the (xBegin,yBegin) position.
- **cc** – The pointer that’s pointing to the connected component that’s representing the floodfilled area.
- **connectivity** – It can be either 4 or 8, indicating whether we use a 4-neighborhood or 8-neighborhood to do the floodfill.

- Returns:

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

- FASTCV\_API void fcvIntegrateImageYCbCr420PseudoPlanaru8(const uint8\_t \*\_\_restrict srcY, const uint8\_t \*\_\_restrict srcC, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcYStride, uint32\_t srcCStride, uint32\_t \*\_\_restrict integralY, uint32\_t \*\_\_restrict integralCb, uint32\_t \*\_\_restrict integralCr, uint32\_t integralYStride, uint32\_t integralCbStride, uint32\_t integralCrStride)

    - This function calculates the integral image of a YCbCr image.

This function calculates the integral images of a YCbCr420 image, where the input YCbCr420 has UV interleaved. The output is 3 seperate channels. The output integralY will be (srcWidth+1)x(srcHeight+1). IntegralU and IntegralV are (srcWidth/2+1)x(srcHeight/2+1).

- Parameters:

    - - **srcY** – The input image/patch Y in planar format. Size of buffer is srcYStride\*srcHeight bytes **NOTE:** should be 128-bit aligned.
- **srcC** – The input image/patch. Pointer to CbCr are interleaved. Size of buffer is srcCStride\*srcHeight/2 bytes **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row **NOTE:** must be a multiple of 16.
- **srcHeight** – Image height. **NOTE:** must be a multiple of 2.
- **srcYStride** – The stride of the input source image’s Y channel. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 srcYStride is default to srcWidth. **NOTE:** must be a multiple of 16.
- **srcCStride** – The stride of the input source image’s CbCr channel. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 srcCStride is default to srcWidth. **NOTE:** must be a multiple of 16.
- **integralY** – The output integral image/patch for Y channel. Must be 32 bit image. The size will be (srcWidth+1)x(srcHeight+1). Size of buffer is integralYStride\*(srcHeight+1) bytes **NOTE:** should be 128-bit aligned.
- **integralCb** – The output integral image/patch for Cb channel. Must be 32 bit image. The size will be (srcWidth/2+1)x(srcHeight/2+1). Size of buffer is integralCbStride\*(srcHeight/2+1) bytes **NOTE:** should be 128-bit aligned.
- **integralCr** – The output integral image/patch for Cr channel. Must be 32 bit image. The size will be (srcWidth/2+1)x(srcHeight/2+1). Size of buffer is integralCrStride\*(srcHeight/2+1) bytes **NOTE:** should be 128-bit aligned.
- **integralYStride** – The stride of integralY. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 integralYStride is default to (srcWidth+8)\*sizeof(uint32\_t) **NOTE:** should be a multiple of 8.
- **integralCbStride** – The stride of integralCb. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 integralCbStride is default to (srcWidth&gt;&gt;1+8) \*sizeof(uint32\_t) **NOTE:** should be a multiple of 8.
- **integralCrStride** – The stride of integralCr. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 integralCrStride is default to (srcWidth&gt;&gt;1+8) \*sizeof(uint32\_t) **NOTE:** should be a multiple of 8.

- Returns:

    - No return value.

- FASTCV\_API void fcvFindForegroundIntegrateImageYCbCr420u32(const uint32\_t \*\_\_restrict bgIntegralY, const uint32\_t \*\_\_restrict bgIntegralCb, const uint32\_t \*\_\_restrict bgIntegralCr, const uint32\_t \*\_\_restrict fgIntegralY, const uint32\_t \*\_\_restrict fgIntegralCb, const uint32\_t \*\_\_restrict fgIntegralCr, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcYStride, uint32\_t srcCbStride, uint32\_t srcCrStride, uint8\_t \*\_\_restrict outputMask, uint32\_t outputWidth, uint32\_t outputHeight, uint32\_t outputMaskStride, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) threshold)

    - This function finds the foreground.

This function tries to find a forgound in the current image (represented by: fgIntegralY, fgIntegralCb, fgIntegralCr) based on the current background model (represented by: bgIntegralY, bgIntegralCb, bgIntegralCr). For example, the tuple (bgIntegralY, bgIntegralCb, bgIntegralCr) may be from a picture shooting a wall. Then the tuple (fgIntegralY, fgIntegralCb, fgIntegralCr) may be the wall with a paint on it. Note that all the first six parameters are indicating integral images that’s computed from a YUV420 image, which maybe computed from the function: fcvIntegrateImageYCbCr420PseudoPlanaru8. Generally the size of fgIntegralY and bgIntegralY are (srcWidth+1)\*(srcHeight+1). And the size of fgIntegralU, fgIntegralV, bgIntegralU and bgIntegralV are (srcWidth/2+1)\*(srcHeight/2+1). The value of the outputWidth and outputHeight are usually indicating the desired block size. For example, if the user wants a 20x15 blocks on a 800x480 image. Then outputWidth=800/20 and outputHeight=480/15. After return, if the value in the outputMask image is 255, then a moving block is indicated, otherwise a non-moving block is indicated.

- Parameters:

    - - **bgIntegralY** – The input image/patch that’s indicating the Y channel of the integral image of the background image. Size of buffer is srcYStride\*srcHeight bytes **NOTE:** should be 128-bit aligned.
- **bgIntegralCb** – The input image/patch that’s indicating the Cb channel of the integral image of the background image. Size of buffer is srcCbStride\*srcHeight/2 bytes **NOTE:** should be 128-bit aligned.
- **bgIntegralCr** – The input image/patch that’s indicating the Cr channel of the integral image of the background image. Size of buffer is srcCrStride\*srcHeight/2 bytes **NOTE:** should be 128-bit aligned.
- **fgIntegralY** – The input image/patch that’s indicating the Y channel of the integral image of the image on which we want to find the foreground. Size of buffer is srcYStride\*srcHeight bytes **NOTE:** should be 128-bit aligned.
- **fgIntegralCb** – The input image/patch that’s indicating the Cb channel of the integral image of the image on which we want to find the foreground. Size of buffer is srcCbStride\*srcHeight/2 bytes **NOTE:** should be 128-bit aligned.
- **fgIntegralCr** – The input image/patch that’s indicating the Cr channel of the integral image of the image on which we want to find the foreground. Size of buffer is srcCrStride\*srcHeight/2 bytes **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row. See the details. **NOTE:** must be a multiple of 16.
- **srcHeight** – The height of the source image. See the details. **NOTE:** must be a multiple of 2.
- **srcYStride** – The stride of the input source image’s Y channel. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 srcStride is default to (srcWidth+8)\*sizeof(uint32\_t). **NOTE:** should be a multiple of 8.
- **srcCbStride** – The stride of the input source image’s Cb channel. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 srcStride is default to (srcWidth&gt;&gt;1+8)\*sizeof(uint32\_t). **NOTE:** should be a multiple of 8.
- **srcCrStride** – The stride of the input source image’s Cr channel. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 srcStride is default to (srcWidth&gt;&gt;1+8)\*sizeof(uint32\_t). **NOTE:** should be a multiple of 8.
- **outputMask** – The output mask image. Each pixel represent the motion condition for a block in the original image. Size of buffer is outputMaskStride\*outputHeight bytes **NOTE:** should be 128-bit aligned.
- **outputWidth** – The width of the output mask image. **NOTE:** should be a multiple of 8.
- **outputHeight** – The height of the output mask image.
- **outputMaskStride** – The stride of the output mask image. (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). If left at 0 outputMaskStride is default to outputWidth. **NOTE:** should be a multiple of 8.
- **threshold** – The threshold that’s used to decide if a block is moving or not. (recommend the value of 20).

- Returns:

    - No return value.

- FASTCV\_API void fcvAverages32(const int32\_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 avgValue)

    - This function calculates the average value of an image.

This function sums all the pixel value in an image and divide the result by the number of pixels in the image.

- Parameters:

    - - **src** – The input image/patch. Must be 32 bit image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row **NOTE:** should be a multiple of 8.
- **srcHeight** – 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.
- **avgValue** – The output average value.

- Returns:

    - No return value.

- FASTCV\_API void fcvAverageu8(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 avgValue)

    - This function calculates the average value of an image.

This function sums all the pixel value in an image and divide the result by the number of pixels in the image.

- Parameters:

    - - **src** – 8-bit image where keypoints are detected. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row **NOTE:** should be a multiple of 8.
- **srcHeight** – 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.
- **avgValue** – The output average value.

- Returns:

    - No return value.

- FASTCV\_API void fcvFilterThresholdOtsuu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvThreshType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae9b5b86659cd299f83164fb884625695.html#_CPPv413fcvThreshType) thresholdType)

    - Binarizes a grayscale image using Otsu’s method.

Sets the pixel to max(255) if it’s value is greater than the threshold; else, set the pixel to min(0). The threshold is searched that minimizes the intra-class variance (the variance within the class)

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – 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. **WARNING:** should be multiple of 8
- **dst** – Output 8-bit binarized image. Size of buffer is dstStride\*srcHeight bytes. If src equals to dst and srcStride equals to dstStride, it will do in-place. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. **WARNING:** should be multiple of 8
- **thresholdType** – Threshold type that can be either FCV\_THRESH\_BINARY or FCV\_THRESH\_BINARY\_INV. **NOTE:** /// For FCV\_THRESH\_BINARY threshold type, the pixel is set as maxValue if it’s value is greater than the threshold; else, it is set as zero. For FCV\_THRESH\_BINARY\_INV threshold type, the pixel is set as zero if it’s value is greater than the threshold; else, it is set as maxValue.

- FASTCV\_API void fcvIntegrateImageu8u64(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t \*\_\_restrict dstIntgrl, uint64\_t \*\_\_restrict dstIntgrlSqrd, uint32\_t dstIntgrlStride, uint32\_t dstIntgrlSqrdStride)

    - Builds an integral image of the incoming 8-bit patch values and their squares. This function supports bigger size patch with u64 for squared integral output. **NOTE:** No extra border lines, the integral output buffer size is the same as input image buffer size.

sum (X,Y) = sum\_{x&lt;=X,y&lt;=Y} I(x,y)

- Parameters:

    - - **src** – Input image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – 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 default to srcWidth. **WARNING:** should be multiple of 8 (8 \* 1-byte values).
- **dstIntgrl** – Integral image. **NOTE:** Memory must be &gt;= srcWidth\*srcHeight\*4 bytes
- **dstIntgrlSqrd** – Integral image of squared values. **NOTE:** Memory must be &gt;= srcWidth\*srcHeight\*8 bytes
- **dstIntgrlStride** – dstIntgrl Image stride (in bytes). 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 srcWidth\*4. **WARNING:** should be multiple of 8 (8 \* 1-byte values).
- **dstIntgrlSqrdStride** – dstIntgrlSqrd Image stride (in bytes). 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 srcWidth\*8. **WARNING:** should be multiple of 8 (8 \* 1-byte values).

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

    - Normalize the image according to histogram value of the pixel intensity.

- Parameters:

    - - **src** – Pointer to grayscale image with one byte per pixel **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width
- **srcHeight** – Image height
- **srcStride** – 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 default to srcWidth. **NOTE:** should be a multiple of 8.
- **dst** – Pointer to output image with one byte per pixel **WARNING:** 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 srcWidth. **NOTE:** should be a multiple of 8.

- FASTCV\_API void fcvImageSpatialHistogramu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t numPatterns, uint32\_t grid\_x, uint32\_t grid\_y, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict histogram)

    - Calculate histogram at image patches.

**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: [fcvImageSpatialHistogramu8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga2355ddabcfe6c93468520ca6da03fa4f). In the 2.0.0 release, fcvImageSpatialHistogramu8\_v2 will be renamed to fcvImageSpatialHistogramu8 and the signature of fcvImageSpatialHistogramu8 as it appears now, will be removed.

- Parameters:

    - - **src** – Pointer to grayscale image with one byte per pixel **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width
- **srcHeight** – Image height
- **srcStride** – 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 default to srcWidth. **NOTE:** should be a multiple of 8.
- **numPatterns** – Number of patterns to be computed in the histogram
- **grid\_x** – The number of grids along x dimension
- **grid\_y** – The number of grids along y dimension
- **histogram** – Output histogram **NOTE:** Memory must be at least numPatterns\*grid\_x\*grid\_y\*sizeof(float32\_t)

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFilterSobel3x3u8s16(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy, uint32\_t dxyStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Creates a 2D gradient image from source luminance data without normalization. This function computes the gradient of the input image by convolution with the 3x3 Sobel kernel. The Sobel kernel is not normalized in this function.

NOTE: it will replace the fcvFilterSobel3x3u8 in fastCV 2.0.0.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. The number of pixels in a row. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **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 multiple of 8.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. If NULL, the horizontal gradient will not be calculated. **NOTE:** should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. If NULL, the vertical gradient will not be calculated. **NOTE:** should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays, is the number of bytes between column 0 of row 1 and column 0 of row 2 in the gradient arrays dx or dy. If left at 0 gradStride is default to 2 \* srcWidth. **NOTE:** should be multiple of 8.
- **borderType** – Define the behavior at the border. See definition of fcvBorderType.
- **borderValue** – Specifies the constant value for the borderType FASTCV\_BORDER\_CONSTANT. Ignored otherwise.

- 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) fcvFilterSobel5x5u8s16(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy, uint32\_t dxyStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Creates a 2D gradient image from source luminance data without normalization. This function computes the gradient of the input image by convolution with the 5x5 Sobel kernel. The Sobel kernel is not normalized in this function.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. The number of pixels in a row. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **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 multiple of 8.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. If NULL, the horizontal gradient will not be calculated. **NOTE:** should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. If NULL, the vertical gradient will not be calculated. **NOTE:** should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays, is the number of bytes between column 0 of row 1 and column 0 of row 2 in the gradient arrays dx or dy. If left at 0 gradStride is default to 2 \* srcWidth. **NOTE:** should be multiple of 8.
- **borderType** – Define the behavior at the border. See definition of fcvBorderType.
- **borderValue** – Specifies the constant value for the borderType FASTCV\_BORDER\_CONSTANT. Ignored otherwise.

- 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) fcvFilterSobel7x7u8s16(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dx, int16\_t \*\_\_restrict dy, uint32\_t dxyStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Creates a 2D gradient image from source luminance data without normalization. This function computes the gradient of the input image by convolution with the 7x7 Sobel kernel. The Sobel kernel is not normalized in this function.

- Parameters:

    - - **src** – Input image/patch. Size of buffer is srcStride\*srcHeight bytes. **NOTE:** should be 128-bit aligned.
- **srcWidth** – Width of src data to create gradient. The number of pixels in a row. **WARNING:** should be multiple of 8.
- **srcHeight** – Height of src data to create gradient.
- **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 multiple of 8.
- **dx** – Buffer to store horizontal gradient. Must be (dxyStride)\*(height) bytes in size. If NULL, the horizontal gradient will not be calculated. **NOTE:** should be 128-bit aligned.
- **dy** – Buffer to store vertical gradient. Must be (dxyStride)\*(height) bytes in size. If NULL, the vertical gradient will not be calculated. **NOTE:** should be 128-bit aligned.
- **dxyStride** – Stride (in bytes) of ‘dx’ and ‘dy’ gradient arrays, is the number of bytes between column 0 of row 1 and column 0 of row 2 in the gradient arrays dx or dy. If left at 0 gradStride is default to 2 \* srcWidth. **NOTE:** should be multiple of 8.
- **borderType** – Define the behavior at the border. See definition of fcvBorderType.
- **borderValue** – Specifies the constant value for the borderType FASTCV\_BORDER\_CONSTANT. Ignored otherwise.

- 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) fcvFilterCannyu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t kernelSize, int32\_t lowThresh, int32\_t highThresh, [fcvNormType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a541225ad55a4f6066bb0a620aba6b28a.html#_CPPv411fcvNormType) normType, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, int16\_t \*\_\_restrict gx, int16\_t \*\_\_restrict gy, uint32\_t gradStride)

    - Canny edge detection with more controls to configurate the algorithm.

Canny edge detector applied to a 8 bit grayscale image. The results are stored as a binarized image (0x0 - not an edge, 0xFF - edge).

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** data should be 128-bit aligned.
- **srcWidth** – Image width. **NOTE:** should be multiple of 8
- **srcHeight** – Image height.
- **srcStride** – Stride of the input image in bytes. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **kernelSize** – The Sobel kernel size for calculating gradient. Supported sizes are 3, 5 and 7.
- **lowThresh** – For all the intermediate pixels along the edge, the norm of the gradient at the pixel locations should be greater than ‘lowThresh’.
- **highThresh** – For an edge starting point, i.e. either the first or last pixel of the edge, the norm of the gradient at the pixel should be greater than ‘highThresh’.
- **normType** – The norm definition to calculate the gradient magnitude. See fcvNormType.
- **dst** – Output 8-bit binarized image containing the edge detection results. Size of buffer is dstStride\*srcHeight bytes. Edges are marked with pixels of 0xFF. The rest pixels have values of 0.
- **dstStride** – Stride of the output image in bytes. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **gx** – Buffer to store horizontal gradient. Must be (gradStride)\*(srcHeight) bytes in size. **NOTE:** should be 128-bit aligned.
- **gy** – Buffer to store vertical gradient. Must be (gradStride)\*(srcHeight) bytes in size. **NOTE:** should be 128-bit aligned.
- **gradStride** – Stride (in bytes) of ‘gx’ and ‘gy’ gradient arrays, is the number of bytes between column 0 of row 1 and column 0 of row 2 in the gradient arrays dx or dy. If left at 0 gradStride is default to 2 \* srcWidth. **NOTE:** should be multiple of 8.

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

    - Converts the bit depth of a single-channel uint8 image to int16\_t type.

- 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
- **shift** – The number of bits to be right-shifted to adjust the output **NOTE:** range from 0 to 8
- **dst** – Output image which has the same dimension as the input image in int16\_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\*2 **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) fcvConvertDepths16u8(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t shift, [fcvConvertPolicy](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a6f50140eab9c780b740a18c4fc7910c5.html#_CPPv416fcvConvertPolicy) policy, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Converts the bit depth of a single-channel int16\_t image to uint8\_t type.

- Parameters:

    - - **src** – Input int16\_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\*2 **NOTE:** should be a multiple of 8
- **shift** – The number of bits to be left-shifted to adjust the output **NOTE:** range from 0 to 15
- **policy** – Conversion policy that decides how data overflow should be handled
- **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) fcvBilateralFilterRecursiveu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) sigmaColor, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) sigmaSpace)

    - Recursive Bilateral Filtering.

The algorithm is described in paper Recursive Bilateral Filtering, ECCV2012 by Prof Yang Qingxiong Different from traditional bilateral filtering, the bilateral filtering in this algorithm is actually performed in gradient domain. The results are ususally better than tradition bilateral filters. Filtering is carried out in a recursive way, and it is efficient.

- Parameters:

    - - **src** – Input uint8\_t image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **dst** – Output uint8\_t image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** 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 **WARNING:** should be multiple of 8.
- **sigmaColor** – Filter sigma in the color space. Typical value 0.03f. Increasing this value means increasing the influence of the neighboring pixels of more different Color to the smoothing result.
- **sigmaSpace** – Filter sigma in the coordinate space. Typical value 0.1f. Increasing this value means increasing the influence of farther pixels to the smoothing result.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvImageSegmentationSeedRegionGrows16(const int16\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t numChannel, uint32\_t threshGrow, const uint32\_t \*\_\_restrict pointVector, uint32\_t numSeed, uint8\_t mode, uint32\_t \*\_\_restrict segLabel, uint32\_t segLabelStride)

    - Grow the seeds within the image to meaningful regions, depending on the color or gray scale uniformity of the neighborhood pixels from the seeds.

- Parameters:

    - - **src** – Pointer to 16-bit color (3-channel) or grayscale (1-channel) image.
- **srcWidth** – Width of src image, measured by pixels.
- **srcHeight** – Height of src image, measured by pixels.
- **srcStride** – Stride of src image, measured by bytes. WARNING: should be multiple of 8, and at least as much as srcWidth\*numChannel if not 0.
- **numChannel** – Number of channels of src image. 1 for gray scale and 3 for color image.
- **threshGrow** – Threshold to grow the seed into a region. Higher value: larger uniform region grown. Range of 3-channel image segmentation: 10~150. Range of 1-channel image segmentation: 3~25.
- **pointVector** – A 2D point vector of seeds (provided by user) within the image. For N seeds, it is saved as [x0,y0,x1,y1,…,xN-1,yN-1].
- **numSeed** – Number of seed points, equal to N used in pointVector.
- **mode** – Mode of seed grow. 0: distance measured with neighborhood pixel. 1: distance measured with seed pixel only.
- **segLabel** – Segmented labels. 1 channel with same size of src. Pixel belonging to the same region is uniformly labeled by a non-zero number. Pixels not grown from any seeds are labeled 0.
- **segLabelStride** – Stride of segmented labels, measured by bytes. WARNING: should be multiple of 8, and at least as much as srcWidth\*4 if not 0.

- Returns:

    - 0 if successful.

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

    - Calculate the local subtractive and contrastive normalization of the image. For each pixel of the image, the mean and optionally standard deviation is calculated for the patch centered around the pixel. Then the pixel is normalized by the local mean and optionally standard deviation.

- Parameters:

    - - **src** – The input image. Must be 8 bit grayscale image. Size of buffer is srcStride\*srcHeight bytes. **NOTE:should** be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row
- **srcHeight** – Image height.
- **srcStride** – Stride of src image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. **NOTE:** should be a multiple of 8. If left at 0 srcStride is default to srcWidth.
- **patchWidth** – Width in pixels of the patch to calculate local mean and standard deviation.
- **patchHeight** – Height in pixels of the patch to calculate local mean and standard deviation.
- **useStdDev** – (0 or 1) if 1, the dst will be normalized with standard deviation.
- **dst** – The output image. Size of buffer is dstStride\*srcHeight bytes. **NOTE:should** be 128-bit aligned.
- **dstStride** – The stride of the output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** should be a multiple of 8. If left at 0 dstStride is default to srcWidth.

- 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) fcvNormalizeLocalBoxf32(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, uint32\_t patchWidth, uint32\_t patchHeight, uint32\_t useStdDev, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict dst, uint32\_t dstStride)

    - Calculate the local subtractive and contrastive normalization of the image. For each pixel of the image, the mean and optionally standard deviation is calculated for the patch centered around the pixel. Then the pixel is normalized by the local mean and optionally standard deviation.

- Parameters:

    - - **src** – The input image. Must be 32-bit float image. Size of buffer is srcStride\*srcHeight\*sizeof(float32\_t) bytes. **NOTE:should** be 128-bit aligned.
- **srcWidth** – Image width, the number of pixels in a row
- **srcHeight** – Image height.
- **srcStride** – Stride of src image is the number of bytes between column 0 of row 1 and column 0 of row 2 in data memory. **NOTE:** should be a multiple of 8. If left at 0 srcStride is default to srcWidth\*sizeof(float32\_t).
- **patchWidth** – Width in pixels of the patch to calculate local mean and standard deviation.
- **patchHeight** – Height in pixels of the patch to calculate local mean and standard deviation.
- **useStdDev** – (0 or 1) if 1, the dst will be normalized with standard deviation.
- **dst** – The output image. Size of buffer is dstStride\*srcHeight\*sizeof(float32\_t) bytes. **NOTE:should** be 128-bit aligned.
- **dstStride** – The stride of the output image (i.e., how many bytes between column 0 of row 1 and column 0 of row 2). **NOTE:** should be a multiple of 8. If left at 0 dstStride is default to srcWidth\*sizeof(float32\_t).

- 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) fcvChannelCombine2Planesu8(const uint8\_t \*\_\_restrict src1, uint32\_t width, uint32\_t height, uint32\_t src1Stride, const uint8\_t \*\_\_restrict src2, uint32\_t src2Stride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Combine two channels in an interleaved fashion.

Interleave data from src1 and src2 to dst. Data in src1 [d0 d1 d2 d3…] Data in src2 [t0 t1 t2 t3…] Results in dst [d0 t0 d1 t1 d2 t2 d3 t3…] **NOTE:** Perform the same functionality as fcvInterleaveu8.

- Parameters:

    - - **src1** – One of the input images ( For example, Cb or Cr component) **NOTE:** array should be 128-bit aligned
- **width** – Width of the source image.
- **height** – Height of the source image.
- **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. **WARNING:** should be multiple of 8
- **src2** – One of the input images ( For example, Cb or Cr component) **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. **WARNING:** should be multiple of 8
- **dst** – The result image (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\*2. **WARNING:** should be multiple of 8

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

    - Combine three channels in an interleaved fashion.

Interleave data from src1, src2 and src3 to dst. Data in src1 [d0 d1 d2 d3…] Data in src2 [t0 t1 t2 t3…] Data in src3 [s0 s1 s2 s3…] Results in dst [d0 t0 s0 d1 t1 s1 d2 t2 s2 d3 t3 s3…]

- Parameters:

    - - **src1** – One of the input images ( For example, R or G or B component) **NOTE:** array should be 128-bit aligned
- **width** – Width of the source image.
- **height** – Height of the source image.
- **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. **WARNING:** should be multiple of 8
- **src2** – One of the input images ( For example, R or G or B component) **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. **WARNING:** should be multiple of 8
- **src3** – One of the input images ( For example, R or G or B component) **NOTE:** array should be 128-bit aligned
- **src3Stride** – 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 src3Stride is default to width. **WARNING:** should be multiple of 8
- **dst** – The result image (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\*3. **WARNING:** should be multiple of 8

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

    - Combine four channels in an interleaved fashion.

Interleave data from src1, src2, src3 and src4 to dst. Data in src1 [d0 d1 d2 d3…] Data in src2 [t0 t1 t2 t3…] Data in src3 [s0 s1 s2 s3…] Data in src3 [r0 r1 r2 r3…] Results in dst [d0 t0 s0 r0 d1 t1 s1 r1 d2 t2 s2 r2 d3 t3 s3 r3…]

- Parameters:

    - - **src1** – One of the input images ( For example, R or G or B or A component) **NOTE:** array should be 128-bit aligned
- **width** – Width of the source image.
- **height** – Height of the source image.
- **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. **WARNING:** should be multiple of 8
- **src2** – One of the input images ( For example, R or G or B or A component) **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. **WARNING:** should be multiple of 8
- **src3** – One of the input images ( For example, R or G or B or A component) **NOTE:** array should be 128-bit aligned
- **src3Stride** – 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 src3Stride is default to width. **WARNING:** should be multiple of 8
- **src4** – One of the input images ( For example, R or G or B or A component) **NOTE:** array should be 128-bit aligned
- **src4Stride** – 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 src4Stride is default to width. **WARNING:** should be multiple of 8
- **dst** – The result image (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\*4. **WARNING:** should be multiple of 8

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvChannelExtractu8(const uint8\_t \*\_\_restrict src1, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t src1Stride, const uint8\_t \*\_\_restrict src2, uint32\_t src2Stride, const uint8\_t \*\_\_restrict src3, uint32\_t src3Stride, [fcvChannelType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a95bad59c58f909085a80f0423f5512e0.html#_CPPv414fcvChannelType) srcChannel, [fcvImageFormat](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ae4105d2414c5bc1f2a5129947124e4c2.html#_CPPv414fcvImageFormat) srcFormat, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Extract channel as a single uint8\_t type plane from an interleaved or multi-planar image format.

- Parameters:

    - - **src1** – The first plane in source image. For example, an intervealved RGB/RGBA plane or the Y plane. **NOTE:** array should be 128-bit aligned
- **srcWidth** – Width of the source image.
- **srcHeight** – Height of the source image.
- **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 the size required by corresponding image format. **WARNING:** should be multiple of 8
- **src2** – The second plane in souce image if available; otherwise, left at 0. For example, the intervealved CbCr plane in FASTCV\_NV12/FASTCV\_NV21; or the Cb plane in FASTCV\_IYUV/FASTCV\_YUV4. **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 for FASTCV\_NV12/FASTCV\_NV21/FASTCV\_YUV4 and width/2 for FASTCV\_IYUV. **WARNING:** should be multiple of 8
- **src3** – The third plane in souce image if available; otherwise, left at 0. For example, the Cr plane in FASTCV\_IYUV/FASTCV\_YUV4. **NOTE:** array should be 128-bit aligned
- **src3Stride** – 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 src3Stride is default to width for FASTCV\_YUV4, and width/2 for FASTCV\_IYUV. **WARNING:** should be multiple of 8
- **srcChannel** – The index of the image channel to be extracted. Refer to fcvChannelType for details.
- **srcFormat** – The format of the source image. Different image formats require different src and dst size. Refer to fcvImageFormat for details.
- **dst** – The result image (a uint8\_t type plane). **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 the size required by corresponding image format. **WARNING:** should be multiple of 8

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

    - Blurs an image with MxN median filter (M,N have to be odd numbers)

Borders of m pixels in horizontal direction and n in vertical direction are replaced with the source pixels, where m = (M-1)/2, n = (N-1)/2 The NxN median filter applies on the image area | a(n,m) , a(n,m+1), …, a(n,srcWidth-m-1) |

| … , …, …, … |

 | a(srcHeight-n-1,m), …, …, a(srcHeight-n-1,srcWidth-m-1) |

- Parameters:

    - - **src** – Input 16-bit signed image. Size of buffer is srcStride\*srcHeight byte. **NOTE:** data should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth \* 2. **WARNING:** should be multiple of 8, and at least as much as srcWidth\*2 if not 0.
- **M** – Filter kernel width **NOTE:** kernel width should be an odd number
- **N** – Filter kernel height **NOTE:** kernel height should be an odd number
- **dst** – Output 16-bit image. Size of buffer is dstStride\*srcHeight byte. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as srcWidth \* 2 **WARNING:** should be multiple of 8, and at least as much as srcWidth\*2 if not 0.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFilterConvolveMxNu8s16(const int16\_t \*\_\_restrict kernel, uint32\_t M, uint32\_t N, int8\_t shift, const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, int16\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Computes the convolution of an image with an M x N Kernel.

The function computes the convolution of an unsigned char input image with an M x N kernel of type short. The output is of type short and is of the same size as the input image. The convolution is computed based on the type of Border handling selected.

- Parameters:

    - - **kernel** – Input M x N short kernel matrix. The size of buffer is M\*N\*sizeof(int16\_t) bytes The kernel can be normalized before passing in by making use of the shift parameter.
- **M** – Width of the kernel
- **N** – Height of the kernel
- **shift** – This parameter can be used to normalize the input kernel by converting the data into fixed point values. Shift can be considered as Q factor of kernel.
- **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
- **dst** – Output image which has the same dimensions as the input matrix. The output is of type short, and must be allocated as dstStride\*srcHeight bytes. **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 \* sizeof(int16\_t). **NOTE:** should be a multiple of 8
- **borderType** – This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border values will be set to 0.
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 to 255.

- FASTCV\_API [fcvStatus](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1a39574810b4ad6914ee8613424f316283.html#_CPPv49fcvStatus) fcvFilterConvolveMxNu8(const int16\_t \*\_\_restrict kernel, uint32\_t M, uint32\_t N, int8\_t shift, const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Computes the convolution of a image with an M x N Kernel.

The function computes the convolution of an unsigned char input image with an M x N kernel of type short. The output is of type unsigned char and is of the same size as the input image. The convolution is computed based on the type of Border handling selected.

- Parameters:

    - - **kernel** – Input M x N short kernel matrix. The size of buffer is M\*N\*sizeof(int16\_t) bytes The kernel can be normalized before passing in by making use of the shift parameter.
- **M** – Width of the kernel
- **N** – Height of the kernel
- **shift** – This parameter can be used to normalize the input kernel by converting the data into fixed point values. Shift can be considered as Q factor of kernel.
- **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
- **dst** – Output image which has the same dimensions as the input matrix. The output is of type unsigned char, and must be allocated as dstStride\*srcHeight bytes. **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
- **borderType** – This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border values will be set to 0.
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 and 255.

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

    - Smooth a uint8\_t image with a 3x3 box filter with border handling scheme specified by user.

smooth with 3x3 box kernel and normalize:

[ 1 1 1

1 1 1

1 1 1 ]/9

- Parameters:

    - - **src** – Input uint8\_t image.
- **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
- **dst** – Output image which has the same type, and size as the input image.
- **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
- **borderType** – This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border values will be set to 0.
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 and 255.

- 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) fcvFilterErode3x3u8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Erode a grayscale image by taking the local minima of 3x3 nbhd window with border handling scheme specified by user.

**ATTENTION:** This function is a duplication of [fcvFilterErode3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga2355e99d55384430a97def022adda77c) 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: *fcvFilterErode3x3u8*, *fcvFilterErode3x3u8\_v2* will be removed, and the current signature for *fcvFilterErode3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterErode3x3u8* when transitioning to 2.0.0.

- 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.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit eroded image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **borderType** – This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border values will be set to 255.
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 and 255.

- 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) fcvFilterErodeNxNu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t N, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Erode a grayscale image by taking the local minima of NxN neighborhood window.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **N** – Dimension of the neighborhood window. **WARNING:** must be an odd number
- **dst** – Output 8-bit eroded image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- 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) fcvFilterDilate3x3u8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Dilate a grayscale image by taking the local maxima of 3x3 neighborhood window with border handling scheme specified by user.

**ATTENTION:** This function is a duplication of [fcvFilterDilate3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga6e0eedef0c8a88fce9cacd30e553e54e) 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: *fcvFilterDilate3x3u8*, *fcvFilterDilate3x3u8\_v2* will be removed, and the current signature for *fcvFilterDilate3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterDilate3x3u8* when transitioning to 2.0.0.

- 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.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit dilated image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **borderType** – This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border values will be set to 0.
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 and 255.

- 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) fcvFilterDilateNxNu8(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t N, uint8\_t \*\_\_restrict dst, uint32\_t dstStride)

    - Dilate a grayscale image by taking the local maxima of NxN neighborhood window.

- Parameters:

    - - **src** – Input 8-bit image. Size of buffer is srcStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width.
- **srcHeight** – Image height.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **N** – Dimension of the neighborhood window. **WARNING:** must be an odd number
- **dst** – Output 8-bit dilated image. Size of buffer is dstStride\*srcHeight bytes. **WARNING:** should be 128-bit aligned.
- **dstStride** – Stride of output image. **NOTE:** if 0, dstStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.

- 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) fcvFilterGaussian3x3u8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Blurs an image with 3x3 Gaussian filter with border handling scheme specified by user.

**ATTENTION:** This function is a duplication of [fcvFilterGaussian3x3u8\_v2()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga0e0b9bac6f1e4b70301f345f5633b9f3) 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: *fcvFilterGaussian3x3u8*, *fcvFilterGaussian3x3u8\_v2* will be removed, and the current signature for *fcvFilterGaussian3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterGaussian3x3u8* when transitioning to 2.0.0.

Convolution with 3x3 Gaussian kernel:

1 2 1

2 4 2

1 2 1

- 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.
- **srcStride** – Image stride. **NOTE:** if 0, srcStride is set as srcWidth. **WARNING:** should be multiple of 8, and at least as much as srcWidth if not 0.
- **dst** – Output 8-bit image. Size of buffer is dstStride\*srcHeight bytes. **NOTE:** data should be 128-bit aligned.
- **dstStride** – Output stride. **NOTE:** if 0, dstStride is set as dstWidth. **WARNING:** should be multiple of 8, and at least as much as dstWidth if not 0.
- **borderType** – This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border is blurred by 0-padding adjacent values.
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 and 255.

- 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) fcvFilterMedian3x3u8\_v3(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint8\_t \*\_\_restrict dst, uint32\_t dstStride, [fcvBorderType](https://docs.qualcomm.com/doc/80-79511-2/topic/enum_a00021_1ab7136c81ade67243fd2603ec08110220.html#_CPPv413fcvBorderType) borderType, uint8\_t borderValue)

    - Blurs an image with 3x3 median filter with border handling scheme specified by user.

**ATTENTION:** This function is a duplication of [fcvFilterMedian3x3u8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga988b50b64144308aa3e54eff5b58882a) 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: *fcvFilterMedian3x3u8*, *fcvFilterMedian3x3u8\_v2* will be removed, and the current signature for *fcvFilterMedian3x3u8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvFilterMedian3x3u8* when transitioning to 2.0.0.

Border values are extrapolated according to borderType. The 3x3 mask convolves with the whole image area.

- Parameters:

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

    This parameter specifies how the border is handled. Can be set to FASTCV\_BORDER\_CONSTANT, FASTCV\_BORDER\_REPLICATE or FASTCV\_BORDER\_UNDEFINED. In the case of FASTCV\_BORDER\_UNDEFINED, border values are ignored. The 3x3 mask convolves with the following image area | a(1,1) , a12, …, a(1,srcWidth-2) |

    | … , …, …, … |

 | a(srcHeight-2,1), …, …, a1(srcHeight-2,srcWidth-2) |
- **borderValue** – Used to define the border value in case FASTCV\_BORDER\_CONSTANT is chosen. For other modes, set this value as 0. Can take values between 0 and 255.

- 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) fcvImageSpatialHistogramu8\_v2(const uint8\_t \*\_\_restrict src, uint32\_t srcWidth, uint32\_t srcHeight, uint32\_t srcStride, uint32\_t numPatterns, uint32\_t grid\_x, uint32\_t grid\_y, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*\_\_restrict histogram, [float32\_t](https://docs.qualcomm.com/doc/80-79511-2/topic/typedef_a00021_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) normalize\_factor)

    - Calculate histogram at image patches.

**ATTENTION:** This function is a duplication of [fcvImageSpatialHistogramu8()](https://docs.qualcomm.com/doc/80-79511-2/topic/image_processing.html#a00023_1ga6b2421ce08fcb7e6bbe7cd1e2a18d92a) 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: *fcvImageSpatialHistogramu8*, *fcvImageSpatialHistogramu8\_v2* will be removed, and the current signature for *fcvImageSpatialHistogramu8* will be removed. Until 2.0.0, the developer should use this implementation with the expectation of renaming it to *fcvImageSpatialHistogramu8* when transitioning to 2.0.0.

- Parameters:

    - - **src** – Pointer to grayscale image with one byte per pixel **WARNING:** should be 128-bit aligned.
- **srcWidth** – Image width
- **srcHeight** – Image height
- **srcStride** – 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 default to srcWidth. **NOTE:** should be a multiple of 8.
- **numPatterns** – Number of patterns to be computed in the histogram
- **grid\_x** – The number of grids along x dimension
- **grid\_y** – The number of grids along y dimension
- **histogram** – Output histogram **NOTE:** Memory must be at least numPatterns\*grid\_x\*grid\_y\*sizeof(float32\_t)
- **normalize\_factor** – Scale factor with float32\_t type to normalize result. When set to 0, the result is normalized by (srcWidth/grid\_x) \* (srcHeight/grid\_y)

- Returns:

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

Last Published: Aug 30, 2024

[Previous Topic
Feature detection](https://docs.qualcomm.com/bundle/publicresource/80-79511-2/topics/feature_detection.md) [Next Topic
Image transformation](https://docs.qualcomm.com/bundle/publicresource/80-79511-2/topics/image_transformation.md)