Ocean
Ocean::CV::SumSquareDifferencesBase Class Reference

This class implements several sum square differences functions based e.g., on template parameters. More...

Inheritance diagram for Ocean::CV::SumSquareDifferencesBase:

Static Public Member Functions

template<unsigned int tChannels, unsigned int tPatchSize>
static OCEAN_FORCE_INLINE uint32_t patch8BitPerChannelTemplate (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 square 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 square 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 square 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 square 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 square differences between two individual buffers. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static IndexPair32 patchAtBorder8BitPerChannelTemplate (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 square differences between two square image patches which can be partially outside of the images. 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 square 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 *const image0, const uint8_t *const 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 square 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 square 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 square 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 square 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 square differences between two individual buffers. More...
 
static IndexPair32 patchAtBorder8BitPerChannel (const uint8_t *image0, const uint8_t *image1, const unsigned int channels, 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 square differences between two square image patches which can be partially outside of the images. More...
 

Detailed Description

This class implements several sum square differences functions based e.g., on template parameters.

Member Function Documentation

◆ buffer8BitPerChannel()

static uint32_t Ocean::CV::SumSquareDifferencesBase::buffer8BitPerChannel ( const uint8_t *const  buffer0,
const uint8_t *const  buffer1,
const unsigned int  bufferSize 
)
static

Returns the sum of square differences between two individual buffers.

Parameters
buffer0The first buffer, with size elements, must be valid
buffer1The second buffer, with size elements, must be valid
bufferSizeThe number of elements in each buffer, with range [1, infinity)
Returns
The sum of square differences between both buffers, with range [0, infinity)

◆ buffer8BitPerChannelTemplate()

template<unsigned int tBufferSize>
uint32_t Ocean::CV::SumSquareDifferencesBase::buffer8BitPerChannelTemplate ( const uint8_t *const  buffer0,
const uint8_t *const  buffer1 
)
inlinestatic

Returns the sum of square differences between two individual buffers.

Parameters
buffer0The first buffer, with tBufferSize elements, must be valid
buffer1The second buffer, with tBufferSize elements, must be valid
Returns
The resulting sum of square differences, with range [0, infinity)
Template Parameters
tBufferSizeThe number of elements in each buffer, with range [1, infinity)

◆ patch8BitPerChannel() [1/2]

OCEAN_FORCE_INLINE uint32_t Ocean::CV::SumSquareDifferencesBase::patch8BitPerChannel ( const uint8_t *const  image0,
const uint8_t *const  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 
)
static

Returns the sum of square differences between two square patches.

Parameters
image0The first image in which the first patch is located, must be valid
image1The second image in which the second patch is located, must be valid
width0Width of the first frame in pixels, with range [patchSize, infinity)
width1Width of the second frame in pixels, with range [patchSize, infinity)
channelsSpecifies the number of channels for the given frames, with range [1, infinity)
patchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd
centerX0Horizontal center position of the (patchSize x patchSize) block in the first frame, with range [patchSize / 2, width0 - patchSize / 2 - 1]
centerY0Vertical center position of the (patchSize x patchSize) block in the first frame, with range [patchSize / 2, height0 - patchSize / 2 - 1]
centerX1Horizontal center position of the (patchSize x patchSize) block in the second frame, with range [patchSize / 2, width1 - patchSize / 2 - 1]
centerY1Vertical center position of the (patchSize x patchSize) block in the second frame, with range [patchSize / 2, height1 - patchSize / 2 - 1]
image0PaddingElementsThe number of padding elements at the end of each first image, in elements, with range [0, infinity)
image1PaddingElementsThe number of padding elements at the end of each second image, in elements, with range [0, infinity)
Returns
The resulting sum of square differences for patchSize * patchSize * channels elements

◆ patch8BitPerChannel() [2/2]

static uint32_t Ocean::CV::SumSquareDifferencesBase::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 
)
static

Returns the sum of square differences between two square patches.

Parameters
patch0The top-left corner of the first image patch, must be valid
patch1The top-left corner of the second image patch, must be valid
channelsSpecifies the number of channels for the given frames, with range [1, infinity)
patchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd
patch0StrideElementsThe number of elements between two row starts in the first patch, in elements, with range [patchSize * channels, infinity)
patch1StrideElementsThe number of elements between two row starts in the second patch, in elements, with range [patchSize * channels, infinity)
Returns
The resulting sum of square differences for patchSize * patchSize * channels elements

◆ patch8BitPerChannelTemplate() [1/2]

template<unsigned int tChannels, unsigned int tPatchSize>
OCEAN_FORCE_INLINE uint32_t Ocean::CV::SumSquareDifferencesBase::patch8BitPerChannelTemplate ( 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 
)
static

Returns the sum of square differences between two square patches.

Parameters
image0The first image in which the first patch is located, must be valid
image1The second image in which the second patch is located, must be valid
width0Width of the first frame in pixels, with range [tPatchSize, infinity)
width1Width of the second 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]
centerX1Horizontal center position of the (tPatchSize x tPatchSize) block in the second frame, with range [tPatchSize / 2, width1 - tPatchSize / 2 - 1]
centerY1Vertical center position of the (tPatchSize x tPatchSize) block in the second frame, with range [tPatchSize / 2, height1 - tPatchSize / 2 - 1]
image0PaddingElementsThe number of padding elements at the end of each first image, in elements, with range [0, infinity)
image1PaddingElementsThe number of padding elements at the end of each second image, in elements, with range [0, infinity)
Returns
The resulting sum of square differences for tPatchSize * tPatchSize * tChannels elements
Template Parameters
tChannelsSpecifies the 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

◆ patch8BitPerChannelTemplate() [2/2]

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumSquareDifferencesBase::patch8BitPerChannelTemplate ( const uint8_t *  patch0,
const uint8_t *  patch1,
const unsigned int  patch0StrideElements,
const unsigned int  patch1StrideElements 
)
static

Returns the sum of square differences between two square patches.

Parameters
patch0The top-left corner of the first image patch, must be valid
patch1The top-left corner of the second image patch, must be valid
patch0StrideElementsThe number of elements between two row starts in the first patch, in elements, with range [tPatchSize * tChannels, infinity)
patch1StrideElementsThe number of elements between two row starts in the second patch, in elements, with range [tPatchSize * tChannels, infinity)
Returns
The resulting sum of square differences for tPatchSize * tPatchSize * tChannels elements
Template Parameters
tChannelsSpecifies the 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)

