【问题标题】:python opencv blocked image icon showing when reading image读取图像时显示的python opencv阻止图像图标
【发布时间】:2021-07-24 08:45:29
【问题描述】:

我有一个小型 OpenCV 脚本,可与我的 Windows 笔记本电脑摄像头配合使用,但在插入外部 Logitech C922 Pro 高清流网络摄像头时无法正常工作。

我已更改 cap = cv2.VideoCapture(xxxNUMBERxxx) 中的数字以打开相机但没有运气。我也安装了罗技驱动程序,但没有运气。互联网的其他人似乎认为这是一个权限问题,但我找不到任何特定的权限设置,所以我不确定这是问题所在。我只是希望能够从摄像头获取视频流。

脚本如下:

import numpy as np
import cv2

cap = cv2.VideoCapture(2, cv2.CAP_DSHOW)

while(True):
# Capture frame-by-frame
ret, frame = cap.read()

# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

# Display the resulting frame
cv2.imshow('frame',gray)

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

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

【问题讨论】:

    标签: python opencv camera logitech


    【解决方案1】:

    原来是一个奇怪而愚蠢的解决方案。下载“Logi Capture”应用程序后,我必须在打开 OpenCV 应用程序的同时保持应用程序与通过该应用程序的视频流一起运行。似乎是一种解决方法而不是解决方案,但它对我有用。

    【讨论】:

      猜你喜欢
      • 2013-10-17
      • 1970-01-01
      • 2012-10-20
      • 2015-12-03
      • 2013-09-12
      • 2017-07-24
      • 2020-04-05
      • 2020-08-13
      • 2017-11-23
      相关资源
      最近更新 更多