MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ convolve()

template<size_t N>
template<size_t M>
constexpr KernelSpec< N+M - 1 > MayaFlux::Kinesis::Vision::KernelSpec< N >::convolve ( const KernelSpec< M > &  other) const
inlineconstexprnoexcept

Convolve this kernel with another of the same length.

Produces a kernel of length 2*N-1 representing the sequential application of both. Use to construct larger kernels from smaller primitives, e.g. binomial5 = binomial3.convolve(binomial3).

Template Parameters
MLength of the other kernel. Result length is N+M-1.

Definition at line 144 of file KernelSpec.hpp.

146 {
147 KernelSpec<N + M - 1> out;
148 for (size_t i = 0; i < N; ++i)
149 for (size_t j = 0; j < M; ++j)
150 out.taps[i + j] += taps[i] * other.taps[j];
151 return out;
152 }
#define N(method_name, full_type_name)
Definition Creator.hpp:106

References N, and MayaFlux::Kinesis::Vision::KernelSpec< N >::taps.