Ocean
Ocean::CV::SumSquareDifferences Class Reference

This class implements functions calculating the sum of square differences. More...

Inheritance diagram for Ocean::CV::SumSquareDifferences:

Public Member Functions

template<unsigned int tChannels, unsigned int tPatchSize>
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)
 

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 square differences between two square image patches. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static unsigned int 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 square differences between an image patch and a memory buffer. More...
 
template<unsigned int tChannels, unsigned int tPixels>
static uint32_t buffer8BitPerChannel (const uint8_t *const buffer0, const uint8_t *const buffer1)
 Returns the sum of square differences between two memory buffers. More...
 
template<unsigned int tChannels, unsigned int tPatchSize>
static IndexPair32 patchAtBorder8BitPerChannel (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, 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 square differences between two patches within an image, patch pixels outside the image will be mirrored back into the image. More...
 
- Static Public Member Functions inherited from Ocean::CV::SumSquareDifferencesBase
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 functions calculating the sum of square differences.

Member Function Documentation

◆ buffer8BitPerChannel()

template<unsigned int tChannels, unsigned int tPixels>
uint32_t Ocean::CV::SumSquareDifferences::buffer8BitPerChannel ( const uint8_t *const  buffer0,
const uint8_t *const  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)

◆ patch8BitPerChannel()

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumSquareDifferences::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 square 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

◆ patchAtBorder8BitPerChannel()

template<unsigned int tChannels, unsigned int tPatchSize>
IndexPair32 Ocean::CV::SumSquareDifferences::patchAtBorder8BitPerChannel ( 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]

template<unsigned int tChannels, unsigned int tPatchSize>
static unsigned int Ocean::CV::SumSquareDifferences::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 square 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 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

◆ patchBuffer8BitPerChannel() [2/2]

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumSquareDifferences::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 
)
inline

◆ patchMirroredBorder8BitPerChannel()

template<unsigned int tChannels, unsigned int tPatchSize>
uint32_t Ocean::CV::SumSquareDifferences::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 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
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
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: