简体   繁体   English

模块“cv2.cv2”没有属性“cvtcolor”

[英]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有错误的代码,对不起从意大利语翻译的语言

Error duting the runtime运行时出错

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM