Created
September 24, 2018 14:59
-
-
Save atinfinity/b2f89e33e398559c5fcefda3ad3c0269 to your computer and use it in GitHub Desktop.
Python bindingからGpuMatを使うサンプルコード(OpenCV 4.0以上)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
img = cv2.imread('lena.jpg', cv2.IMREAD_COLOR) | |
d_img = cv2.cuda_GpuMat() | |
d_img.upload(img) | |
d_gray = cv2.cuda.cvtColor(d_img, cv2.COLOR_BGR2GRAY) | |
gray = d_gray.download() | |
cv2.imshow('img', img) | |
cv2.imshow('gray', gray) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment