Closed serjl closed 4 years ago
dest.CopyToDevice(scr.DevicePointerRoi, dest.Pitch)
-> use the src.Pitch
as argument.
Or simply use src.Copy(dest)
, that one handles all ROI settings.
Notice also, that if you want to copy the final image to a bitmap of different size you have to use CopyToHostRoi.
Thanks a lot for a quick reply! Both work nice as expected.
Hello kunzmi,
I was trying to crop an NPP Image NPPImage_8uC1 src by the following code:
src.SetRoi(nppRect); NPPImage_8uC1 dest= new NPPImage_8uC1(nppRect.width, nppRect.height); dest.CopyToDevice(scr.DevicePointerRoi, dest.Pitch);
dest.CopyToHost(bitmap); As a result the bitmap is corrupted - kinda wrong pitch - pixels are spread wrong .
I guess I'm using CopyToDevice wrong.
What is the best and short way to crop the NPP image on GPU. (Of course I can write a kernel and run it). Can you please consult in the issue. Thank you a lot in advance.