Hi,
You can try the default samples first. To make sure it works. And refer to the sample to check which part triggers failure in your code.
There are OpenCV C samples in
Jetson Linux R32.7.5 | NVIDIA Developer
Driver Package (BSP) Sources
You may also download the samples as reference.