Ocean
Ocean::CV::SumAbsoluteDifferences Class Reference

This class implements functions calculation the sum of absolute differences. More...

Inheritance diagram for Ocean::CV::SumAbsoluteDifferences:

Static Public Member Functions

template<unsigned int tChannels, unsigned int tPatchSize>
static uint32_t patch8BitPerChannel (const uint8_t *const image0, const uint8_t *const image1, const unsigned int width0, const unsigned int width1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements)
 Returns the sum of absolute differences between two square image patches. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static uint32_t patchBuffer8BitPerChannel (const uint8_t *const image0, const unsigned int width0, const unsigned int centerX0, const unsigned int centerY0, const unsigned int image0PaddingElements, const uint8_t *const buffer1)
 Returns the sum of absolute differences between an image patch and a memory buffer. More...
 
template<unsigned int tChannels, unsigned int tPixels>
static uint32_t buffer8BitPerChannel (const uint8_t *buffer0, const uint8_t *buffer1)
 Returns the sum of square differences between two memory buffers. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static uint32_t patchMirroredBorder8BitPerChannel (const uint8_t *image0, const uint8_t *image1, const unsigned int width0, const unsigned int height0, const unsigned int width1, const unsigned int height1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements)
 Returns the sum of absolute differences between two patches within an image, patch pixels outside the image will be mirrored back into the image. More...
 
template<typename T , unsigned int tChannels>
static void determine (const T *firstFrame, const T *secondFrame, const unsigned int width, const unsigned int height, typename AbsoluteDifferenceValueTyper< T >::Type *absoluteDifferences, const unsigned int firstFramePaddingElements, const unsigned int secondFramePaddingElements)
 Determines the sum of absolute differences between two individual frames, individually for each channel. More...
 
static bool determine (const Frame &firstFrame, const Frame &secondFrame, Indices32 &absoluteDifferences)
 Determines the sum of absolute differences between two individual frames, individually for each plane, and individually for each channel. More...
 
- Static Public Member Functions inherited from Ocean::CV::SumAbsoluteDifferencesBase
template<unsigned int tChannels, unsigned int tPatchSize>
static OCEAN_FORCE_INLINE uint32_t patch8BitPerChannelTemplate (const uint8_t *image0, const uint8_t *image1, const unsigned int width0, const unsigned int width1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements)
 Returns the sum of absolute differences between two square patches. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static uint32_t patch8BitPerChannelTemplate (const uint8_t *patch0, const uint8_t *patch1, const unsigned int patch0StrideElements, const unsigned int patch1StrideElements)
 Returns the sum of absolute differences between two square patches. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static OCEAN_FORCE_INLINE uint32_t patchBuffer8BitPerChannelTemplate (const uint8_t *image0, const unsigned int width0, const unsigned int centerX0, const unsigned int centerY0, const unsigned int image0PaddingElements, const uint8_t *buffer1)
 Returns the sum of absolute differences between a square image patch and a buffer. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static uint32_t patchBuffer8BitPerChannelTemplate (const uint8_t *patch0, const uint8_t *buffer1, const unsigned int patch0StrideElements)
 Returns the sum of absolute differences between a square image patch and a buffer. More...
 
template<unsigned int tBufferSize>
static uint32_t buffer8BitPerChannelTemplate (const uint8_t *const buffer0, const uint8_t *const buffer1)
 Returns the sum of absolute differences between two individual buffers. More...
 
template<unsigned int tChannels>
static uint32_t patchMirroredBorder8BitPerChannelTemplate (const uint8_t *image0, const uint8_t *image1, const unsigned int patchSize, const unsigned int width0, const unsigned int height0, const unsigned int width1, const unsigned int height1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements)
 Returns the sum of absolute differences between two patches within an image, patch pixels outside the image will be mirrored back into the image. More...
 
static OCEAN_FORCE_INLINE uint32_t patch8BitPerChannel (const uint8_t *image0, const uint8_t *image1, const unsigned int channels, const unsigned int patchSize, const unsigned int width0, const unsigned int width1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements)
 Returns the sum of absolute differences between two square patches. More...
 
static uint32_t patch8BitPerChannel (const uint8_t *patch0, const uint8_t *patch1, const unsigned int channels, const unsigned int patchSize, const unsigned int patch0StrideElements, const unsigned int patch1StrideElements)
 Returns the sum of absolute differences between two square patches. More...
 
