Canny operator call failed in NPP

canny_npp_new.cpp (2.0 KB)
canny_npp.cpp (2.1 KB) (4.7 MB)

Related code and clion project as above:
I used two ways to call the canny edge detection operator in NPP. The first one is handwritten by myself according to the instructions in the official document, but the return result of the edge detection is a completely black image of the same size as the original input; second one is a reproduced official demo about canny, but it can only load pgm images, nimages in jpg and other formats can not be loaded. What’s the problem with the first code(canny_npp.cpp)? How can the second code(canny_npp_new) accept image input in other formats?[|attachment]This is

The relevant environment is:cuda10.2 ubuntu18.04.5

I have solved this problem. The ebordertype only support:NPP_BORDER_REPLICATE, and the nLowThreshold should be less than nHighThreshold,the code is
canny_npp.cpp (2.4 KB)