Hi all,
I have seen many posts talking about problems with nppiFilter_8u_C1R.
I tried to make a sobel, but I can get the nppiFilter_8u_C1R function working.
If anybody could investigate once and for all on this recurring problem, that could be very nice…
Here is a code that should be working:
inline void sobelX(const npp::ImageNPP_8u_C1 & in, npp::ImageNPP_8u_C1 & sdx )
{
NppiPoint anchor1 = { 1, 1 };
Npp32s kernelSobelX = { -1, 0, 1,
-2, 0, 2,
-1, 0, 1 };
NppiSize kernSize3 = { 3, 3 };
NppiSize sizeROI3 = { in.width() - kernSize3.width + 1, in.height() - kernSize3.height + 1 };
Npp32s *gpuKernel = NULL;
cudaMalloc( &gpuKernel, kernSize3.width * kernSize3.height * sizeof(Npp32s) );
cudaMemcpy( gpuKernel, kernelSobelX, kernSize3.width * kernSize3.height * sizeof( Npp32s ), cudaMemcpyHostToDevice );
NppStatus eStatusNPP;
eStatusNPP = nppiFilter_8u_C1R( in.data() + in.pitch() + 1, in.pitch(),
sdx.data() + sdx.pitch() + 1, sdx.pitch(),
sizeROI3, gpuKernel, kernSize3,
anchor1, 1 );
nppiFree( gpuKernel );
}
But it returns a NPP_CUDA_KERNEL_EXECUTION_ERROR
Any idea ?
Ok, sorry, the code actually works… It’s the nppiCanny_32f8u_C1R function calling that makes it bugging on the next sobel frame computation.
Very strange…