◆ patchAtBorder8BitPerChannel()

static IndexPair32 Ocean::CV::SumSquareDifferencesBase::patchAtBorder8BitPerChannel ( const uint8_t *  image0,
const uint8_t *  image1,
const unsigned int  channels,
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 
)
static

Returns the sum of square differences between two square image patches which can be partially outside of the images.

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
channelsThe number of frame channels, with range [1, infinity)
patchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd
width0The width of the first image, in pixels, with range [tPatchSize/2 + 1, infinity)
height0The height of the first image, in pixels, with range [tPatchSize/2 + 1, infinity)
width1The width of the second image, in pixels, with range [tPatchSize/2 + 1, infinity)
height1The height of the second image, in pixels, with range [tPatchSize/2 + 1, infinity)
centerX0Horizontal center position of the (tPatchSize x tPatchSize) block in the first frame, with range [0, width0 - 1]
centerY0Vertical center position of the (tPatchSize x tPatchSize) block in the first frame, with range [0, height0 - 1]
centerX1Horizontal center position of the (tPatchSize x tPatchSize) block in the second frame, with range [0, width1 - 1]
centerY1Vertical center position of the (tPatchSize x tPatchSize) block in the second frame, with range [0, height1 - 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
Pair holding the resulting ssd and the number of pixels which contributed to the ssd, an ssd of -1 if a patch0 pixel does not have a corresponding patch1 pixel

◆ patchAtBorder8BitPerChannelTemplate()

template<unsigned int tChannels, unsigned int tPatchSize>
IndexPair32 Ocean::CV::SumSquareDifferencesBase::patchAtBorder8BitPerChannelTemplate ( 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 
)
inlinestatic

Returns the sum of square differences between two square image patches which can be partially outside of the images.

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/2 + 1, infinity)
height0The height of the first image, in pixels, with range [tPatchSize/2 + 1, infinity)
width1The width of the second image, in pixels, with range [tPatchSize/2 + 1, infinity)
height1The height of the second image, in pixels, with range [tPatchSize/2 + 1, infinity)
centerX0Horizontal center position of the (tPatchSize x tPatchSize) block in the first frame, with range [0, width0 - 1]
centerY0Vertical center position of the (tPatchSize x tPatchSize) block in the first frame, with range [0, height0 - 1]
centerX1Horizontal center position of the (tPatchSize x tPatchSize) block in the second frame, with range [0, width1 - 1]
centerY1Vertical center position of the (tPatchSize x tPatchSize) block in the second frame, with range [0, height1 - 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
Pair holding the resulting ssd and the number of pixels which contributed to the ssd, an ssd of -1 if a patch0 pixel does not have a corresponding patch1 pixel
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() [1/2]

OCEAN_FORCE_INLINE uint32_t Ocean::CV::SumSquareDifferencesBase::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 
)
static

