Use pybind11 to generate a python binding of guided filter with cuda enabled.
- OpenCV with CUDA enabled
- Python
- Pybind11
- git clone https://github.com/TracelessLe/pybind11_guidedfilter_cuda.git
- cd into the project path
- git clone https://github.com/pybind/pybind11.git
- cmake .
- make
- use it
Use in Python
import cv2
import gfcuda
img = cv2.imread('cat.png')
guide = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
final_img = gfcuda.guidedFilter(guide=guide, src=img, radius=5, eps=50*50, dDepth=-1)
cv2.imwrite('out.png', final_img)