Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What's the difference between cv2.imread(img) and cv2.imread(cv2.UMat(img))?

What's the difference between the 2 ways of writing?

I want to use GPU to speed up opencv.

I have installed CUDA.

import cv2

print(cv2.ocl.haveOpenCL())#True
cv2.ocl.setUseOpenCL(True)
print(cv2.ocl.useOpenCL())#True
pic1 = r'dog.jpg'
img = cv2.imread(cv2.UMat(pic1))
cv2.imshow('test',img)
cv2.waitKey(0)

Can this speed up?

What's the difference between cv2.imread(img) and cv2.imread(cv2.UMat(img))?

What's the difference between the 2 ways of writing?

I want to use GPU to speed up opencv.

I have installed CUDA.

My test code: import cv2

import cv2

print(cv2.ocl.haveOpenCL())#True
cv2.ocl.setUseOpenCL(True)
print(cv2.ocl.useOpenCL())#True
pic1 = r'dog.jpg'
img = cv2.imread(cv2.UMat(pic1))
cv2.imshow('test',img)
cv2.waitKey(0)

Can this speed up?

What's the difference between cv2.imread(img) and cv2.imread(cv2.UMat(img))?

What's the difference between the 2 ways of writing?

I want to use GPU to speed up opencv.

I have installed CUDA.

My test code: import cv2code:

import cv2

print(cv2.ocl.haveOpenCL())#True
cv2.ocl.setUseOpenCL(True)
print(cv2.ocl.useOpenCL())#True
pic1 = r'dog.jpg'
img = cv2.imread(cv2.UMat(pic1))
cv2.imshow('test',img)
cv2.waitKey(0)

Can this speed up?