static OCEAN_FORCE_INLINE uint32_t patchBuffer8BitPerChannel (const uint8_t *image0, unsigned int channels, unsigned int patchSize, const unsigned int width0, const unsigned int centerX0, const unsigned int centerY0, const unsigned int image0PaddingElements, const uint8_t *buffer1)
 Returns the sum of absolute differences between a square image patch and a buffer. More...
 
static uint32_t patchBuffer8BitPerChannel (const uint8_t *patch0, const uint8_t *buffer1, unsigned int channels, unsigned int patchSize, const unsigned int patch0StrideElements)
 Returns the sum of absolute differences between a square image patch and a buffer. More...
 
static uint32_t buffer8BitPerChannel (const uint8_t *const buffer0, const uint8_t *const buffer1, const unsigned int bufferSize)
 Returns the sum of absolute differences between two individual buffers. More...
 

Detailed Description

This class implements functions calculation the sum of absolute differences.

Member Function Documentation

◆ buffer8BitPerChannel()

template<unsigned int tChannels, unsigned int tPixels>
uint32_t Ocean::CV::SumAbsoluteDifferences::buffer8BitPerChannel ( const uint8_t *  buffer0,
const uint8_t *  buffer1 
)
inlinestatic

Returns the sum of square differences between two memory buffers.

Parameters
buffer0The first memory buffer, must be valid
buffer1The second memory buffer, must be valid
Returns
The resulting sum of square differences
Template Parameters
tChannelsThe number of channels the buffers have, with range [1, infinity)
tPixelsThe number of pixels the buffer holds, in pixels, with range [1, infinity)

◆ determine() [1/2]

bool Ocean::CV::SumAbsoluteDifferences::determine ( const Frame firstFrame,
const Frame secondFrame,
Indices32 absoluteDifferences 
)
inlinestatic

Determines the sum of absolute differences between two individual frames, individually for each plane, and individually for each channel.

Parameters
firstFrameThe first frame for which the absolute difference will be determined, must be valid, must have an element type of FrameType::DT_UNSIGNED_INTEGER_8.
secondFrameThe second frame for which the absolute difference will be determined, must be valid, must have the same frame type as 'firstFrame'
absoluteDifferencesThe resulting absolute differences, one for each plane and channel; first all differences for the first plane, then all differences for the second plane etc., with range [0, infinity)
Returns
True, if succeeded

◆ determine() [2/2]

template<typename T , unsigned int tChannels>
void Ocean::CV::SumAbsoluteDifferences::determine ( const T *  firstFrame,
const T *  secondFrame,
const unsigned int  width,
const unsigned int  height,
typename AbsoluteDifferenceValueTyper< T >::Type *  absoluteDifferences,
const unsigned int  firstFramePaddingElements,
const unsigned int  secondFramePaddingElements 
)
static

Determines the sum of absolute differences between two individual frames, individually for each channel.

Parameters
firstFrameThe first frame for which the absolute difference will be determined, must be valid
secondFrameThe second frame for which the absolute difference will be determined, must be valid
widthThe with of the first frame and second frame in pixel, with range [1, infinity)
heightThe height of the first frame and second frame in pixel, with range [1, infinity)
absoluteDifferencesThe resulting absolute differences, one for each channel, must be valid, with range [0, infinity)
firstFramePaddingElementsThe number of optional padding elements at the end of each row of the first frame, in elements, with range [0, infinity)
secondFramePaddingElementsThe number of optional padding elements at the end of each row of the second frame, in elements, with range [0, infinity)
Template Parameters
TThe data type of each pixel element, e.g., 'uint8_t' or 'float'
tChannelsThe number of frame channels, with range [1, infinity)

◆ patch8BitPerChannel()

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumAbsoluteDifferences::patch8BitPerChannel ( const uint8_t *const  image0,
const uint8_t *const  image1,
const unsigned int  width0,
const unsigned int  width1,
const unsigned int  centerX0,
const unsigned int  centerY0,
const unsigned int  centerX1,
const unsigned int  centerY1,
const unsigned int  image0PaddingElements,
const unsigned int  image1PaddingElements 
)
inlinestatic

Returns the sum of absolute differences between two square image patches.

