Gaussian Filter 2d - Error when getting dot - mat.type() == type() in function 'dot'

Hello, long story short I am trying to implement a Gaussian Filter that matches scipy library.

Whilst carrying out research I found an article that achieves my objective - C++ implementation of gaussian_filter in python scipy.ndimage.filters - Programmer Sought

However, when I try and run this example I receive the following run error. I have found that the error is within function correlate1d_y & correlate1d_x during the for loops .dot(weights_mat);. Please can some explain why this error is being thrown and possible way to resolve this?

error: (-215:Assertion failed) mat.type() == type() in function 'dot'

Thank you in advance,
Matt

were you meaning to include hyperlinks in your post?

crosspost: c++ - Gaussian Filter 2d - Error when getting dot - mat.type() == type() in function ‘dot’ - Stack Overflow

@Matt96 - reminder, we can only help with code we can see …