The example is based on the two Stack Overflow threads:
- Accessing OpenCV CUDA Functions from Python (No PyCUDA)
- OpenCV: Understanding warpPerspective / perspective transform
Note: Most codes are wrote by ostrumvulpes and stefan-at-wpf
Precondition: OpenCV w/ CUDA support has been installed.
$ ./build.sh
$ python3 test.py
Then check warped.jpg
and warped_gpu.jpg
.