opencv - “[ WARN:0] global SourceReaderCB::~SourceReaderCB terminating async callback”警告

标签 opencv

尝试运行以下代码时收到警告。我还添加了cv.destroyAllWindows()函数。该警告仍在显示。

import cv2 as cv
import datetime

cap = cv.VideoCapture(0)
cap.set(3,1280)
cap.set(4,720)

while(cap.isOpened()):
    ret, frame = cap.read()

    if ret == True:
        text = "Width: "+str(cap.get(3))+" Height: "+str(cap.get(4))
        datet = str(datetime.datetime.now())
        frame = cv.putText(frame, datet, (10, 50), cv.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 255), 2, cv.LINE_AA)
        frame = cv.circle(frame, (640, 360), 200, (0, 255, 255), 2, cv.LINE_AA)
        cv.imshow("frame", frame)

        if cv.waitKey(1) & 0xFF == ord('q'):
            break

cap.release()
cv.destroyAllWindows()

最佳答案

这个问题是this one的副本

使用cap = cv.VideoCapture(0, cv2.CAP_DSHOW)为我修复了它

关于opencv - “[ WARN:0] global SourceReaderCB::~SourceReaderCB terminating async callback”警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59596748/

相关文章:

visual-studio-2010 - OpenCV 2.3.1 Windows 静态库是否依赖于 zlib?

image-processing - 基于内容的图像检索的直方图比较。不同的颜色空间(RGB、HSV 等)

python - OpenCV VideoWriter错误 "dimensions too large for MPEG-4"

c++ - 以下3个opencv Mat实例有什么区别?

c# - opencv识别功能在C#中无法正常工作

python - CUDA(GPU) 作为 OpenCV 后端

python - typeError: 'NoneType' 对象没有属性 '__getitem__' python

python - 如何去噪图像

python-3.x - 如何使用 opencv 将一系列图像写入视频?

python - 通过排除零和 NaN 来调整图像大小