Ask Your Question
-1

TypeError: no matching UMat constructor found/supported

asked 2018-01-14 20:28:47 -0500

MadFrog gravatar image

When I use cv2.UMat,an error has occured,how can I fix it?

I have installed CUDA.

My test code:

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)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-01-15 02:55:26 -0500

VxW gravatar image

Hi,

pic1 is a string. therefore do it in that way:

 img = cv2.imread(pic1)
 img_umat = cv2.UMat(img)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-14 20:28:47 -0500

Seen: 110 times

Last updated: Jan 15