Returns the sum of square differences between a square image patch and a buffer.

Parameters
image0The image in which the image patch is located, must be valid
channelsThe number of channels for the given frames, with range [1, infinity)
patchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd
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 first image, in elements, with range [0, infinity)
buffer1The memory buffer with tChannels * tPatchSize * tPatchSize elements, must be valid
Returns
The resulting sum of square differences for tPatchSize * tPatchSize * tChannels elements, with range [0, infinity)

◆ patchBuffer8BitPerChannel() [2/2]

uint32_t Ocean::CV::SumSquareDifferencesBase::patchBuffer8BitPerChannel ( const uint8_t *  patch0,
const uint8_t *  buffer1,
unsigned int  channels,
unsigned int  patchSize,
const unsigned int  patch0StrideElements 
)
inlinestatic

Returns the sum of square differences between a square image patch and a buffer.

Parameters
patch0The top left start position of the image patch, must be valid
buffer1The memory buffer, must be valid
channelsThe number of channels for the given frames, with range [1, infinity)
patchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd
patch0StrideElementsThe number of elements between two rows for the image patch, in elements, with range [tChannels, tPatchSize, infinity)
Returns
The resulting sum of square differences for tPatchSize * tPatchSize * tChannels elements, with range [0, infinity)

◆ patchBuffer8BitPerChannelTemplate() [1/2]

template<unsigned int tChannels, unsigned int tPatchSize>
OCEAN_FORCE_INLINE uint32_t Ocean::CV::SumSquareDifferencesBase::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 
)
static

Returns the sum of square differences between a square image patch and a 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 first image, in elements, with range [0, infinity)
buffer1The memory buffer with tChannels * tPatchSize * tPatchSize elements, must be valid
Returns
The resulting sum of square 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

◆ patchBuffer8BitPerChannelTemplate() [2/2]

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumSquareDifferencesBase::patchBuffer8BitPerChannelTemplate ( const uint8_t *  patch0,
const uint8_t *  buffer1,
const unsigned int  patch0StrideElements 
)
static

Returns the sum of square differences between a square image patch and a buffer.

Parameters
patch0The top left start position of the image patch, must be valid
buffer1The memory buffer, must be valid
patch0StrideElementsThe number of elements between two rows for the image patch, in elements, with range [tChannels, tPatchSize, infinity)
Returns
The resulting sum of square 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

◆ patchMirroredBorder8BitPerChannelTemplate()

template<unsigned int tChannels>
uint32_t Ocean::CV::SumSquareDifferencesBase::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 
)
static

Returns the sum of square 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
patchSizeThe size of the square patch (the edge length) in pixel, with range [1, infinity), must be odd
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 square differences, with range [0, infinity)
Template Parameters
tChannelsSpecifies the number of channels for the given frames

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