[英]module 'cv2.cv2' has no attribute 'cvtcolor'
I never used python and openCV before and I don't know what is the problem.我以前从未使用过 python 和 openCV ,我不知道是什么问题。
from PIL import ImageGrab
import cv2
import time
last_time = time.time()
while(True):
screen = np.array(ImageGrab.grab(bbox=(0,40, 640, 480)))
print('Loop took {} second'.format(time.time()-last_time))
cv2.imshow('window', cv2.cvtcolor(screen, cv2.COLOR_BRG2RGB))
if cv2.waitKey(25) & 0xFF == ord('q'):
cv2.destroyAllWindow()
break
this is the code, can somebody help me understand the problem?这是代码,有人可以帮我理解问题吗?
thanks谢谢
the code with the error, sorry for the language translate from italian有错误的代码,对不起从意大利语翻译的语言
should be cvtColor
as cvtcolor
renamed to cvtColor
应该是
cvtColor
作为cvtcolor
重命名为cvtColor
source: https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_colorspaces/py_colorspaces.html来源: https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_colorspaces/py_colorspaces.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.