The correct method for utilizing the gaussian filter function in the CUDA Npp library is as follows:
#include <npp.h>
#include <nppi_filtering_functions.h>
NppiSize sizeROI = { width, height };
NppiSize maskSize = { maskWidth, maskHeight };
int nBufferSize = 0;
Npp8u* pBuffer = 0;
Npp8u* pSrcDst = 0;
int nSrcDstStep = 0;
NppiPoint anchor = { maskWidth / 2, maskHeight / 2 };
nppiMalloc(&pSrcDst, nSrcDstStep * height);
nppiSet_8u_C1R(0, pSrcDst, nSrcDstStep, sizeROI);
nppiFilterGaussBorderGetBufferSize(sizeROI, maskSize, &nBufferSize);
cudaMalloc(&pBuffer, nBufferSize);
nppiFilterGaussBorder_8u_C1R(pSrcDst, nSrcDstStep, sizeROI, maskSize, anchor, pBuffer);
cudaFree(pBuffer);
nppiFree(pSrcDst);
Note that the above code assumes that you have already defined the input and output size (width and height), mask size (maskWidth and maskHeight), and source/destination step (nSrcDstStep).
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-09-28 11:00:00 +0000
Seen: 11 times
Last updated: Jul 22 '21
What is the method for obtaining the integral of a function that represents monthly distribution?
What is the method for employing Dependency Injection in Azure Function .NET 6?
What is the process of using the Multmerge() function in r to combine files in a directory?
Is it possible for two distinct useState functions to trigger changes simultaneously?
How can one use node to change an ogg file into an mp3 file?
How can a function pointer be transferred between different files in CUDA?
What does the error message "TypeError: e.endsWith is not a function" mean in Redoc?