简体   繁体   English

如何使用 python 访问笔记本电脑的内置红外网络摄像头?

[英]How can I access my laptop's built-in infrared webcam using python?

I'm trying to access my laptop's built-in infrared webcam (intended for windows hello) in a python project.我正在尝试在 python 项目中访问我笔记本电脑的内置红外网络摄像头(用于 windows hello)。 I can access the normal RGB camera quite easily using the VideoCapture class from OpenCV, however can't find a way to access the infrared camera.我可以使用 OpenCV 的 VideoCapture class 轻松访问普通 RGB 摄像头,但是找不到访问红外摄像头的方法。 I tried passing different indices to the VideoCapture class, however only "0" works, which is the normal webcam.我尝试将不同的索引传递给 VideoCapture class,但是只有“0”有效,这是普通的网络摄像头。

There are ways to do this using the Windows API , however I can't find a way to access this in Python.有一些方法可以使用Windows API来做到这一点,但是我在 Python 中找不到访问它的方法。

Some people have been able to access the windows hello camera on Ubuntu using fswebcam .有些人已经能够使用fswebcam访问 Ubuntu 上的 windows hello 摄像头。

Is there anyway to access the infrared camera using python?无论如何可以使用 python 访问红外摄像机吗? Maybe some way of interfacing with the Windows API using pywin32?也许某种方式使用 pywin32 与 Windows API 进行交互? Any help getting started with this would be appreciated.任何帮助开始这将不胜感激。 Alternatively, is there anything similar to fswebcam for Windows that would let me do the same?或者,有什么类似于 Windows 的 fswebcam 可以让我做同样的事情吗?

That example you provided, doesn't seem to use the win32 api, but rather the dotnet framework, specifically the Windows.Media.Capture.Frames.MediaFrameSourceGroup class.您提供的那个例子似乎没有使用win32 api,而是使用dotnet框架,特别是Windows.Media.Capture.Frames.MediaFrameSourceGroup ZA2F2ED4F8EBC2CBB4C21A29DC40AB61D

It looks like you'll be able to access the dotnet framework using http://pythonnet.github.io/ .看起来您将能够使用http://pythonnet.github.io/访问 dotnet 框架。 After that it should be a case of porting that C# code over to Python.之后,应该将 C# 代码移植到 Python。

You need to access WinRT API, not Win32 API.您需要访问 WinRT API,而不是 Win32 API。

Use this library: https://github.com/Microsoft/xlang/tree/master/src/package/pywinrt/projection and you should be able to call invoke necessary parts in WinRT from the code you posted.使用这个库: https://github.com/Microsoft/xlang/tree/master/src/package/pywinrt/projection ,您应该能够从您发布的代码中调用 WinRT 中的必要部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有办法在 python 应用程序中使用笔记本电脑的内置生物识别传感器? - Is there a way to use laptop's built-in biometric sensors in python applications? 如何访问 Python 中的网络摄像头? - How do I access my webcam in Python? 如何在不破坏Python内置属性类的情况下为其添加参数来扩展它? - How can I extend Python's built-in property class by adding an argument to it without breaking it? 如何在C#中复制Python的已排序内置函数的行为? - How can I replicate the behavior of Python's sorted built-in function in C#? 什么是Python的“内置方法获取”? 我怎样才能加快速度? - What is Python's “built-in method acquire”? How can I speed it up? 如何使用 Boost.Python 在 Python 中调用内置函数 - How can I call built-in functions in Python using Boost.Python 如何在python中重载内置模块? - How can I overload a built-in module in python? 如何更改Sublime Text 2中的内置python? - How can I change the built-in python in Sublime Text 2? Python:我如何从内置列表类型继承? - Python: How can I inherit from the built-in list type? 我如何使用PyCall在julia中使用像isinstance()这样的python内置函数 - How can i use python built-in function like isinstance() in julia using PyCall
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM