Estimation of various image statistic. More...
Functions | |
| SIMD_API void | SimdLaplaceAbsSum (const uint8_t *src, size_t stride, size_t width, size_t height, uint64_t *sum) |
| Calculates sum of absolute value of Laplace's filter. More... | |
| SIMD_API void | SimdGetStatistic (const uint8_t *src, size_t stride, size_t width, size_t height, uint8_t *min, uint8_t *max, uint8_t *average) |
| Finds minimal, maximal and average pixel values for given image. More... | |
| SIMD_API void | SimdGetMoments (const uint8_t *mask, size_t stride, size_t width, size_t height, uint8_t index, uint64_t *area, uint64_t *x, uint64_t *y, uint64_t *xx, uint64_t *xy, uint64_t *yy) |
| Calculate statistical characteristics (moments) of pixels with given index. More... | |
| SIMD_API void | SimdValueSum (const uint8_t *src, size_t stride, size_t width, size_t height, uint64_t *sum) |
| Gets sum of value of pixels for gray 8-bit image. More... | |
| SIMD_API void | SimdSquareSum (const uint8_t *src, size_t stride, size_t width, size_t height, uint64_t *sum) |
| Gets sum of squared value of pixels for gray 8-bit image . More... | |
| SIMD_API void | SimdValueSquareSum (const uint8_t *src, size_t stride, size_t width, size_t height, uint64_t *valueSum, uint64_t *squareSum) |
| Gets sum and squared sum of value of pixels for gray 8-bit image. More... | |
| SIMD_API void | SimdCorrelationSum (const uint8_t *a, size_t aStride, const uint8_t *b, size_t bStride, size_t width, size_t height, uint64_t *sum) |
| Gets sum of pixel correlation for two gray 8-bit images. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | LaplaceAbsSum (const View< A > &src, uint64_t &sum) |
| Calculates sum of absolute value of Laplace's filter. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | GetStatistic (const View< A > &src, uint8_t &min, uint8_t &max, uint8_t &average) |
| Finds minimal, maximal and average pixel values for given image. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | GetMoments (const View< A > &mask, uint8_t index, uint64_t &area, uint64_t &x, uint64_t &y, uint64_t &xx, uint64_t &xy, uint64_t &yy) |
| Calculate statistical characteristics (moments) of pixels with given index. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | ValueSum (const View< A > &src, uint64_t &sum) |
| Gets sum of value of pixels for gray 8-bit image. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | SquareSum (const View< A > &src, uint64_t &sum) |
| Gets sum of squared value of pixels for gray 8-bit image. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | ValueSquareSum (const View< A > &src, uint64_t &valueSum, uint64_t &squareSum) |
| Gets sum and sum of squared value of pixels for gray 8-bit image. More... | |
| template<template< class > class A> | |
| SIMD_INLINE void | CorrelationSum (const View< A > &a, const View< A > &b, uint64_t &sum) |
| Gets sum of pixel correlation for two gray 8-bit images. More... | |
Detailed Description
Estimation of various image statistic.
Function Documentation
◆ SimdLaplaceAbsSum()
| void SimdLaplaceAbsSum | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | sum | ||
| ) |
Calculates sum of absolute value of Laplace's filter.
Input image must has 8-bit gray format.
For every point:
sum += abs(
- src[x-1, y-1] - src[x, y-1] - src[x+1, y-1]
- src[x-1, y] + 8*src[x, y] - src[x+1, y]
- src[x-1, y+1] - src[x, y+1] - src[x+1, y+1]).
- Note
- This function has a C++ wrappers: Simd::LaplaceAbsSum(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] width - an image width. [in] height - an image height. [out] sum - a pointer to result sum.
◆ SimdGetStatistic()
| void SimdGetStatistic | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint8_t * | min, | ||
| uint8_t * | max, | ||
| uint8_t * | average | ||
| ) |
Finds minimal, maximal and average pixel values for given image.
The image must has 8-bit gray format.
- Note
- This function has a C++ wrappers: Simd::GetStatistic(const View<A>& src, uint8_t & min, uint8_t & max, uint8_t & average).
- Parameters
-
[in] src - a pointer to pixels data of the input image. [in] stride - a row size of the image. [in] width - an image width. [in] height - an image height. [out] min - a pointer to unsigned 8-bit integer value with found minimal pixel value. [out] max - a pointer to unsigned 8-bit integer value with found maximal pixel value. [out] average - a pointer to unsigned 8-bit integer value with found average pixel value.
◆ SimdGetMoments()
| void SimdGetMoments | ( | const uint8_t * | mask, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint8_t | index, | ||
| uint64_t * | area, | ||
| uint64_t * | x, | ||
| uint64_t * | y, | ||
| uint64_t * | xx, | ||
| uint64_t * | xy, | ||
| uint64_t * | yy | ||
| ) |
Calculate statistical characteristics (moments) of pixels with given index.
The image must has 8-bit gray format.
For every point:
if(mask[X, Y] == index)
{
area += 1.
x += X.
y += Y.
xx += X*X.
xy += X*Y.
yy += Y*Y.
}
- Note
- This function has a C++ wrappers: Simd::GetMoments(const View<A>& mask, uint8_t index, uint64_t & area, uint64_t & x, uint64_t & y, uint64_t & xx, uint64_t & xy, uint64_t & yy).
- Parameters
-
[in] mask - a pointer to pixels data of the mask image. [in] stride - a row size of the mask image. [in] width - an image width. [in] height - an image height. [in] index - a mask index. [out] area - a pointer to unsigned 64-bit integer value with found area (number of pixels with given index). [out] x - a pointer to unsigned 64-bit integer value with found first-order moment x. [out] y - a pointer to unsigned 64-bit integer value with found first-order moment y. [out] xx - a pointer to unsigned 64-bit integer value with found second-order moment xx. [out] xy - a pointer to unsigned 64-bit integer value with found second-order moment xy. [out] yy - a pointer to unsigned 64-bit integer value with found second-order moment yy.
◆ SimdValueSum()
| void SimdValueSum | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | sum | ||
| ) |
Gets sum of value of pixels for gray 8-bit image.
- Note
- This function has a C++ wrappers: Simd::ValueSum(const View<A>& src, uint64_t & sum).
- Parameters
-
[in] src - a pointer to pixels data of the image. [in] stride - a row size of the image. [in] width - an image width. [in] height - an image height. [out] sum - the result sum.
◆ SimdSquareSum()
| void SimdSquareSum | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | sum | ||
| ) |
Gets sum of squared value of pixels for gray 8-bit image .
- Note
- This function has a C++ wrappers: Simd::SquareSum(const View<A>& src, uint64_t & sum).
- Parameters
-
[in] src - a pointer to pixels data of the image. [in] stride - a row size of the image. [in] width - an image width. [in] height - an image height. [out] sum - the result sum.
◆ SimdValueSquareSum()
| void SimdValueSquareSum | ( | const uint8_t * | src, |
| size_t | stride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | valueSum, | ||
| uint64_t * | squareSum | ||
| ) |
Gets sum and squared sum of value of pixels for gray 8-bit image.
- Note
- This function has a C++ wrappers: Simd::ValueSquareSum(const View<A>& src, uint64_t & valueSum, uint64_t & squareSum).
- Parameters
-
[in] src - a pointer to pixels data of the image. [in] stride - a row size of the image. [in] width - an image width. [in] height - an image height. [out] valueSum - the result value sum. [out] squareSum - the result square sum.
◆ SimdCorrelationSum()
| void SimdCorrelationSum | ( | const uint8_t * | a, |
| size_t | aStride, | ||
| const uint8_t * | b, | ||
| size_t | bStride, | ||
| size_t | width, | ||
| size_t | height, | ||
| uint64_t * | sum | ||
| ) |
Gets sum of pixel correlation for two gray 8-bit images.
For all points:
sum += a[i]*b[i];
All images must have the same width and height and 8-bit gray pixel format.
- Note
- This function has a C++ wrappers: Simd::CorrelationSum(const View<A> & a, const View<A> & b, uint64_t & sum).
- Parameters
-
[in] a - a pointer to pixels data of the first image. [in] aStride - a row size of the first image. [in] b - a pointer to pixels data of the second image. [in] bStride - a row size of the second image. [in] width - an images width. [in] height - an images height. [out] sum - a pointer to result sum.
◆ LaplaceAbsSum()
| void LaplaceAbsSum | ( | const View< A > & | src, |
| uint64_t & | sum | ||
| ) |
Calculates sum of absolute value of Laplace's filter.
Input image must has 8-bit gray format.
For every point:
sum += abs(
- src[x-1, y-1] - src[x, y-1] - src[x+1, y-1]
- src[x-1, y] + 8*src[x, y] - src[x+1, y]
- src[x-1, y+1] - src[x, y+1] - src[x+1, y+1]).
- Note
- This function is a C++ wrapper for function SimdLaplaceAbsSum.
- Parameters
-
[in] src - an input image. [out] sum - a result sum.
◆ GetStatistic()
| void GetStatistic | ( | const View< A > & | src, |
| uint8_t & | min, | ||
| uint8_t & | max, | ||
| uint8_t & | average | ||
| ) |
Finds minimal, maximal and average pixel values for given image.
The image must has 8-bit gray format.
- Note
- This function is a C++ wrapper for function SimdGetStatistic.
- Parameters
-
[in] src - an input image. [out] min - a reference to unsigned 8-bit integer value with found minimal pixel value. [out] max - a reference to unsigned 8-bit integer value with found maximal pixel value. [out] average - a reference to unsigned 8-bit integer value with found average pixel value.
◆ GetMoments()
| void GetMoments | ( | const View< A > & | mask, |
| uint8_t | index, | ||
| uint64_t & | area, | ||
| uint64_t & | x, | ||
| uint64_t & | y, | ||
| uint64_t & | xx, | ||
| uint64_t & | xy, | ||
| uint64_t & | yy | ||
| ) |
Calculate statistical characteristics (moments) of pixels with given index.
The image must has 8-bit gray format.
For every point:
if(mask[X, Y] == index)
{
area += 1.
x += X.
y += Y.
xx += X*X.
xy += X*Y.
yy += Y*Y.
}
- Note
- This function is a C++ wrapper for function SimdGetMoments.
- Parameters
-
[in] mask - a mask image. [in] index - a mask index. [out] area - a reference to unsigned 64-bit integer value with found area (number of pixels with given index). [out] x - a reference to unsigned 64-bit integer value with found first-order moment x. [out] y - a reference to unsigned 64-bit integer value with found first-order moment y. [out] xx - a reference to unsigned 64-bit integer value with found second-order moment xx. [out] xy - a reference to unsigned 64-bit integer value with found second-order moment xy. [out] yy - a reference to unsigned 64-bit integer value with found second-order moment yy.
◆ ValueSum()
| void ValueSum | ( | const View< A > & | src, |
| uint64_t & | sum | ||
| ) |
Gets sum of value of pixels for gray 8-bit image.
- Note
- This function is a C++ wrapper for function SimdValueSum.
- Parameters
-
[in] src - an input image. [out] sum - a result sum.
◆ SquareSum()
| void SquareSum | ( | const View< A > & | src, |
| uint64_t & | sum | ||
| ) |
Gets sum of squared value of pixels for gray 8-bit image.
- Note
- This function is a C++ wrapper for function SimdSquareSum.
- Parameters
-
[in] src - an input image. [out] sum - a result sum.
◆ ValueSquareSum()
| void ValueSquareSum | ( | const View< A > & | src, |
| uint64_t & | valueSum, | ||
| uint64_t & | squareSum | ||
| ) |
Gets sum and sum of squared value of pixels for gray 8-bit image.
- Note
- This function is a C++ wrapper for function SimdValueSquareSum.
- Parameters
-
[in] src - an input image. [out] valueSum - a result value sum. [out] squareSum - a result square sum.
◆ CorrelationSum()
Gets sum of pixel correlation for two gray 8-bit images.
For all points:
sum += a[i]*b[i];
All images must have the same width and height and 8-bit gray pixel format.
- Note
- This function is a C++ wrapper for function SimdCorrelationSum.
- Parameters
-
[in] a - a first image. [in] b - a second image. [out] sum - a result sum.
