Sobel + Gaussian Filter Accelerated Functions

New to PYNQ so bear with me please! I have previously scrapped working with the Canny accelerated function and have dived into the Sobel (You may have seen my previous post).

Using VITIS HLS 2022.1 and VIVADO 2022.1

I got the Sobel accelerated function working. I am using example code from the main branch of Vitis libraries to build the functions into IPs. I modified the config to suit for grayscale input image (8UC1, NPPC1. I import it into vivado and create a block design with automatic connections:

In Jupyter Notebooks I get the correct output it seems to be working, here are Gx and Gy:


It works perfectly and I combine Gx and Gy into one image.

Now, I wanted to add Gaussian Blur accelerated function to the block design as well. The grayscale image is to be processed through this function first and then the Sobel. I create a separate Vitis project for the Gaussian Blur, same branch for vitis libraries. I modify the config for grayscale (8UC1, NPPC1 and export it out into an IP block. I now import it into my Vivado project block design like so with automatic connections:

Now as soon as I run any two of the accelerated functions, gaussian doesn’t work at all a blank plot. Or if I first run only the Sobel function on its own on this overlay, it is a weird output and not the same as before. It is like as soon as I add the gaussian block into the block design it interferes with how the Sobel operates. This is the output I get now:

I have also tried hooking it up like this in Vivado for further testing and still got the weird outputs:

I thought maybe separating them with interconnects it would work, but it didn’t.

Some assistance on how the block design should be designed would help a lot. I’m not sure why the Sobel function stops working simply because of adding the gaussian block. I am also using separate buffers for both functions so that isn’t an issue.

Also, another thought was, is it because they have the same offsets for the registers to the block? My idea is that because they are separate blocks, it is okay for them to have the same offsets for each of the ports. Because you first refer to the particular block in code and then specify the offset to write a value.

Thanks!