8 #ifndef META_OCEAN_CV_ADVANCED_SUM_SQUARE_DIFFERENCES_NO_CENTER_H
9 #define META_OCEAN_CV_ADVANCED_SUM_SQUARE_DIFFERENCES_NO_CENTER_H
49 template <
unsigned int tChannels,
unsigned int tPatchSize>
50 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);
53 template <
unsigned int tChannels,
unsigned int tPatchSize>
54 inline uint32_t
SumSquareDifferencesNoCenter::patch8BitPerChannel(
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)
56 static_assert(tChannels >= 1u,
"Invalid channel number!");
57 static_assert(tPatchSize >= 1u,
"Invalid patch size!");
59 ocean_assert(image0 !=
nullptr && image1 !=
nullptr);
61 ocean_assert(width0 >= tPatchSize);
62 ocean_assert(width1 >= tPatchSize);
64 constexpr
unsigned int tPatchSize_2 = tPatchSize / 2u;
66 ocean_assert(centerX0 >= tPatchSize_2 && centerY0 >= tPatchSize_2);
67 ocean_assert(centerX1 >= tPatchSize_2 && centerY1 >= tPatchSize_2);
69 ocean_assert(centerX0 < width0 - tPatchSize_2);
70 ocean_assert_and_suppress_unused(centerX1 < width1 - tPatchSize_2, tPatchSize_2);
72 #if defined(OCEAN_HARDWARE_SSE_VERSION) && OCEAN_HARDWARE_SSE_VERSION >= 41
74 if constexpr (tPatchSize >= 5u)
76 return SumSquareDifferencesNoCenterSSE::patch8BitPerChannel<tChannels, tPatchSize>(image0, image1, width0, width1, centerX0, centerY0, centerX1, centerY1, image0PaddingElements, image1PaddingElements);
79 #elif defined(OCEAN_HARDWARE_NEON_VERSION) && OCEAN_HARDWARE_NEON_VERSION >= 10
81 if constexpr (tPatchSize >= 5u)
83 return SumSquareDifferencesNoCenterNEON::patch8BitPerChannel<tChannels, tPatchSize>(image0, image1, width0, width1, centerX0, centerY0, centerX1, centerY1, image0PaddingElements, image1PaddingElements);
88 return SumSquareDifferencesNoCenterBase::patch8BitPerChannelTemplate<tChannels, tPatchSize>(image0, image1, width0, width1, centerX0, centerY0, centerX1, centerY1, image0PaddingElements, image1PaddingElements);
This class implements functions calculating the sum of square differences and omits center pixel.
Definition: SumSquareDifferencesNoCenterBase.h:30
This class implements functions calculating the sum of square differences and omit center pixel.
Definition: SumSquareDifferencesNoCenter.h:30
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: SumSquareDifferencesNoCenter.h:54
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15