Hello, I was wondering why doing the operation below (with the intent of skipping the first and last rows and columns) does not achieve the desired result and, in the case of the erode Npp function, even falls into a device memory leak? It seems that the problem is arised by the “+1” of the source image pointer used to skip the first column for each row. I saw that this wrong effect is achieved when doing the same on a lot of other Npp methods (like nppiSet for example, …).
pSrcIma, pDstIma and erodeMaskDevice are all unsigned char images.
pSrcIma and pDstIma are 4096x900 while erodeMaskDevice is 3x3.
NppiSize oSizeROI = { pSrcIma->HostSizeX() - 2, pSrcIma->HostSizeY() - 2 };
NppiSize erodeMaskSize = { 3, 3 };
NppiPoint erodeMaskAnchor = { 1, 1 };
NppStatus res = nppiErode_8u_C1R(pSrcIma->GetDevicePtr(0)+ pSrcIma->DevicePitch() + 1, pSrcIma->DevicePitch(), pDstIma->GetDevicePtr(0)+ pDstIma->DevicePitch() + 1, pDstIma->DevicePitch(), oSizeROI, erodeMaskDevice.GetData(0), erodeMaskSize, erodeMaskAnchor);