"OpenCV 3.2中cv2.cv.fromarray的替代方法是什么?"

2024-06-07 18:01:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在写一个人脸识别程序,我从网上得到的参考是使用以前的OpenCV版本。我正在使用OpenCV 3.2.0的源代码构建。在一段视频中把名字放在脸下面。我的参考代码看起来像

cv2.putText(cv2.cv.fromarray(img), str(id), (x, y + h), font, 2, 255);

我得到一个错误:

AttributeError: 'module' object has no attribute 'cv'

请帮忙。


Tags: 代码程序版本idimg视频源代码名字

热门问题