Ocean
|
This class provides functions to create an integral image from a gray scale image. More...
Data Structures | |
class | Comfort |
The following comfort class provides comfortable functions simplifying prototyping applications but also increasing binary size of the resulting applications. More... | |
Public Member Functions | |
template<typename TIntegral > | |
TIntegral | linedIntegralSum (const TIntegral *const linedIntegral, const unsigned int linedIntegralStrideElements, const unsigned int windowLeft, const unsigned int windowTop, const unsigned int windowWidth, const unsigned int windowHeight) |
Static Public Member Functions | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createImage (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates an integral image from a given 1-plane image. More... | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createLinedImage (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates an integral image from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border. More... | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createLinedImageSquared (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates an integral image with squared pixel intensities from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border. More... | |
template<typename T , typename TIntegralAndSquared , unsigned int tChannels> | |
static void | createLinedImageAndSquared (const T *source, TIntegralAndSquared *integralAndSquared, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int integralAndSquaredPaddingElements) |
Creates an integral image and squared integral image from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border. More... | |
template<typename T , typename TIntegral , typename TIntegralSquared , unsigned int tChannels> | |
static void | createLinedImageAndSquared (const T *source, TIntegral *integral, TIntegralSquared *integralSquared, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements, const unsigned int integralSquaredPaddingElements) |
Creates an integral image and squared integral image from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border. More... | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createBorderedImage (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int border, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates a bordered integral image from a given 1-plane image and adds an extra border to the resulting integral image. More... | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createBorderedImageSquared (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int border, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates a bordered squared integral image from a given 1-plane image and adds an extra border to the resulting integral image. More... | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createBorderedImageMirror (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int border, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates a bordered integral image from a given 1-plane image and adds an extra border with mirrored image content to the resulting integral image. More... | |
template<typename T , typename TIntegral , unsigned int tChannels> | |
static void | createBorderedImageSquaredMirror (const T *source, TIntegral *integral, const unsigned int width, const unsigned int height, const unsigned int border, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates a bordered squared integral image from a given 1-plane image and adds an extra border with mirrored image content to the resulting integral image. More... | |
template<typename TIntegral > | |
static OCEAN_FORCE_INLINE TIntegral | linedIntegralSum (const TIntegral *const linedIntegral, const unsigned int linedIntegralStrideElements, const unsigned int windowLeft, const unsigned int windowTop, const unsigned int windowWidth, const unsigned int windowHeight) |
Determines the sum of elements within a window from an integral image. More... | |
template<typename TIntegral , typename TIntegralSquared , typename TVariance , bool tReturnMean = false> | |
static TVariance | linedIntegralVariance (const TIntegral *linedIntegral, const TIntegralSquared *linedIntegralSquared, const unsigned int integralStrideElements, const unsigned int integralStrideSquaredElements, const unsigned int windowLeft, const unsigned int windowTop, const unsigned int windowWidth, const unsigned int windowHeight, TVariance *mean=nullptr) |
Determines the variance of elements within a window from two integral images. More... | |
template<typename TIntegral , typename TIntegralSquared , typename TVariance , bool tReturnMean = false> | |
static TVariance | linedIntegralVariance (const TIntegral *linedIntegral, const TIntegralSquared *linedIntegralSquared, const unsigned int integralStrideElements, const unsigned int integralStrideSquaredElements, const unsigned int windowALeft, const unsigned int windowATop, const unsigned int windowAWidth, const unsigned int windowAHeight, const unsigned int windowBLeft, const unsigned int windowBTop, const unsigned int windowBWidth, const unsigned int windowBHeight, TVariance *mean=nullptr) |
Determines the variance of elements within two windows from two integral images. More... | |
template<typename TIntegral , typename TIntegralSquared , typename TVariance , bool tReturnMean = false> | |
static TVariance | linedIntegralVariance (const TIntegral *linedIntegral, const TIntegralSquared *linedIntegralSquared, const unsigned int integralStrideElements, const unsigned int integralStrideSquaredElements, const unsigned int windowALeft, const unsigned int windowATop, const unsigned int windowAWidth, const unsigned int windowAHeight, const unsigned int windowBLeft, const unsigned int windowBTop, const unsigned int windowBWidth, const unsigned int windowBHeight, const unsigned int windowCLeft, const unsigned int windowCTop, const unsigned int windowCWidth, const unsigned int windowCHeight, TVariance *mean=nullptr) |
Determines the variance of elements within three windows from two integral images. More... | |
Static Private Member Functions | |
static void | createLinedImage1Channel8BitNEON (const uint8_t *source, uint32_t *integral, const unsigned int width, const unsigned int height, const unsigned int sourcePaddingElements, const unsigned int integralPaddingElements) |
Creates an integral image from 8 bit images with 1 channel and adds an extra line with zeros to the left and top image border and applies NEON instructions. More... | |
template<typename T , typename TSquared > | |
static TSquared | sqr (const T &value) |
Returns the square value of the given parameter. More... | |
This class provides functions to create an integral image from a gray scale image.
|
static |
Creates a bordered integral image from a given 1-plane image and adds an extra border to the resulting integral image.
In case, the given frame has more than one channel, the channels of the resulting integral image will be interleaved (not stored as individual planes).
The resulting integral image has a (non interfering) border.
The bordered integral image has the following scheme:
------------------------- --------- |0000000000000000000000000| | |0|-----------------------| | |0| | | | | |0| 0 | 0 | 0 | | |0| | | | | |0|-----|-----------|-----| | |0| | | > | | |0| | | > | | |0| 0 | Integral | > | padding | |0| | | > | | |0| | | > | | |0|-----|-----------|-----| | |0| | | | | |0| 0 | V | V | | |0| | | | | -----------------------------------
Columns or rows with '0' receive a null value.
Rows with '>' receive the last valid integral value from the left.
Rows with 'v' receive the last valid integral value from the top.
Further, additionally to the border, the integral image contains one column at the left border and one row at the top border with zeros.
Therefore, the entire integral image width is: 1 + 2 * border + originalWidth,
and the entire height is: 1 + 2 * border + originalHeight.
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (width + 1 + 2 * border)x(height + 1 + 2 * border), must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
border | The thickness of the border in pixel, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
This is the resulting bordered integral image. Columns or rows with '0' receive a null value. Rows with '>' receive the last valid integral value from the left
|0000000000000000000000000| |0|--------------------—| |0| | | | |0| 0 | 0 | 0 | |0| | | | |0|--—|--------—|--—| |0| | | > | |0| | | > | |0| 0 | Integral | > | |0| | | > | |0| | | > | |0|--—|--------—|--—| |0| | | | |0| 0 | V | V |
|
static |
Creates a bordered integral image from a given 1-plane image and adds an extra border with mirrored image content to the resulting integral image.
The resulting integral image has an extra border created from the original frame with mirrored border pixels.
Additionally, independent from the border size, the integral image contains one column at the left border and one row at the top border with zeros.
Therefore, the entire integral image width is: 1 + 2 * border + originalWidth,
and the entire height is: 1 + 2 * border + originalHeight.
The bordered integral image has the following scheme:
------------------------- --------- |0000000000000000000000000| | |0|-----------------------| | |0| | | | | |0| m | mirrored | m | | |0| | | | | |0|-----|-----------|-----| | |0| | | | | |0| | | | | |0| m | Integral | m | padding | |0| | | | | |0| | | | | |0|-----|-----------|-----| | |0| | | | | |0| m | mirrored | m | | |0| | | | | -----------------------------------
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (1 + border + width)x(1 + border + height), must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
border | The thickness of the border in pixel, with range [1, min(width, height)] |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
This is the resulting bordered integral image.
|0000000000000000000000000| |0|--------------------—| |0| | | | |0| m | mirrored | m | |0| | | | |0|--—|--------—|--—| |0| | | | |0| | | | |0| m | Integral | m | |0| | | | |0| | | | |0|--—|--------—|--—| |0| | | | |0| m | mirrored | m |
|
static |
Creates a bordered squared integral image from a given 1-plane image and adds an extra border to the resulting integral image.
In case, the given frame has more than one channel, the channels of the resulting integral image will be interleaved (not stored as individual planes).
The resulting integral image has a (non interfering) border.
The bordered integral image has the following scheme:
-------------------------- --------- |00000000000000000000000000| | |0|------------------------| | |0| | | | | |0| 0 | 0 | 0 | | |0| | | | | |0|-----|------------|-----| | |0| | | > | | |0| | | > | | |0| 0 | Integral^2 | > | padding | |0| | | > | | |0| | | > | | |0|-----|------------|-----| | |0| | | | | |0| 0 | V | V | | |0| | | | | ------------------------------------
Columns or rows with '0' receive a null value.
Rows with '>' receive the last valid integral value from the left.
Rows with 'v' receive the last valid integral value from the top.
Further, additionally to the border, the integral image contains one column at the left border and one row at the top border with zeros.
Therefore, the entire integral image width is: 1 + 2 * border + originalWidth,
and the entire height is: 1 + 2 * border + originalHeight.
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (width + 1)x(height + 1), must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
border | The thickness of the border in pixel, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
This is the resulting bordered integral image. Columns or rows with '0' receive a null value. Rows with '>' receive the last valid integral value from the left
|00000000000000000000000000| |0|---------------------—| |0| | | | |0| 0 | 0 | 0 | |0| | | | |0|--—|---------—|--—| |0| | | > | |0| | | > | |0| 0 | Integral^2 | > | |0| | | > | |0| | | > | |0|--—|---------—|--—| |0| | | | |0| 0 | V | V |
|
static |
Creates a bordered squared integral image from a given 1-plane image and adds an extra border with mirrored image content to the resulting integral image.
The resulting integral image has an extra border created from the original frame with mirrored border pixels.
Additionally, independent from the border size, the integral image contains one column at the left border and one row at the top border with zeros.
Therefore, the entire integral image width is: 1 + 2 * border + originalWidth,
and the entire height is: 1 + 2 * border + originalHeight.
The bordered integral image has the following scheme:
------------------------------- --------- |0000000000000000000000000000000| | |0|-----------------------------| | |0| | | | | |0| m^2 | mirrored^2 | m^2 | | |0| | | | | |0|-------|-------------|-------| | |0| | | | | |0| | | | | |0| m^2 | Integral^2 | m^2 | padding | |0| | | | | |0| | | | | |0|-------|-------------|-------| | |0| | | | | |0| m^2 | mirrored^2 | m^2 | | |0| | | | | -----------------------------------------
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (1 + border + width)x(1 + border + height), must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
border | The thickness of the border in pixel, with range [1, min(width, height)] |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
This is the resulting bordered integral image.
|0000000000000000000000000000000| |0|--------------------------—| |0| | | | |0| m^2 | mirrored^2 | m^2 | |0| | | | |0|----—|----------—|----—| |0| | | | |0| | | | |0| m^2 | Integral^2 | m^2 | |0| | | | |0| | | | |0|----—|----------—|----—| |0| | | | |0| m^2 | mirrored^2 | m^2 |
|
static |
Creates an integral image from a given 1-plane image.
The resulting integral image will have the same resolution as the given image (without any extra borders).
In case, the given frame has more than one channel, the channels of the resulting integral image will be interleaved (not stored as individual planes).
The resulting integral image has the following scheme:
---------- --------- | | | | Integral | padding | | | | ---------- ---------
The resolution of the integral image is: width x height.
source | The source frame for which the integral image will be created, must be valid |
integral | The target integral image, must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
|
static |
Creates an integral image from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border.
In case, the given frame has more than one channel, the channels of the resulting integral image will be interleaved (not stored as individual planes).
The resulting lined integral image has the following scheme:
------------ --------- |000000000000| | |0|----------| | |0| | padding | |0| Integral | | |0| | | ------------ ---------
The resolution of the integral image is: (width + 1)x(height + 1).
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (width + 1)x(height + 1), must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
|
staticprivate |
Creates an integral image from 8 bit images with 1 channel and adds an extra line with zeros to the left and top image border and applies NEON instructions.
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (width + 1)x(height + 1), must be valid |
width | The width of the given image in pixel, with range [8, 4096^2] |
height | The height of the given image in pixel, with range [1, 4096^2 / width] |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
|
static |
Creates an integral image and squared integral image from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border.
The result are two individual integral images, one for the pixel intensities and one for the squared pixel intensities.
The resulting lined integral images have the following scheme:
Integral image: Integral squared image: ---------------- --------- ------------------------ --------- |0000000000000000| | |000000000000000000000000| | |00|-------------| | |00|---------------------| | |00| | padding | |00| | padding | |00| I0 I1 I0 I1 | | |00| I0^2 I1^2 I0^2 I1^2 | | |00| | | |00| | | ---------------- --------- ------------------------ --------- With I0 integral value of the first channel, I1 integral value of the second channel, I0^2 integral squared value of the first channel, I1^2 integral squared value of the second channel.
The resolution of the integral image are: (width + 1)x(height + 1).
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (width + 1)x(height + 1), must be valid |
integralSquared | The resulting squared integral image, with size (width + 1)x(height + 1), must be valid |
width | The width of the source frame in pixel, with range [1, infinity) |
height | The height of the source frame in pixel, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
integralSquaredPaddingElements | The number of padding elements at the end of each row of the integral squared frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
TIntegralSquared | The data type of each squared integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
|
static |
Creates an integral image and squared integral image from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border.
The resulting integral image provides access to pixel intensities and squared pixel intensities.
Beware: As the same data type is used for both integral data, the depth of the data type must be large enough, or the image resolution must be small enough to avoid overflows.
Pixel intensities and squared pixel intensities are interleaved so that both values can be looked-up at the same memory location.
In case, the given frame has more than one channel, the channels of the resulting integral image will be interleaved (not stored as individual planes).
The resulting lined integral image has the following scheme:
------------------------------------ --------- |000000000000000000000000000000000000| | |00|---------------------------------| | |00| | padding | |00| I0 I1 I0^2 I1^2 I0 I1 I0^2 I1^2 | | |00| | | ------------------------------------ --------- With I0 integral value of the first channel, I1 integral value of the second channel, I0^2 integral squared value of the first channel, I1^2 integral squared value of the second channel.
The resolution of the integral image is: ((width + 1) * 2)x(height + 1).
source | The image for which the integral image will be determined, with size width x height, must be valid |
integralAndSquared | The resulting integral (and squared integral) image, with size ((width + 1) * 2)x(height + 1), must be valid |
width | The width of the source frame in pixel, with range [1, infinity) |
height | The height of the source frame in pixel, with range [1, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralAndSquaredPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegralAndSquared | The data type of each integral (and squared integral) pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
|
static |
Creates an integral image with squared pixel intensities from a given 1-plane image and adds an extra line (one column and one row) with zeros to the left and top image border.
In case, the given frame has more than one channel, the channels of the resulting integral image will be interleaved (not stored as individual planes).
The resulting lined integral image has the following scheme:
-------------- --------- |00000000000000| | |0|------------| | |0| | padding | |0| Integral^2 | | |0| | | -------------- ---------
The resolution of the integral image is: (width + 1)x(height + 1).
source | The image for which the integral image will be determined, with size width x height, must be valid |
integral | The resulting integral image, with size (width + 1)x(height + 1), must be valid |
width | The width of the source frame in pixel, with range [0, infinity) |
height | The height of the source frame in pixel, with range [0, infinity) |
sourcePaddingElements | The number of padding elements at the end of each row of the source frame, in elements, with range [0, infinity) |
integralPaddingElements | The number of padding elements at the end of each row of the integral frame, in elements, with range [0, infinity) |
T | The data type of each pixel element of the source frame e.g., 'uint8_t' or 'float' |
TIntegral | The data type of each integral pixel element, e.g., 'unsigned int' or 'double' |
tChannels | The number of channels the source frame has, with range [1, infinity) |
|
static |
Determines the sum of elements within a window from an integral image.
The lined integral image must have the following scheme:
integralStrideElements |<------------------------>| ---------------- --------- |0000000000000000| | |0|--------------| | |0| | padding | |0| Integral | | |0| | | ----------------- --------- |<------------>| original width |<-------------->| lined integral width
linedIntegral | The lined integral image, must be valid |
linedIntegralStrideElements | The number of elements between two row start positions in the lined integral image, in elements, may contain padding elements at the end of each row, with range [originalImageWidth + 1, infinity) |
windowLeft | The left starting point of the window, in pixel, with range [0, originalImageWidth - 1] |
windowTop | The top starting point of the window, in pixel, with range [0, originalImageHeight - 1] |
windowWidth | The width of the window, in pixel, with range [1, originalImageWidth - windowLeft] |
windowHeight | The height of the window, in pixel, with range [1, originalImageHeight - windowTop] |
TIntegral | The data type of the elements in the integral image |
|
inline |
|
inlinestatic |
Determines the variance of elements within three windows from two integral images.
The three windows are treated as one joined area.
linedIntegral | The lined integral image, must be valid |
linedIntegralSquared | The lined integral image with squared values, must be valid |
integralStrideElements | The number of elements between two row starts in the lined integral image, in elements, may contain padding elements at the end of each row, with range [2, infinity) |
integralStrideSquaredElements | The number of elements between two row starts in the lined integral squared image, in elements, may contain padding elements at the end of each row, with range [2, infinity) |
windowALeft | The left starting point of the first window, in pixel, with range [0, originalImageWidth - 1] |
windowATop | The top starting point of the first window, in pixel, with range [0, originalImageHeight - 1] |
windowAWidth | The width of the first window, in pixel, with range [1, originalImageWidth - windowALeft] |
windowAHeight | The height of the first window, in pixel, with range [1, originalImageHeight - windowATop] |
windowBLeft | The left starting point of the second window, in pixel, with range [0, originalImageWidth - 1] |
windowBTop | The top starting point of the second window, in pixel, with range [0, originalImageHeight - 1] |
windowBWidth | The width of the second window, in pixel, with range [1, originalImageWidth - windowBLeft] |
windowBHeight | The height of the second window, in pixel, with range [1, originalImageHeight - windowBTop] |
windowCLeft | The left starting point of the third window, in pixel, with range [0, originalImageWidth - 1] |
windowCTop | The top starting point of the third window, in pixel, with range [0, originalImageHeight - 1] |
windowCWidth | The width of the third window, in pixel, with range [1, originalImageWidth - windowCLeft] |
windowCHeight | The height of the third window, in pixel, with range [1, originalImageHeight - windowCTop] |
mean | Optional resulting mean value and (tReturnMean = true ), nullptr otherwise (and tReturnMean = false ) |
TIntegral | The data type of the elements in the integral image |
TIntegralSquared | The data type of the elements in the integral squared image |
TVariance | The data type of the resulting variance (also used for intermediate calculations) |
tReturnMean | True, to return the mean value (mean must be defined); False, to skip calculating of mean (mean must be nullptr) |
|
inlinestatic |
Determines the variance of elements within two windows from two integral images.
The two windows are treated as one joined area.
Variance is calculated based on the following equation:
Var(x) = E[(x - E[x])^2] = E[x^2] - E[x]^2
The variance is determined based on the standard lined integral image and the lined integral image for squared values.
The lined integral image must have the following scheme:
integralStrideElements integralSquaredStrideElements |<------------------------>| |<------------------------------>| ---------------- --------- -------------------- ----------- |0000000000000000| | |00000000000000000000| | |0|--------------| | |0|------------------| | |0| | padding | |0| | padding | |0| Integral | | |0| Integral^2 | | |0| | | |0| | | ----------------- --------- -------------------- ----------- |<------------>| |<---------------->| original width original width |<-------------->| |<------------------>| lined integral width lined integral squared width
linedIntegral | The lined integral image, must be valid |
linedIntegralSquared | The lined integral image with squared values, must be valid |
integralStrideElements | The number of elements between two row starts in the lined integral image, in elements, may contain padding elements at the end of each row, with range [2, infinity) |
integralStrideSquaredElements | The number of elements between two row starts in the lined integral squared image, in elements, may contain padding elements at the end of each row, with range [2, infinity) |
windowALeft | The left starting point of the first window, in pixel, with range [0, originalImageWidth - 1] |
windowATop | The top starting point of the first window, in pixel, with range [0, originalImageHeight - 1] |
windowAWidth | The width of the first window, in pixel, with range [1, originalImageWidth - windowALeft] |
windowAHeight | The height of the first window, in pixel, with range [1, originalImageHeight - windowATop] |
windowBLeft | The left starting point of the second window, in pixel, with range [0, originalImageWidth - 1] |
windowBTop | The top starting point of the second window, in pixel, with range [0, originalImageHeight - 1] |
windowBWidth | The width of the second window, in pixel, with range [1, originalImageWidth - windowBLeft] |
windowBHeight | The height of the second window, in pixel, with range [1, originalImageHeight - windowBTop] |
mean | Optional resulting mean value and (tReturnMean = true ), nullptr otherwise (and tReturnMean = false ) |
TIntegral | The data type of the elements in the integral image |
TIntegralSquared | The data type of the elements in the integral squared image |
TVariance | The data type of the resulting variance (also used for intermediate calculations) |
tReturnMean | True, to return the mean value (mean must be defined); False, to skip calculating of mean (mean must be nullptr) |
|
inlinestatic |
Determines the variance of elements within a window from two integral images.
Variance is calculated based on the following equation:
Var(x) = E[(x - E[x])^2] = E[x^2] - E[x]^2
The variance is determined based on the standard lined integral image and the lined integral image for squared values.
The lined integral image must have the following scheme:
integralStrideElements integralSquaredStrideElements |<------------------------>| |<------------------------------>| ---------------- --------- -------------------- ----------- |0000000000000000| | |00000000000000000000| | |0|--------------| | |0|------------------| | |0| | padding | |0| | padding | |0| Integral | | |0| Integral^2 | | |0| | | |0| | | ----------------- --------- -------------------- ----------- |<------------>| |<---------------->| original width original width |<-------------->| |<------------------>| lined integral width lined integral squared width
linedIntegral | The lined integral image, must be valid |
linedIntegralSquared | The lined integral image with squared values, must be valid |
integralStrideElements | The number of elements between two row starts in the lined integral image, in elements, may contain padding elements at the end of each row, with range [2, infinity) |
integralStrideSquaredElements | The number of elements between two row starts in the lined integral squared image, in elements, may contain padding elements at the end of each row, with range [2, infinity) |
windowLeft | The left starting point of the window, in pixel, with range [0, originalImageWidth - 1] |
windowTop | The top starting point of the window, in pixel, with range [0, originalImageHeight - 1] |
windowWidth | The width of the window, in pixel, with range [1, originalImageWidth - windowLeft] |
windowHeight | The height of the window, in pixel, with range [1, originalImageHeight - windowTop] |
mean | Optional resulting mean value and (tReturnMean = true ), nullptr otherwise (and tReturnMean = false ) |
TIntegral | The data type of the elements in the integral image |
TIntegralSquared | The data type of the elements in the integral squared image |
TVariance | The data type of the resulting variance (also used for intermediate calculations) |
tReturnMean | True, to return the mean value (mean must be defined); False, to skip calculating of mean (mean must be nullptr) |
|
inlinestaticprivate |
Returns the square value of the given parameter.
value | The value to be squared |
T | The data type of the value to be squared |
TSquared | The data type of the squared value |