Simd Library Documentation.

Home | Release Notes | Download | Documentation | Forum | SourceForge | GitHub
Histogram

Functions for estimation of image histogram. More...

Functions

SIMD_API void SimdAbsSecondDerivativeHistogram (const uint8_t *src, size_t width, size_t height, size_t stride, size_t step, size_t indent, uint32_t *histogram)
 Calculates histogram of second derivative for 8-bit gray image. More...
 
SIMD_API void SimdHistogram (const uint8_t *src, size_t width, size_t height, size_t stride, uint32_t *histogram)
 Calculates histogram for 8-bit gray image. More...
 
SIMD_API void SimdHistogramMasked (const uint8_t *src, size_t srcStride, size_t width, size_t height, const uint8_t *mask, size_t maskStride, uint8_t index, uint32_t *histogram)
 Calculates histogram for 8-bit gray image with using mask. More...
 
SIMD_API void SimdHistogramConditional (const uint8_t *src, size_t srcStride, size_t width, size_t height, const uint8_t *mask, size_t maskStride, uint8_t value, SimdCompareType compareType, uint32_t *histogram)
 Calculates histogram of 8-bit gray image for those points when mask points satisfying certain condition. More...
 
SIMD_API void SimdNormalizeHistogram (const uint8_t *src, size_t srcStride, size_t width, size_t height, uint8_t *dst, size_t dstStride)
 Normalizes histogram for 8-bit gray image. More...
 
template<template< class > class A>
SIMD_INLINE void AbsSecondDerivativeHistogram (const View< A > &src, size_t step, size_t indent, uint32_t *histogram)
 Calculates histogram of second derivative for 8-bit gray image. More...
 
template<template< class > class A>
SIMD_INLINE void Histogram (const View< A > &src, uint32_t *histogram)
 Calculates histogram for 8-bit gray image. More...
 
template<template< class > class A>
SIMD_INLINE void HistogramMasked (const View< A > &src, const View< A > &mask, uint8_t index, uint32_t *histogram)
 Calculates histogram for 8-bit gray image with using mask. More...
 
template<template< class > class A>
SIMD_INLINE void HistogramConditional (const View< A > &src, const View< A > &mask, uint8_t value, SimdCompareType compareType, uint32_t *histogram)
 Calculates histogram of 8-bit gray image for those points when mask points satisfying certain condition. More...
 
template<template< class > class A>
SIMD_INLINE void NormalizeHistogram (const View< A > &src, View< A > &dst)
 Normalizes histogram for 8-bit gray image. More...
 

Detailed Description

Functions for estimation of image histogram.

Function Documentation

void SimdAbsSecondDerivativeHistogram ( const uint8_t *  src,
size_t  width,
size_t  height,
size_t  stride,
size_t  step,
size_t  indent,
uint32_t *  histogram 
)

Calculates histogram of second derivative for 8-bit gray image.

For all points except the boundary (defined by parameter indent):

dx = abs(src[x, y] - average(src[x+step, y], src[x-step, y]));
dy = abs(src[x, y] - average(src[x, y+step], src[x, y-step]));
histogram[max(dx, dy)]++;
Note
This function has a C++ wrapper Simd::AbsSecondDerivativeHistogram(const View<A>& src, size_t step, size_t indent, uint32_t * histogram).
Parameters
[in]src- a pointer to pixels data of input 8-bit gray image.
[in]width- an image width.
[in]height- an image height.
[in]stride- a row size of the image.
[in]step- a step for second derivative calculation.
[in]indent- a indent from image boundary.
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void SimdHistogram ( const uint8_t *  src,
size_t  width,
size_t  height,
size_t  stride,
uint32_t *  histogram 
)

Calculates histogram for 8-bit gray image.

For all points:

histogram[src[i]]++.
Note
This function has a C++ wrapper Simd::Histogram(const View<A>& src, uint32_t * histogram).
Parameters
[in]src- a pointer to pixels data of input 8-bit gray image.
[in]width- an image width.
[in]height- an image height.
[in]stride- a row size of the image.
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void SimdHistogramMasked ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
const uint8_t *  mask,
size_t  maskStride,
uint8_t  index,
uint32_t *  histogram 
)

Calculates histogram for 8-bit gray image with using mask.

For every point:

if(mask[i] == index)
    histogram[src[i]]++.
