QMimeDatabase错误OpenCV文档过早结束

ubof19bj  于 2023-03-30  发布在  其他
关注(0)|答案(1)|浏览(792)

Kindly need help with a strange errors related toOpenCVorQTin Python.
下面是错误:

QMimeDatabase: Error loading internal MIME data
An error has been encountered at line 1 of <internal MIME data>: Premature end of document.:

这是我的一个简单的opencv流视频代码:

import cv2

cap = cv2.VideoCapture(1, cv2.CAP_DSHOW)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 120)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 160)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('Y','1','6',' '))
cap.set(cv2.CAP_PROP_CONVERT_RGB, 0)
cv2.namedWindow("frame", cv2.WINDOW_NORMAL)

while True:
    ret, frame = cap.read()
    frame = cv2.normalize(frame, None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8U)
    cv2.imshow('frame', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

我只是运行了一个简单的cv2代码来打开来自我的网络摄像头的视频流。每次我从OpenCV做视频流时,这个错误显示。然而,程序正常运行,网络摄像头窗口打开,但这个错误消息在我的屏幕上看起来令人不安。lol
有没有人知道怎么摆脱这个?提前谢谢你
额外细节:

OS: Windows 10 64bit
Python: 3.7.15 runs using conda
OpenCV: 4.6.10 installed from conda-forge
Numpy: 1.21.5
qt-main: 5.15.2 (installed when installing opencv)
eyh26e7m

eyh26e7m1#

安装opencv-contrib-python可以解决这个问题。pip install opencv-contrib-python

相关问题