Functions for estimation of background texture. More...
Functions | |
SIMD_API void | SimdTextureBoostedSaturatedGradient (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t saturation, uint8_t boost, uint8_t *dx, size_t dxStride, uint8_t *dy, size_t dyStride) |
Calculates boosted saturated gradients for given input image. More... | |
SIMD_API void | SimdTextureBoostedUv (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t boost, uint8_t *dst, size_t dstStride) |
Calculates boosted colorized texture feature of input image (actual for U and V components of YUV format). More... | |
SIMD_API void | SimdTextureGetDifferenceSum (const uint8_t *src, size_t srcStride, size_t width, size_t height, const uint8_t *lo, size_t loStride, const uint8_t *hi, size_t hiStride, int64_t *sum) |
Calculates difference between current image and background. More... | |
SIMD_API void | SimdTexturePerformCompensation (const uint8_t *src, size_t srcStride, size_t width, size_t height, int32_t shift, uint8_t *dst, size_t dstStride) |
Performs brightness compensation of input image. More... | |
template<template< class > class A> | |
SIMD_INLINE void | TextureBoostedSaturatedGradient (const View< A > &src, uint8_t saturation, uint8_t boost, View< A > &dx, View< A > &dy) |
Calculates boosted saturated gradients for given input image. More... | |
template<template< class > class A> | |
SIMD_INLINE void | TextureBoostedUv (const View< A > &src, uint8_t boost, View< A > &dst) |
Calculates boosted colorized texture feature of input image (actual for U and V components of YUV format). More... | |
template<template< class > class A> | |
SIMD_INLINE void | TextureGetDifferenceSum (const View< A > &src, const View< A > &lo, const View< A > &hi, int64_t &sum) |
Calculates difference between current image and background. More... | |
template<template< class > class A> | |
SIMD_INLINE void | TexturePerformCompensation (const View< A > &src, int shift, View< A > &dst) |
Performs brightness compensation of input image. More... | |
Detailed Description
Functions for estimation of background texture.
Function Documentation
◆ SimdTextureBoostedSaturatedGradient()
void SimdTextureBoostedSaturatedGradient | ( | const uint8_t * | src, |
size_t | srcStride, | ||
size_t | width, | ||
size_t | height, | ||
uint8_t | saturation, | ||
uint8_t | boost, | ||
uint8_t * | dx, | ||
size_t | dxStride, | ||
uint8_t * | dy, | ||
size_t | dyStride | ||
) |
Calculates boosted saturated gradients for given input image.
All images must have the same width, height and format (8-bit gray).
For border pixels:
dx[x, y] = 0; dy[x, y] = 0;
For other pixels:
dx[x, y] = (saturation + max(-saturation, min(saturation, (src[x + 1, y] - src[x - 1, y]))))*boost; dy[x, y] = (saturation + max(-saturation, min(saturation, (src[x, y + 1] - src[x, y - 1]))))*boost;
- Note
- This function has a C++ wrappers: Simd::TextureBoostedSaturatedGradient(const View<A>& src, uint8_t saturation, uint8_t boost, View<A>& dx, View<A>& dy).
- Parameters
-
[in] src - a pointer to pixels data of source 8-bit gray image. [in] srcStride - a row size of source image. [in] width - an image width. [in] height - an image height. [in] saturation - a saturation of gradient. [in] boost - a boost coefficient. [out] dx - a pointer to pixels data of image with boosted saturated gradient along x axis. [in] dxStride - a row size of dx image. [out] dy - a pointer to pixels data of image with boosted saturated gradient along y axis. [in] dyStride - a row size of dy image.
◆ SimdTextureBoostedUv()
void SimdTextureBoostedUv | ( | const uint8_t * | src, |
size_t | srcStride, | ||
size_t | width, | ||
size_t | height, | ||
uint8_t | boost, | ||
uint8_t * | dst, | ||
size_t | dstStride | ||
) |
Calculates boosted colorized texture feature of input image (actual for U and V components of YUV format).
All images must have the same width, height and format (8-bit gray).
For every pixel:
lo = 128 - (128/boost); hi = 255 - lo; dst[x, y] = max(lo, min(hi, src[i]))*boost;
- Note
- This function has a C++ wrappers: Simd::TextureBoostedUv(const View<A>& src, uint8_t boost, View<A>& dst).
- Parameters
-
[in] src - a pointer to pixels data of source 8-bit gray image. [in] srcStride - a row size of source image. [in] width - an image width. [in] height - an image height. [in] boost - a boost coefficient. [out] dst - a pointer to pixels data of result image. [in] dstStride - a row size of destination image.
◆ SimdTextureGetDifferenceSum()
void SimdTextureGetDifferenceSum | ( | const uint8_t * | src, |
size_t | srcStride, | ||
size_t | width, | ||
size_t | height, | ||
const uint8_t * | lo, | ||
size_t | loStride, | ||
const uint8_t * | hi, | ||
size_t | hiStride, | ||
int64_t * | sum | ||
) |
Calculates difference between current image and background.
All images must have the same width, height and format (8-bit gray).
For every pixel:
sum += current - average(lo[i], hi[i]);
- Note
- This function has a C++ wrappers: Simd::TextureGetDifferenceSum(const View<A>& src, const View<A>& lo, const View<A>& hi, int64_t & sum).
- Parameters
-
[in] src - a pointer to pixels data of current image. [in] srcStride - a row size of current image. [in] width - an image width. [in] height - an image height. [in] lo - a pointer to pixels data of image with lower bound of background feature. [in] loStride - a row size of lo image. [in] hi - a pointer to pixels data of image with upper bound of background feature. [in] hiStride - a row size of hi image. [out] sum - a pointer to 64-bit integer with result sum.
◆ SimdTexturePerformCompensation()
void SimdTexturePerformCompensation | ( | const uint8_t * | src, |
size_t | srcStride, | ||
size_t | width, | ||
size_t | height, | ||
int32_t | shift, | ||
uint8_t * | dst, | ||
size_t | dstStride | ||
) |
Performs brightness compensation of input image.
All images must have the same width, height and format (8-bit gray).
For every pixel:
dst[i] = max(0, min(255, src[i] + shift));
- Note
- This function has a C++ wrappers: Simd::TexturePerformCompensation(const View<A>& src, int shift, View<A>& dst).
- Parameters
-
[in] src - a pointer to pixels data of input image. [in] srcStride - a row size of input image. [in] width - an image width. [in] height - an image height. [in] shift - a compensation shift. [out] dst - a pointer to pixels data of output image. [in] dstStride - a row size of output image.
◆ TextureBoostedSaturatedGradient()
void TextureBoostedSaturatedGradient | ( | const View< A > & | src, |
uint8_t | saturation, | ||
uint8_t | boost, | ||
View< A > & | dx, | ||
View< A > & | dy | ||
) |
Calculates boosted saturated gradients for given input image.
All images must have the same width, height and format (8-bit gray).
For border pixels:
dx[x, y] = 0; dy[x, y] = 0;
For other pixels:
dx[x, y] = (saturation + max(-saturation, min(saturation, (src[x + 1, y] - src[x - 1, y]))))*boost; dy[x, y] = (saturation + max(-saturation, min(saturation, (src[x, y + 1] - src[x, y - 1]))))*boost;
- Note
- This function is a C++ wrapper for function SimdTextureBoostedSaturatedGradient.
- Parameters
-
[in] src - a source 8-bit gray image. [in] saturation - a saturation of gradient. [in] boost - a boost coefficient. [out] dx - an image with boosted saturated gradient along x axis. [out] dy - an image with boosted saturated gradient along y axis.
◆ TextureBoostedUv()
Calculates boosted colorized texture feature of input image (actual for U and V components of YUV format).
All images must have the same width, height and format (8-bit gray).
For every pixel:
lo = 128 - (128/boost); hi = 255 - lo; dst[x, y] = max(lo, min(hi, src[i]))*boost;
- Note
- This function is a C++ wrapper for function SimdTextureBoostedUv.
- Parameters
-
[in] src - a source 8-bit gray image. [in] boost - a boost coefficient. [out] dst - a result image.
◆ TextureGetDifferenceSum()
void TextureGetDifferenceSum | ( | const View< A > & | src, |
const View< A > & | lo, | ||
const View< A > & | hi, | ||
int64_t & | sum | ||
) |
Calculates difference between current image and background.
All images must have the same width, height and format (8-bit gray).
For every pixel:
sum += current - average(lo[i], hi[i]);
- Note
- This function is a C++ wrapper for function SimdTextureGetDifferenceSum.
- Parameters
-
[in] src - a current image. [in] lo - an image with lower bound of background feature. [in] hi - an image with upper bound of background feature. [out] sum - a reference to 64-bit integer with result sum.
◆ TexturePerformCompensation()
Performs brightness compensation of input image.
All images must have the same width, height and format (8-bit gray).
For every pixel:
dst[i] = max(0, min(255, src[i] + shift));
- Note
- This function is a C++ wrapper for function SimdTexturePerformCompensation.
- Parameters
-
[in] src - an input image. [in] shift - a compensation shift. [out] dst - an output image.