8#ifndef META_OCEAN_CV_ADVANCED_SUM_SQUARE_DIFFERENCES_NO_CENTER_NEON_H
9#define META_OCEAN_CV_ADVANCED_SUM_SQUARE_DIFFERENCES_NO_CENTER_NEON_H
13#if defined(OCEAN_HARDWARE_NEON_VERSION) && OCEAN_HARDWARE_NEON_VERSION >= 10
60 template <
unsigned int tChannels,
unsigned int tPatchSize>
61 static inline 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);
64template <
unsigned int tChannels,
unsigned int tPatchSize>
65inline uint32_t
SumSquareDifferencesNoCenterNEON:: 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)
67 static_assert(tChannels >= 1u,
"Invalid channel number!");
68 static_assert(tPatchSize >= 1u,
"Invalid patch size!");
70 ocean_assert(image0 !=
nullptr && image1 !=
nullptr);
72 ocean_assert(width0 >= tPatchSize);
73 ocean_assert(width1 >= tPatchSize);
75 constexpr unsigned int tPatchSize_2 = tPatchSize / 2u;
77 ocean_assert(centerX0 >= tPatchSize_2 && centerY0 >= tPatchSize_2);
78 ocean_assert(centerX1 >= tPatchSize_2 && centerY1 >= tPatchSize_2);
80 ocean_assert(centerX0 < width0 - tPatchSize_2);
81 ocean_assert(centerX1 < width1 - tPatchSize_2);
83 const unsigned int image0StrideElements = width0 * tChannels + image0PaddingElements;
84 const unsigned int image1StrideElements = width1 * tChannels + image1PaddingElements;
86 const uint8_t*
const patch0 = image0 + (centerY0 - tPatchSize_2) * image0StrideElements + (centerX0 - tPatchSize_2) * tChannels;
87 const uint8_t*
const patch1 = image1 + (centerY1 - tPatchSize_2) * image1StrideElements + (centerX1 - tPatchSize_2) * tChannels;
Internal helper class providing access to CV::SumSquareDifferencesSSE.
Definition SumSquareDifferencesNoCenterNEON.h:38
This class implements functions calculating the sum of square differences and omit center pixel.
Definition SumSquareDifferencesNoCenterNEON.h:31
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 patches while skipping the center pixel.
Definition SumSquareDifferencesNoCenterNEON.h:65
static uint32_t buffer8BitPerChannel(const uint8_t *const buffer0, const uint8_t *const buffer1)
Returns the sum of square differences between two memory buffers.
Definition SumSquareDifferences.h:204
This class implements function to calculate sum square differences using NEON instructions.
Definition SumSquareDifferencesNEON.h:28
static uint32_t patch8BitPerChannel(const uint8_t *patch0, const uint8_t *patch1, const unsigned int patch0StrideElements, const unsigned int patch1StrideElements)
Returns the sum of square differences between two patches within an image.
Definition SumSquareDifferencesNEON.h:204
Namespace of the CV Advanced library.
Definition Advanced.h:20
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15