我正在写一个人脸识别程序,我从web上得到的参考资料是使用以前的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'请帮帮忙。
发布于 2017-05-12 03:11:55
对于Python API For OpenCV,图像是numpy数组,因此不需要fromarray() (如果在cv模块中可用)。
有关示例,请参阅here。您可以只将img传递给cv2.putText()。
https://stackoverflow.com/questions/43923669
复制相似问题