Getting of statistic related with Sobel filters. More...
Functions | |
| SIMD_API void | SimdSobelDxAbsSum (const uint8_t *src, size_t stride, size_t width, size_t height, uint64_t *sum) |
| Calculates the sum of absolute horizontal Sobel derivatives. More... | |
| SIMD_API void | SimdSobelDyAbsSum (const uint8_t *src, size_t stride, size_t width, size_t height, uint64_t *sum) |
| Calculates the sum of absolute vertical Sobel derivatives. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | SobelDxAbsSum (const View< A > &src, uint64_t &sum) |
| Calculates sum of absolute value of Sobel's filter along x axis. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | SobelDyAbsSum (const View< A > &src, uint64_t &sum) |
| Calculates sum of absolute value of Sobel's filter along y axis. More... | |
Detailed Description
Getting of statistic related with Sobel filters.
Function Documentation
◆ SimdSobelDxAbsSum()
| void SimdSobelDxAbsSum | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | sum | ||
| ) |
Calculates the sum of absolute horizontal Sobel derivatives.
Input image must have 8-bit gray format, and width must be greater than 1. At image borders the nearest valid source row or column is reused. The output sum is initialized to zero inside the function before accumulation.
For every point:
x0 = Max(x - 1, 0); x2 = Min(x + 1, width - 1);
y0 = Max(y - 1, 0); y2 = Min(y + 1, height - 1);
sum += Abs((src[x2, y0] + 2*src[x2, y] + src[x2, y2]) -
(src[x0, y0] + 2*src[x0, y] + src[x0, y2]));
- Note
- This function has a C++ wrappers: Simd::SobelDxAbsSum(const View<A>& src, uint64_t & sum).
- Parameters
-
[in] src - a pointer to pixels data of the input image. [in] stride - a row size of the input image in bytes. [in] width - an image width. [in] height - an image height. [out] sum - a pointer to unsigned 64-bit integer value with result sum.
◆ SimdSobelDyAbsSum()
| void SimdSobelDyAbsSum | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | sum | ||
| ) |
Calculates the sum of absolute vertical Sobel derivatives.
Input image must have 8-bit gray format, and width must be greater than 1. At image borders the nearest valid source row or column is reused. The output sum is initialized to zero inside the function before accumulation.
For every point:
x0 = Max(x - 1, 0); x2 = Min(x + 1, width - 1);
y0 = Max(y - 1, 0); y2 = Min(y + 1, height - 1);
sum += Abs((src[x0, y2] + 2*src[x, y2] + src[x2, y2]) -
(src[x0, y0] + 2*src[x, y0] + src[x2, y0]));
- Note
- This function has a C++ wrappers: Simd::SobelDyAbsSum(const View<A>& src, uint64_t & sum).
- Parameters
-
[in] src - a pointer to pixels data of the input image. [in] stride - a row size of the input image in bytes. [in] width - an image width. [in] height - an image height. [out] sum - a pointer to unsigned 64-bit integer value with result sum.
◆ SobelDxAbsSum()
| void SobelDxAbsSum | ( | const View< A > & | src, |
| uint64_t & | sum | ||
| ) |
Calculates sum of absolute value of Sobel's filter along x axis.
Input image must have 8-bit gray format.
For every point:
sum += abs((src[x+1,y-1] + 2*src[x+1, y] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x-1, y] + src[x-1, y+1]));
- Note
- This function is a C++ wrapper for function SimdSobelDxAbsSum.
- Parameters
-
[in] src - an input image. [out] sum - an unsigned 64-bit integer value with result sum.
◆ SobelDyAbsSum()
| void SobelDyAbsSum | ( | const View< A > & | src, |
| uint64_t & | sum | ||
| ) |
Calculates sum of absolute value of Sobel's filter along y axis.
Input image must have 8-bit gray format.
For every point:
sum += abs((src[x-1,y+1] + 2*src[x, y+1] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x, y-1] + src[x+1, y-1]));
- Note
- This function is a C++ wrapper for function SimdSobelDyAbsSum.
- Parameters
-
[in] src - an input image. [out] sum - an unsigned 64-bit integer value with result sum.