Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Difference Estimation

Functions for estimation of difference between current frame and background. More...

Functions

SIMD_API void SimdAddFeatureDifference (const uint8_t *value, size_t valueStride, size_t width, size_t height, const uint8_t *lo, size_t loStride, const uint8_t *hi, size_t hiStride, uint16_t weight, uint8_t *difference, size_t differenceStride)
 Adds feature difference to common difference sum. More...
 
template<template< class > class A>
SIMD_INLINE void AddFeatureDifference (const View< A > &value, const View< A > &lo, const View< A > &hi, uint16_t weight, View< A > &difference)
 Adds feature difference to common difference sum. More...
 

Detailed Description

Functions for estimation of difference between current frame and background.

Function Documentation

◆ SimdAddFeatureDifference()

void SimdAddFeatureDifference ( const uint8_t *  value,
size_t  valueStride,
size_t  width,
size_t  height,
const uint8_t *  lo,
size_t  loStride,
const uint8_t *  hi,
size_t  hiStride,
uint16_t  weight,
uint8_t *  difference,
size_t  differenceStride 
)

Adds feature difference to common difference sum.

All images must have the same width, height and format (8-bit gray).

For every point:

excess = max(lo[i] - value[i], 0) + max(value[i] - hi[i], 0);
difference[i] += (weight * excess*excess) >> 16;

This function is used for difference estimation in algorithm of motion detection.

Note
This function has a C++ wrapper Simd::AddFeatureDifference(const View<A>& value, const View<A>& lo, const View<A>& hi, uint16_t weight, View<A>& difference).
Parameters
[in]value- a pointer to pixels data of current feature value.
[in]valueStride- a row size of the value image.
[in]width- an image width.
[in]height- an image height.
[in]lo- a pointer to pixels data of feature lower bound of dynamic background.
[in]loStride- a row size of the lo image.
[in]hi- a pointer to pixels data of feature upper bound of dynamic background.
[in]hiStride- a row size of the hi image.
[in]weight- a current feature weight (unsigned 16-bit value).
[in,out]difference- a pointer to pixels data of image with total difference.
[in]differenceStride- a row size of difference image.

◆ AddFeatureDifference()

void AddFeatureDifference ( const View< A > &  value,
const View< A > &  lo,
const View< A > &  hi,
uint16_t  weight,
View< A > &  difference 
)

Adds feature difference to common difference sum.

All images must have the same width, height and format (8-bit gray).

For every point:

excess = max(lo[i] - value[i], 0) + max(value[i] - hi[i], 0);
difference[i] += (weight * excess*excess) >> 16;

This function is used for difference estimation in algorithm of motion detection.

Note
This function is a C++ wrapper for function SimdAddFeatureDifference.
Parameters
[in]value- a current feature value.
[in]lo- a feature lower bound of dynamic background.
[in]hi- a feature upper bound of dynamic background.
[in]weight- a current feature weight (unsigned 16-bit value).
[in,out]difference- an image with total difference.