32 template <
typename NeighbourT,
typename FilterT>
33 typename NeighbourT::PixelType
operator()(NeighbourT& nbr, FilterT& fltr) {
35 int hs_c = (fltr.cols / 2);
36 int hs_r = (fltr.rows / 2);
37 typename NeighbourT::PixelType out{};
38 for (i2 = -hs_c, i = 0; i2 <= hs_c; i2++, i++)
39 for (j2 = -hs_r, j = 0; j2 <= hs_r; j2++, j++)
40 out += nbr.at(nbr.I_c + i2, nbr.I_r + j2) * fltr.at(i, j);
53 template <
typename NeighbourT,
typename FilterT>
56 int hs_c = (fltr.cols / 2);
57 int hs_r = (fltr.rows / 2);
59 for (i2 = -hs_c, i = 0; i2 <= hs_c; i2++, i++)
60 for (j2 = -hs_r, j = 0; j2 <= hs_r; j2++, j++)
61 out += (nbr.at(nbr.I_c + i2, nbr.I_r + j2) * fltr.at(i, j));
Applying the general convolution for 1 channel Image.
float operator()(NeighbourT &nbr, FilterT &fltr)
Applying the general convolution for 3 channel Image.
NeighbourT::PixelType operator()(NeighbourT &nbr, FilterT &fltr)