8#ifndef META_OCEAN_CV_FRAME_FILTER_TEMPLATE_H
9#define META_OCEAN_CV_FRAME_FILTER_TEMPLATE_H
47template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
77 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannel,
unsigned int tChannels, PixelDirection tDirection>
78 static TResponse
filterPixel(
const TData* frame,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y);
95 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannel,
unsigned int tChannels, PixelDirection tDirection>
96 static TResponse
filterPixelCore(
const TData* frame,
const unsigned int width);
115 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels, PixelDirection tDirection>
116 static void filterPixel(
const TData* frame,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y, TResponse* response);
132 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels, PixelDirection tDirection>
133 static void filterPixelCore(
const TData* frame,
const unsigned int width, TResponse* response);
153 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels, PixelDirection tDirection>
154 static TResponse
filterAbsoluteAs1ChannelPixel(
const TData* frame,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y);
171 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels, PixelDirection tDirection>
191 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias>
192 static void filter(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const unsigned int channels,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
211 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels>
212 static void filter(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
231 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels, PixelDirection tDirection>
232 static inline void filter(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
250 template <
typename TData,
typename TResponse,
typename TNormalizationFactor>
251 static void filterWithFactor(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const unsigned int channels,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
269 template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels>
270 static void filterWithFactor(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
288 template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels, PixelDirection tDirection>
289 static inline void filterWithFactor(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker =
nullptr);
317 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tNormalizationBias,
unsigned int tChannels, PixelDirection tDirection>
318 static void filterSubset(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
const unsigned int firstRow,
const unsigned int numberRows);
337 template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels, PixelDirection tDirection>
338 static void filterWithFactorSubset(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
const unsigned int firstRow,
const unsigned int numberRows);
345 template <PixelDirection tDirection>
353 template <PixelDirection tDirection>
361 template <PixelDirection tDirection>
369 template <PixelDirection tDirection>
377 template <PixelDirection tDirection>
385 template <PixelDirection tDirection>
393 template <PixelDirection tDirection>
401 template <PixelDirection tDirection>
409 template <PixelDirection tDirection>
418template <PixelDirection tDirection>
437 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
454 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
471 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
488 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
505 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
522 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
539 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
556 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
573 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
577template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
578template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannel,
unsigned int tChannels, PixelDirection tDirection>
579TResponse
FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterPixel(
const TData* frame,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y)
581 static_assert(tNormalization != 0,
"Invalid normalization parameter!");
582 static_assert(tChannel < tChannels,
"Invalid channel index!");
583 static_assert(tChannels >= 1u,
"Invalid channel number!");
586 ocean_assert(width >= 3u);
587 ocean_assert(height >= 3u);
589 ocean_assert((x - 1u < width - 2u) == (x >= 1u && x + 1u < width));
590 ocean_assert((y - 1u < height - 2u) == (y >= 1u && y + 1u < height));
592 if (x - 1u < width - 2u && y - 1u < height - 2u)
594 return filterPixelCore<TData, TResponse, TNormalization, tNormalization, tBias, tChannel, tChannels, tDirection>(frame + (y * width + x) * tChannels, width);
602template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
603template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannel,
unsigned int tChannels, PixelDirection tDirection>
604TResponse
FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterPixelCore(
const TData* frame,
const unsigned int width)
606 static_assert(tNormalization != 0,
"Invalid normalization parameter!");
607 static_assert(tChannel < tChannels,
"Invalid channel index!");
608 static_assert(tChannels >= 1u,
"Invalid channel number!");
611 ocean_assert(width >= 3u);
613 const unsigned int cWidth = width * tChannels;
615 return TResponse((TNormalization(*(frame - cWidth - tChannels + tChannel) * factor00<tDirection>() + *(frame - cWidth + tChannel) * factor01<tDirection>() + *(frame - cWidth + tChannels + tChannel) * factor02<tDirection>()
616 + *(frame - tChannels + tChannel) * factor10<tDirection>() + *(frame + tChannel) * factor11<tDirection>() + *(frame + tChannels + tChannel) * factor12<tDirection>()
617 + *(frame + cWidth - tChannels + tChannel) * factor20<tDirection>() + *(frame + cWidth + tChannel) * factor21<tDirection>() + *(frame + cWidth + tChannels + tChannel) * factor22<tDirection>()) + tBias) / tNormalization);
620template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
621template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
622void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterPixel(
const TData* frame,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y, TResponse* response)
624 static_assert(tNormalization != 0,
"Invalid normalization parameter!");
625 static_assert(tChannels >= 1u,
"Invalid channel number!");
628 ocean_assert(width >= 3u);
629 ocean_assert(height >= 3u);
631 ocean_assert((x - 1u < width - 2u) == (x >= 1u && x + 1u < width));
632 ocean_assert((y - 1u < height - 2u) == (y >= 1u && y + 1u < height));
634 if (x - 1u < width - 2u && y - 1u < height - 2u)
636 return filterPixelCore<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, tDirection>(frame + (y * width + x) * tChannels, width, response);
640 for (
unsigned int n = 0u; n < tChannels; ++n)
642 response[n] = TResponse(0);
647template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
648template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
649void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterPixelCore(
const TData* frame,
const unsigned int width, TResponse* response)
651 static_assert(tNormalization != 0,
"Invalid normalization parameter!");
652 static_assert(tChannels >= 1u,
"Invalid channel number!");
655 ocean_assert(width >= 3u);
657 const unsigned int cWidth = width * tChannels;
659 for (
unsigned int n = 0u; n < tChannels; ++n)
661 response[n] = TResponse((TNormalization(*(frame - cWidth - tChannels + n) * factor00<tDirection>() + *(frame - cWidth + n) * factor01<tDirection>() + *(frame - cWidth + tChannels + n) * factor02<tDirection>()
662 + *(frame - tChannels + n) * factor10<tDirection>() + *(frame + n) * factor11<tDirection>() + *(frame + tChannels + n) * factor12<tDirection>()
663 + *(frame + cWidth - tChannels + n) * factor20<tDirection>() + *(frame + cWidth + n) * factor21<tDirection>() + *(frame + cWidth + tChannels + n) * factor22<tDirection>()) + tBias) / tNormalization);
667template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
668template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
669TResponse
FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterAbsoluteAs1ChannelPixel(
const TData* frame,
const unsigned int width,
const unsigned int height,
const unsigned int x,
const unsigned int y)
671 static_assert(tNormalization != 0,
"Invalid normalization parameter!");
672 static_assert(tChannels >= 1u,
"Invalid channel number!");
675 ocean_assert(width >= 3u);
676 ocean_assert(height >= 3u);
678 ocean_assert((x - 1u < width - 2u) == (x >= 1u && x + 1u < width));
679 ocean_assert((y - 1u < height - 2u) == (y >= 1u && y + 1u < height));
681 if (x - 1u < width - 2u && y - 1u < height - 2u)
683 return filterAbsoluteAs1ChannelPixelCore<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, tDirection>(frame + (y * width + x) * tChannels, width);
691template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
692template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
693TResponse
FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterAbsoluteAs1ChannelPixelCore(
const TData* frame,
const unsigned int width)
695 static_assert(tNormalization != 0,
"Invalid normalization parameter!");
696 static_assert(tChannels >= 1u,
"Invalid channel number!");
699 ocean_assert(width >= 3u);
701 const unsigned int cWidth = width * tChannels;
703 TResponse value = TResponse(
NumericT<TNormalization>::secureAbs((TNormalization(*(frame - cWidth - tChannels) * factor00<tDirection>() + *(frame - cWidth) * factor01<tDirection>() + *(frame - cWidth + tChannels) * factor02<tDirection>()
704 + *(frame - tChannels) * factor10<tDirection>() + *(frame) * factor11<tDirection>() + *(frame + tChannels) * factor12<tDirection>()
705 + *(frame + cWidth - tChannels) * factor20<tDirection>() + *(frame + cWidth) * factor21<tDirection>() + *(frame + cWidth + tChannels) * factor22<tDirection>()) + tBias) / tNormalization));
707 for (
unsigned int n = 1u; n < tChannels; ++n)
709 TResponse newValue = TResponse(
NumericT<TNormalization>::secureAbs((TNormalization(*(frame - cWidth - tChannels + n) * factor00<tDirection>() + *(frame - cWidth + n) * factor01<tDirection>() + *(frame - cWidth + tChannels + n) * factor02<tDirection>()
710 + *(frame - tChannels + n) * factor10<tDirection>() + *(frame + n) * factor11<tDirection>() + *(frame + tChannels + n) * factor12<tDirection>()
711 + *(frame + cWidth - tChannels + n) * factor20<tDirection>() + *(frame + cWidth + n) * factor21<tDirection>() + *(frame + cWidth + tChannels + n) * factor22<tDirection>()) + tBias) / tNormalization));
713 if (newValue > value)
722template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
723template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias>
724void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filter(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const unsigned int channels,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
729 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, 1u>(frame, target, width, height, direction, framePaddingElements, targetPaddingElements, worker);
733 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, 2u>(frame, target, width, height, direction, framePaddingElements, targetPaddingElements, worker);
737 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, 3u>(frame, target, width, height, direction, framePaddingElements, targetPaddingElements, worker);
741 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, 4u>(frame, target, width, height, direction, framePaddingElements, targetPaddingElements, worker);
745 ocean_assert(
false &&
"Invalid channel number!");
749template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
750template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels>
751void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filter(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
753 static_assert(tChannels >= 1u,
"Invaild channel number!");
758 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_NORTH>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
762 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_NORTH_WEST>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
766 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_WEST>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
770 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_SOUTH_WEST>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
774 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_SOUTH>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
778 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_SOUTH_EAST>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
782 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_EAST>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
786 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filter<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, PD_NORTH_EAST>(frame, target, width, height, framePaddingElements, targetPaddingElements, worker);
790 ocean_assert(
false &&
"Invalid orientation!");
794template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
795template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
796inline void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filter(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
798 static_assert(tChannels >= 1u,
"Invaild channel number!");
802 worker->
executeFunction(
Worker::Function::createStatic(&filterSubset<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, tDirection>, frame, target, width, height, framePaddingElements, targetPaddingElements, 0u, 0u), 0u, height, 6u, 7u, 20u);
806 filterSubset<TData, TResponse, TNormalization, tNormalization, tBias, tChannels, tDirection>(frame, target, width, height, framePaddingElements, targetPaddingElements, 0u, height);
810template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
811template <
typename TData,
typename TResponse,
typename TNormalizationFactor>
812void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterWithFactor(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const unsigned int channels,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
817 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, 1u>(frame, target, width, height, factor, direction, framePaddingElements, targetPaddingElements, worker);
821 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, 2u>(frame, target, width, height, factor, direction, framePaddingElements, targetPaddingElements, worker);
825 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, 3u>(frame, target, width, height, factor, direction, framePaddingElements, targetPaddingElements, worker);
829 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, 4u>(frame, target, width, height, factor, direction, framePaddingElements, targetPaddingElements, worker);
833 ocean_assert(
false &&
"Invalid channel number!");
837template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
838template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels>
839void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterWithFactor(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const PixelDirection direction,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
841 static_assert(tChannels >= 1u,
"Invaild channel number!");
846 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_NORTH>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
850 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_NORTH_WEST>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
854 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_WEST>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
858 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_SOUTH_WEST>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
862 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_SOUTH>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
866 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_SOUTH_EAST>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
870 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_EAST>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
874 CV::FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::template filterWithFactor<TData, TResponse, TNormalizationFactor, tChannels, PD_NORTH_EAST>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, worker);
878 ocean_assert(
false &&
"Invalid orientation!");
882template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
883template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels, PixelDirection tDirection>
884inline void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterWithFactor(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
Worker* worker)
886 static_assert(tChannels >= 1u,
"Invaild channel number!");
890 worker->
executeFunction(
Worker::Function::createStatic(&filterWithFactorSubset<TData, TResponse, TNormalizationFactor, tChannels, tDirection>, frame, target, width, height, factor, framePaddingElements, targetPaddingElements, 0u, 0u), 0u, height, 7u, 8u, 20u);
894 filterWithFactorSubset<TData, TResponse, TNormalizationFactor, tChannels, tDirection>(frame, target, width, height, factor, framePaddingElements, targetPaddingElements, 0u, height);
898template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
901 filterFactors[0] = tFactor00;
902 filterFactors[1] = tFactor10;
903 filterFactors[2] = tFactor20;
905 filterFactors[3] = tFactor01;
906 filterFactors[4] = tFactor11;
907 filterFactors[5] = tFactor21;
909 filterFactors[6] = tFactor02;
910 filterFactors[7] = tFactor12;
911 filterFactors[8] = tFactor22;
914template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
915template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
916void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterSubset(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
const unsigned int firstRow,
const unsigned int numberRows)
918 static_assert(tChannels >= 1u,
"Invaild channel number!");
920 ocean_assert(frame && target);
921 ocean_assert(width >= 3u);
922 ocean_assert(firstRow + numberRows <= height);
924 const unsigned int frameStrideElements = width * tChannels + framePaddingElements;
925 const unsigned int targetStrideElements = width * tChannels + targetPaddingElements;
930 for (
unsigned int n = 0u; n < width * tChannels; ++n)
932 target[n] = TResponse(0);
936 const unsigned int beginFilterRow = max(0,
int(firstRow) - 1) + 1;
937 const unsigned int endFilterRow = min(firstRow + numberRows + 1, height) - 1;
939 frame += beginFilterRow * frameStrideElements;
940 target += beginFilterRow * targetStrideElements;
942 const TData*
const frameEnd = frame + (endFilterRow - beginFilterRow) * frameStrideElements;
944 while (frame != frameEnd)
946 ocean_assert(frame < frameEnd);
949 for (
unsigned int n = 0u; n < tChannels; ++n)
957 const TData*
const frameRowEnd = frame + (width - 2u) * tChannels;
959 while (frame != frameRowEnd)
961 ocean_assert(frame < frameEnd);
962 ocean_assert(frame < frameRowEnd);
964 const TData*
const topRow = frame - frameStrideElements;
965 const TData*
const bottomRow = frame + frameStrideElements;
967 for (
unsigned int n = 0u; n < tChannels; ++n)
969 target[n] = TResponse((TNormalization(
970 *(topRow - tChannels + n) * factor00<tDirection>()
971 + *(topRow + n) * factor01<tDirection>()
972 + *(topRow + tChannels + n) * factor02<tDirection>()
973 + *(frame - tChannels + n) * factor10<tDirection>()
974 + *(frame + n) * factor11<tDirection>()
975 + *(frame + tChannels + n) * factor12<tDirection>()
976 + *(bottomRow - tChannels + n) * factor20<tDirection>()
977 + *(bottomRow + n) * factor21<tDirection>()
978 + *(bottomRow + tChannels + n) * factor22<tDirection>()) + tBias) / tNormalization);
986 for (
unsigned int n = 0u; n < tChannels; ++n)
994 frame += framePaddingElements;
995 target += targetPaddingElements;
999 if (firstRow + numberRows == height)
1001 for (
unsigned int n = 0u; n < width * tChannels; ++n)
1003 target[n] = TResponse(0);
1008template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1009template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels, PixelDirection tDirection>
1010void FrameFilterTemplate<TFactor, tFactor00, tFactor10, tFactor20, tFactor01, tFactor11, tFactor21, tFactor02, tFactor12, tFactor22>::filterWithFactorSubset(
const TData* frame, TResponse* target,
const unsigned int width,
const unsigned int height,
const TNormalizationFactor factor,
const unsigned int framePaddingElements,
const unsigned int targetPaddingElements,
const unsigned int firstRow,
const unsigned int numberRows)
1012 static_assert(tChannels >= 1u,
"Invaild channel number!");
1014 ocean_assert(frame && target);
1015 ocean_assert(width >= 3u);
1016 ocean_assert(firstRow + numberRows <= height);
1018 const unsigned int frameStrideElements = width * tChannels + framePaddingElements;
1019 const unsigned int targetStrideElements = width * tChannels + targetPaddingElements;
1024 for (
unsigned int n = 0u; n < width * tChannels; ++n)
1026 target[n] = TResponse(0);
1030 const unsigned int beginFilterRow = max(0,
int(firstRow) - 1) + 1;
1031 const unsigned int endFilterRow = min(firstRow + numberRows + 1, height) - 1;
1033 frame += beginFilterRow * frameStrideElements;
1034 target += beginFilterRow * targetStrideElements;
1036 const TData*
const frameEnd = frame + (endFilterRow - beginFilterRow) * frameStrideElements;
1038 while (frame != frameEnd)
1040 ocean_assert(frame < frameEnd);
1043 for (
unsigned int n = 0u; n < tChannels; ++n)
1049 target += tChannels;
1051 const TData*
const frameRowEnd = frame + (width - 2u) * tChannels;
1053 while (frame != frameRowEnd)
1055 ocean_assert(frame < frameEnd);
1056 ocean_assert(frame < frameRowEnd);
1058 const TData*
const topRow = frame - frameStrideElements;
1059 const TData*
const bottomRow = frame + frameStrideElements;
1061 for (
unsigned int n = 0u; n < tChannels; ++n)
1063 target[n] = TResponse(TNormalizationFactor(
1064 *(topRow - tChannels + n) * factor00<tDirection>()
1065 + *(topRow + n) * factor01<tDirection>()
1066 + *(topRow + tChannels + n) * factor02<tDirection>()
1067 + *(frame - tChannels + n) * factor10<tDirection>()
1068 + *(frame + n) * factor11<tDirection>()
1069 + *(frame + tChannels + n) * factor12<tDirection>()
1070 + *(bottomRow - tChannels + n) * factor20<tDirection>()
1071 + *(bottomRow + n) * factor21<tDirection>()
1072 + *(bottomRow + tChannels + n) * factor22<tDirection>()) * factor);
1075 target += tChannels;
1080 for (
unsigned int n = 0u; n < tChannels; ++n)
1086 target += tChannels;
1088 frame += framePaddingElements;
1089 target += targetPaddingElements;
1093 if (firstRow + numberRows == height)
1095 for (
unsigned int n = 0u; n < width * tChannels; ++n)
1097 target[n] = TResponse(0);
1102template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1103template <PixelDirection tDirection>
1109template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1110template <PixelDirection tDirection>
1116template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1117template <PixelDirection tDirection>
1123template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1124template <PixelDirection tDirection>
1130template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1131template <PixelDirection tDirection>
1137template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1138template <PixelDirection tDirection>
1144template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1145template <PixelDirection tDirection>
1151template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1152template <PixelDirection tDirection>
1158template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1159template <PixelDirection tDirection>
1165template <PixelDirection tDirection>
1166template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1173template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1180template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1187template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1194template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1201template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1208template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1215template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1221template <PixelDirection tDirection>
1222template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1229template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1236template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1243template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1250template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1257template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1264template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1271template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1277template <PixelDirection tDirection>
1278template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1285template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1292template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1299template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1306template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1313template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1320template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1327template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1333template <PixelDirection tDirection>
1334template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1341template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1348template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1355template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1362template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1369template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1376template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1383template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1389template <PixelDirection tDirection>
1390template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1396template <PixelDirection tDirection>
1397template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1404template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1411template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1418template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1425template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1432template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1439template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1446template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1452template <PixelDirection tDirection>
1453template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1460template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1467template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1474template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1481template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1488template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1495template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1502template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1508template <PixelDirection tDirection>
1509template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1516template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1523template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1530template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1537template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1544template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1551template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1558template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1564template <PixelDirection tDirection>
1565template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1572template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1579template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1586template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1593template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1600template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1607template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1614template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
This class implements a helper class providing template filter factors.
Definition FrameFilterTemplate.h:420
static TFactor factor02()
Returns the filter factor of the filter element (0, 2)
Definition FrameFilterTemplate.h:1454
static TFactor factor12()
Returns the filter factor of the filter element (1, 2)
Definition FrameFilterTemplate.h:1510
static TFactor factor20()
Returns the filter factor of the filter element (2, 0)
Definition FrameFilterTemplate.h:1279
static TFactor factor22()
Returns the filter factor of the filter element (2, 2)
Definition FrameFilterTemplate.h:1566
static TFactor factor10()
Returns the filter factor of the filter element (1, 0)
Definition FrameFilterTemplate.h:1223
static TFactor factor21()
Returns the filter factor of the filter element (2, 1)
Definition FrameFilterTemplate.h:1398
static TFactor factor11()
Returns the filter factor of the filter element (1, 1)
Definition FrameFilterTemplate.h:1391
static TFactor factor00()
Returns the filter factor of the filter element (0, 0)
Definition FrameFilterTemplate.h:1167
static TFactor factor01()
Returns the filter factor of the filter element (0, 1)
Definition FrameFilterTemplate.h:1335
This class implements a 3x3 filter with arbitrary filter pattern.
Definition FrameFilterTemplate.h:49
static TFactor factor21()
Returns the filter factor of filter element (2, 1).
Definition FrameFilterTemplate.h:1139
static void filter(const TData *frame, TResponse *target, const unsigned int width, const unsigned int height, const unsigned int channels, const PixelDirection direction, const unsigned int framePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Applies the filter for a given frame with several zipped data channels and normalizes the filter resp...
Definition FrameFilterTemplate.h:724
static TFactor factor01()
Returns the filter factor of filter element (0, 1).
Definition FrameFilterTemplate.h:1125
static TFactor factor00()
Returns the filter factor of filter element (0, 0).
Definition FrameFilterTemplate.h:1104
static TResponse filterPixelCore(const TData *frame, const unsigned int width)
Applies the filter at one center pixel position in a frame with zipped data channels (for one of the ...
Definition FrameFilterTemplate.h:604
TFactor Type
Definition of the filter factor data type.
Definition FrameFilterTemplate.h:55
static TFactor factor12()
Returns the filter factor of filter element (1, 2).
Definition FrameFilterTemplate.h:1153
static void copyFilterFactors(TFactor filterFactors[9])
This functions fills an array with the filter factors of this template class.
Definition FrameFilterTemplate.h:899
static void filterWithFactor(const TData *frame, TResponse *target, const unsigned int width, const unsigned int height, const TNormalizationFactor factor, const unsigned int channels, const PixelDirection direction, const unsigned int framePaddingElements, const unsigned int targetPaddingElements, Worker *worker=nullptr)
Applies the filter for a given frame with several zipped data channels and normalizes the filter resp...
Definition FrameFilterTemplate.h:812
static TResponse filterAbsoluteAs1ChannelPixelCore(const TData *frame, const unsigned int width)
Applies the filter at one center pixel position in a frame with zipped data channels.
Definition FrameFilterTemplate.h:693
static TResponse filterPixel(const TData *frame, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y)
Applies the filter at one pixel position in a frame with zipped data channels (for one of the channel...
Definition FrameFilterTemplate.h:579
static void filterWithFactorSubset(const TData *frame, TResponse *target, const unsigned int width, const unsigned int height, const TNormalizationFactor factor, const unsigned int framePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
Applies the filter in a subset of a given frame with several zipped data channels and normalizes the ...
Definition FrameFilterTemplate.h:1010
static TResponse filterAbsoluteAs1ChannelPixel(const TData *frame, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y)
Applies the filter at one pixel position in a frame with zipped data channels.
Definition FrameFilterTemplate.h:669
static TFactor factor10()
Returns the filter factor of filter element (1, 0).
Definition FrameFilterTemplate.h:1111
static TFactor factor22()
Returns the filter factor of filter element (2, 2).
Definition FrameFilterTemplate.h:1160
static TFactor factor20()
Returns the filter factor of filter element (2, 0).
Definition FrameFilterTemplate.h:1118
static TFactor factor11()
Returns the filter factor of filter element (1, 1).
Definition FrameFilterTemplate.h:1132
static TFactor factor02()
Returns the filter factor of filter element (0, 2).
Definition FrameFilterTemplate.h:1146
static void filterSubset(const TData *frame, TResponse *target, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int targetPaddingElements, const unsigned int firstRow, const unsigned int numberRows)
Applies the filter in a subset of a given frame with several zipped data channels and normalizes the ...
Definition FrameFilterTemplate.h:916
static Caller< void > createStatic(typename StaticFunctionPointerMaker< void, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass, NullClass >::Type function)
Creates a new caller container for a static function with no function parameter.
Definition Caller.h:2876
This class provides basic numeric functionalities.
Definition Numeric.h:57
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
bool executeFunction(const Function &function, const unsigned int first, const unsigned int size, const unsigned int firstIndex=(unsigned int)(-1), const unsigned int sizeIndex=(unsigned int)(-1), const unsigned int minimalIterations=1u, const unsigned int threadIndex=(unsigned int)(-1))
Executes a callback function separable by two function parameters.
PixelDirection
Definition of individual directions with pixel accuracy.
Definition CV.h:85
@ PD_WEST
Definition CV.h:93
@ PD_NORTH_EAST
Definition CV.h:103
@ PD_NORTH_WEST
Definition CV.h:91
@ PD_EAST
Definition CV.h:101
@ PD_SOUTH_WEST
Definition CV.h:95
@ PD_SOUTH
Definition CV.h:97
@ PD_SOUTH_EAST
Definition CV.h:99
@ PD_NORTH
Definition CV.h:89
The namespace covering the entire Ocean framework.
Definition Accessor.h:15