网络摄像头:以编程方式调整网络摄像头参数
在我们的项目中,我们希望以编程方式访问网络摄像头图像。 我们遇到的主要问题是网络摄像头会根据捕获图像的亮度自动调整灵敏度。
是否有任何(独立于平台的)方法来更改网络摄像头(最好是任何型号)的此类参数?
我们目前使用的是 Ubuntu 10.04、Microsoft Windows XP 和 Windows 10.04。 7. 编程语言为C/C++。
任何想法表示赞赏。
感谢和问候 托比亚斯
In our project, we would like to access the webcam image programmatically.
The main problem we have is that the webcam automatically adjusts the sensitivity depending on the brightness of the captured image.
Is there any (platform-independent) way to change this kind of parameters for the webcam (preferably any model)?
We're currently using Ubuntu 10.04, Microsoft Windows XP & 7. Programming language is C/C++.
Any idea is appreciated.
Thanks and regards
Tobias
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很可能没有任何独立于平台的方法来完成您的需要。如果有,可能是使用一些高级语言,这可能不适合。
我不了解 linux 平台,但我是一名 C++/windows/COM/DirectShow 开发人员,致力于基于互联网的视频应用程序。
在Windows平台上,捕获设备通过COM和DirectShow进行通信。
有关 Windows 上视频捕获的一般概述,请参阅 视频捕获部分。
查看选择捕获设备有关如何枚举系统上的捕获设备的信息。您需要枚举 CLSID_VideoInputDeviceCategory 中的设备,以便(以编程方式)发现网络摄像头作为视频输入设备 - 此类别中可能有许多设备。
视频捕获设备具有“友好名称”,可帮助识别您的网络摄像头,您可以存储和检索该设备以供以后使用。
获得设备后,您的查询表明您想要配置该设备。查看配置视频捕获设备 为此。
DirectShow 是 Microsoft 最全面(也是最难学)的 API 之一。 DirectShow 上的 MSDN 开发人员论坛 非常活跃且对初学者友好,我高度评价建议你检查一下。
最后,捕获图并不是在 DirectShow 中构建的最简单的东西,我将从一个简单的播放图开始 - 例如,从磁盘播放媒体文件并从那里开始捕获图。
VLC 项目是开源且跨平台的,它使用 DirectShow 在 Windows 平台上进行播放。
祝你好运!
There most likely won't be any platform independent way to do what you need. If there is, it's probably by using some high level language, which likely won't suit.
I don't know about the linux platform, but I'm a C++/windows/COM/DirectShow developer who works on internet based video applications.
On the Windows platform, capture devices are communicated with via COM and DirectShow.
For a general overview of video capture on windows, see the Video Capture section of MSDN.
Have a look at Selecting a Capture Device for information on how to enumerate the capture devices on your system. You'll need to enumerate the devices in the CLSID_VideoInputDeviceCategory, in order to discover (programmatically) the webcam as a video input device - there may be many devices in this category.
Video capture devices have a "FriendlyName" to help identify your webcam that you can store and retrieve the device for later use.
Once you've got the device, your query said you'd wanted to configure the device. Check out the Configuring a Video Capture Device for this.
DirectShow is one of Microsoft's most comprehensive (and difficult) APIs to learn. The MSDN developer forum on DirectShow is very active and beginner friendly and I highly recommend you check it out.
Finally, capture graphs aren't the easiest thing to build in DirectShow, I'd start off with a simple playback graph - e.g. playback a media file from disk and progress from there to capture graphs.
The VLC project is open source and cross-platform and it uses DirectShow for playback on the windows platform.
Good luck!