Boost logo

Boost :

From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2019-07-15 20:37:27


In this thread, I'm archiving some comments related to discussion
we recently held with Miral on Gitter due to issues with implementation
of convolution in the current Numeric extension.
That is, convolve_cols and convolve_rows.

First, reminder that the Numeric implements 2D separable convolution [1].
More precisely, it is 2D spatial separable convolution [2] and, AFAIU,
no depth-wise convolving happens.

The implication is that it requires use of separable kernels [3] (that is
kernels with matrix rank equal to 1).

For a moment, I thought that Miral's may have hit this limitation, but
it does not apply to the averaging kernel which has rank 1, of course:

>>> import numpy as np
>>> avg = np.array([[1,1,1],[1,1,1],[1,1,1]])
>>> np.linalg.matrix_rank(avg)

BTW, Gaussian, Sobel are also separable filters.

So, there must be something else going on in the Numeric's convolve
functions. I've added basic testing infrastructure for those functions
with first tests [5] and I'm hoping to add more soon, and that it will help
to identify where is the problem.

Any help and feedback is appreciated.

Meanwhile, Miral may work out a basic bespoke implementation of
convolution dedicated for her needs.


Best regards,

Mateusz Loskot,

Boost list run by Boost-Gil-Owners