Note
This function has a C++ wrapper Simd::HistogramMasked(const View<A> & src, const View<A> & mask, uint8_t index, uint32_t * histogram).
Parameters
[in]src- a pointer to pixels data of input 8-bit gray image.
[in]srcStride- a row size of the image.
[in]width- an image width.
[in]height- an image height.
[in]mask- a pointer to pixels data of the mask 8-bit image.
[in]maskStride- a row size of the mask image.
[in]index- a mask index.
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void SimdHistogramConditional ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
const uint8_t *  mask,
size_t  maskStride,
uint8_t  value,
SimdCompareType  compareType,
uint32_t *  histogram 
)

Calculates histogram of 8-bit gray image for those points when mask points satisfying certain condition.

For every point:

if(compare(mask[x, y], value))
    histogram[src[x, y]]++.
Note
This function has a C++ wrapper Simd::HistogramConditional(const View<A>& src, const View<A>& mask, uint8_t value, SimdCompareType compareType, uint32_t * histogram).
Parameters
[in]src- a pointer to pixels data of input 8-bit gray image.
[in]srcStride- a row size of the image.
[in]width- an image width.
[in]height- an image height.
[in]mask- a pointer to pixels data of the mask 8-bit image.
[in]maskStride- a row size of the mask image.
[in]value- a second value for compare operation.
[in]compareType- a compare operation type (see SimdCompareType).
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void SimdNormalizeHistogram ( const uint8_t *  src,
size_t  srcStride,
size_t  width,
size_t  height,
uint8_t *  dst,
size_t  dstStride 
)

Normalizes histogram for 8-bit gray image.

The input and output 8-bit gray images must have the same size.

Note
This function has a C++ wrapper Simd::NormalizeHistogram(const View<A> & src, View<A> & dst).
Parameters
[in]src- a pointer to pixels data of input 8-bit gray image.
[in]srcStride- a row size of the image.
[in]width- an image width.
[in]height- an image height.
[out]dst- a pointer to pixels data of output 8-bit image with normalized histogram.
[in]dstStride- a row size of the output image.
void AbsSecondDerivativeHistogram ( const View< A > &  src,
size_t  step,
size_t  indent,
uint32_t *  histogram 
)

Calculates histogram of second derivative for 8-bit gray image.

For all points except the boundary (defined by parameter indent):

dx = abs(src[x, y] - average(src[x+step, y], src[x-step, y]));
dy = abs(src[x, y] - average(src[x, y+step], src[x, y-step]));
histogram[max(dx, dy)]++;
Note
This function is a C++ wrapper for function SimdAbsSecondDerivativeHistogram.
Parameters
[in]src- an input 8-bit gray image.
[in]step- a step for second derivative calculation.
[in]indent- a indent from image boundary.
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void Histogram ( const View< A > &  src,
uint32_t *  histogram 
)

Calculates histogram for 8-bit gray image.

For all points:

histogram[src[i]]++.
Note
This function is a C++ wrapper for function SimdHistogram.
Parameters
[in]src- an input 8-bit gray image.
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void HistogramMasked ( const View< A > &  src,
const View< A > &  mask,
uint8_t  index,
uint32_t *  histogram 
)

Calculates histogram for 8-bit gray image with using mask.

For every point:

if(mask[i] == index)
    histogram[src[i]]++.
Note
This function is a C++ wrapper for function SimdHistogramMasked.
Parameters
[in]src- an input 8-bit gray image.
[in]mask- a mask 8-bit image.
[in]index- a mask index.
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void HistogramConditional ( const View< A > &  src,
const View< A > &  mask,
uint8_t  value,
SimdCompareType  compareType,
uint32_t *  histogram 
)

Calculates histogram of 8-bit gray image for those points when mask points satisfying certain condition.

For every point:

if(compare(mask[x, y], value))
    histogram[src[x, y]]++.
Note
This function is a C++ wrapper for function SimdHistogramConditional.
Parameters
[in]src- an input 8-bit gray image.
[in]mask- a mask 8-bit image.
[in]value- a second value for compare operation.
[in]compareType- a compare operation type (see SimdCompareType).
[out]histogram- a pointer to histogram (array of 256 unsigned 32-bit values).
void NormalizeHistogram ( const View< A > &  src,
View< A > &  dst 
)

Normalizes histogram for 8-bit gray image.

The input and output 8-bit gray images must have the same size.

Note
This function is a C++ wrapper for function SimdNormalizeHistogram.
Parameters
[in]src- an input 8-bit gray image.
[out]dst- an output 8-bit image with normalized histogram.