当前位置:网站首页>Opencv reports an error. Expected PTR < CV:: UMAT > for argument '% s'‘

Opencv reports an error. Expected PTR < CV:: UMAT > for argument '% s'‘

2022-04-23 20:47:00 NuerNuer

In the use of opencv When processing images , Use cv2.imwrite() Errors are always reported when saving images :

Expected Ptr<cv::UMat> for argument '%s'

Look up the data and find , stay cv::UMat When passing parameters , Type must be np.float32, Pass in another type ( example ,np.int32) Will report a mistake

terms of settlement :

img_ = np.float32(img)
......
cv2.imwrite('a.jpg', img_)

namely , Convert other types of data into np.float32

版权声明
本文为[NuerNuer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210545523211.html