【问题标题】:Finding webcam specifications using Python and Tkinter使用 Python 和 Tkinter 查找网络摄像头规范
【发布时间】:2015-05-21 03:24:17
【问题描述】:

我正在使用multiprocessing 模块访问网络摄像头,其GUI 已由Tkinter 呈现。

参考Multiprocessing with PIL,有没有办法使用此模块获取网络摄像头的规格,如分辨率曝光时间

【问题讨论】:

  • 这取决于:GUI 正在调用来自为与相机交互而编写的通信库(例如 dll)中的命令。这很可能具有您需要轮询相机所有设置的命令。您正在使用的 GUI 应用程序的名称是什么(考虑也添加网站)。
  • 我正在使用 Tkinter 。看看tutorialspoint.com/python/python_gui_programming.htm
  • 是的,你提到过。但是 Tkinter 只是 GUI 层。在模块中,它将使用访问相机的库。该模块的名称是什么?
  • 这是一个名为 VideoCapture() 的 Open CV 模块。我想我的问题得到了答案,因为 Open CV 具有访问和更改网络摄像头参数的选项。

标签: python tkinter python-imaging-library python-multiprocessing


【解决方案1】:

参考链接Display an OpenCV video in tkinter using multiprocessing处理函数:

 p = Process(target=image_capture, args=(queue,))

将命令传递给函数image_capture,它创建了一个名为vidFileVideoCapture 实例。此实例可用于查找相机规格。使用:

print "Exposure Time " + str(cap.get(cv.CV_CAP_PROP_EXPOSURE))
cap.set(15, -5) 
# 15 is used for Exposure time 
# and second parameter is the value 
# to which you are setting the exposure time

其他参数设置参考setting-camera-parameters-in-opencv-python

【讨论】:

    猜你喜欢
    • 2023-03-10
    • 2019-02-19
    • 2015-04-25
    • 2018-09-23
    • 1970-01-01
    • 2012-06-16
    • 1970-01-01
    • 2013-04-28
    • 1970-01-01
    相关资源
    最近更新 更多