8 #ifndef META_OCEAN_CV_FRAME_FILTER_TEMPLATE_H
9 #define META_OCEAN_CV_FRAME_FILTER_TEMPLATE_H
47 template <
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>
418 template <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>
577 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
578 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannel,
unsigned int tChannels, PixelDirection tDirection>
579 TResponse
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);
602 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
603 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannel,
unsigned int tChannels, PixelDirection tDirection>
604 TResponse
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);
620 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
621 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
622 void 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);
647 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
648 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
649 void 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);
667 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
668 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
669 TResponse
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);
691 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
692 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
693 TResponse
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)
722 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
723 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias>
724 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 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!");
749 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
750 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels>
751 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 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!");
794 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
795 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
796 inline 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);
810 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
811 template <
typename TData,
typename TResponse,
typename TNormalizationFactor>
812 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 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!");
837 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
838 template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels>
839 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 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!");
882 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
883 template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels, PixelDirection tDirection>
884 inline 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);
898 template <
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;
914 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
915 template <
typename TData,
typename TResponse,
typename TNormalization, TNormalization tNormalization, TNormalization tBias,
unsigned int tChannels, PixelDirection tDirection>
916 void 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);
1008 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1009 template <
typename TData,
typename TResponse,
typename TNormalizationFactor,
unsigned int tChannels, PixelDirection tDirection>
1010 void 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);
1102 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1103 template <PixelDirection tDirection>
1109 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1110 template <PixelDirection tDirection>
1116 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1117 template <PixelDirection tDirection>
1123 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1124 template <PixelDirection tDirection>
1130 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1131 template <PixelDirection tDirection>
1137 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1138 template <PixelDirection tDirection>
1144 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1145 template <PixelDirection tDirection>
1151 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1152 template <PixelDirection tDirection>
1158 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1159 template <PixelDirection tDirection>
1165 template <PixelDirection tDirection>
1166 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1173 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1180 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1187 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1194 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1201 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1208 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1215 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1221 template <PixelDirection tDirection>
1222 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1229 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1236 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1243 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1250 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1257 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1264 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1271 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1277 template <PixelDirection tDirection>
1278 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1285 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1292 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1299 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1306 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1313 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1320 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1327 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1333 template <PixelDirection tDirection>
1334 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1341 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1348 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1355 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1362 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1369 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1376 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1383 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1389 template <PixelDirection tDirection>
1390 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1396 template <PixelDirection tDirection>
1397 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1404 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1411 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1418 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1425 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1432 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1439 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1446 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1452 template <PixelDirection tDirection>
1453 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1460 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1467 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1474 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1481 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1488 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1495 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1502 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1508 template <PixelDirection tDirection>
1509 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1516 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1523 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1530 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1537 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1544 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1551 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1558 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1564 template <PixelDirection tDirection>
1565 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1572 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1579 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1586 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1593 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1600 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1607 template <
typename TFactor, TFactor tFactor00, TFactor tFactor10, TFactor tFactor20, TFactor tFactor01, TFactor tFactor11, TFactor tFactor21, TFactor tFactor02, TFactor tFactor12, TFactor tFactor22>
1614 template <
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