Parameters
image0The image in which the first patch is located, must be valid
image1The image in which the second patch is located, must be valid
width0The width of the first image, in pixels, with range [tPatchSize, infinity)
width1The width of the second image, in pixels, with range [tPatchSize, infinity)
centerX0Horizontal center position of the (tPatchSize x tPatchSize) block in the first frame, with range [tPatchSize/2, width - tPatchSize/2 - 1]
centerY0Vertical center position of the (tPatchSize x tPatchSize) block in the first frame, with range [tPatchSize/2, height - tPatchSize/2 - 1]
centerX1Horizontal center position of the (tPatchSize x tPatchSize) block in the second frame, with range [tPatchSize/2, width - tPatchSize/2 - 1]
centerY1Vertical center position of the (tPatchSize x tPatchSize) block in the second frame, with range [tPatchSize/2, height - tPatchSize/2 - 1]
image0PaddingElementsThe number of padding elements at the end of each row of the first image, in elements, with range [0, infinity)
image1PaddingElementsThe number of padding elements at the end of each row of the second image, in elements, with range [0, infinity)
Returns
The resulting sum of square differences, with range [0, infinity)
Template Parameters
tChannelsThe number of frame channels, with range [1, infinity)
tPatchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd

◆ patchBuffer8BitPerChannel()

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumAbsoluteDifferences::patchBuffer8BitPerChannel ( const uint8_t *const  image0,
const unsigned int  width0,
const unsigned int  centerX0,
const unsigned int  centerY0,
const unsigned int  image0PaddingElements,
const uint8_t *const  buffer1 
)
inlinestatic

Returns the sum of absolute differences between an image patch and a memory buffer.

Parameters
image0The image in which the image patch is located, must be valid
width0Width of the first frame in pixels, with range [tPatchSize, infinity)
centerX0Horizontal center position of the (tPatchSize x tPatchSize) block in the first frame, with range [tPatchSize / 2, width0 - tPatchSize / 2 - 1]
centerY0Vertical center position of the (tPatchSize x tPatchSize) block in the first frame, with range [tPatchSize / 2, height0 - tPatchSize / 2 - 1]
image0PaddingElementsThe number of padding elements at the end of each row of the first image, in elements, with range [0, infinity)
buffer1The memory buffer with tChannels * tPatchSize * tPatchSize elements, must be valid
Returns
The resulting sum of absolute differences for tPatchSize * tPatchSize * tChannels elements, with range [0, infinity)
Template Parameters
tChannelsThe number of channels for the given frames, with range [1, infinity)
tPatchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd

◆ patchMirroredBorder8BitPerChannel()

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumAbsoluteDifferences::patchMirroredBorder8BitPerChannel ( const uint8_t *  image0,
const uint8_t *  image1,
const unsigned int  width0,
const unsigned int  height0,
const unsigned int  width1,
const unsigned int  height1,
const unsigned int  centerX0,
const unsigned int  centerY0,
const unsigned int  centerX1,
const unsigned int  centerY1,
const unsigned int  image0PaddingElements,
const unsigned int  image1PaddingElements 
)
static

Returns the sum of absolute differences between two patches within an image, patch pixels outside the image will be mirrored back into the image.

Parameters
image0The image in which the first patch is located, must be valid
image1The image in which the second patch is located, must be valid
width0The width of the first image, in pixels, with range [tPatchSize, infinity)
height0The height of the first image, in pixels, with range [tPatchSize, infinity)
width1The width of the second image, in pixels, with range [tPatchSize, infinity)
height1The height of the second image, in pixels, with range [tPatchSize, infinity)
centerX0Horizontal center position of the (tPatchSize x tPatchSize) block in the first frame, with range [tPatchSize/2, width - tPatchSize/2 - 1]
centerY0Vertical center position of the (tPatchSize x tPatchSize) block in the first frame, with range [tPatchSize/2, height - tPatchSize/2 - 1]
centerX1Horizontal center position of the (tPatchSize x tPatchSize) block in the second frame, with range [tPatchSize/2, width - tPatchSize/2 - 1]
centerY1Vertical center position of the (tPatchSize x tPatchSize) block in the second frame, with range [tPatchSize/2, height - tPatchSize/2 - 1]
image0PaddingElementsThe number of padding elements at the end of each row of the first image, in elements, with range [0, infinity)
image1PaddingElementsThe number of padding elements at the end of each row of the second image, in elements, with range [0, infinity)
Returns
The resulting sum of absolute differences, with range [0, infinity)
Template Parameters
tChannelsThe number of frame channels, with range [1, infinity)
tPatchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd

The documentation for this class was generated from the following file: