使用 Java 从网络摄像头捕获高分辨率图像快照
有人知道可用于从网络摄像头捕获高分辨率图像快照的 Java 库吗?
更准确地说: - 检测可用的网络摄像头(笔记本电脑可能有一个内置摄像头和一个通过 USB 连接连接的外部摄像头) - 选择要使用的网络摄像头。 - 检测图像捕获的可用分辨率(例如:具有 1.3 Mp 传感器的网络摄像头最高可达 1280x1024)。 它们通常比视频捕获大得多(例如:同一网络摄像头高达 640x480)。 - 选择要使用的分辨率。 - 根据请求(调用 API 函数),以选定的分辨率从选定的相机捕获快照。
我尝试过: - JMF:很糟糕,不支持自动检测连接的网络摄像头。 - FMJ:使用 LTI-CIVIL 提供网络摄像头支持。 - LTI-CIVIL:仅支持视频捕获。 该代码也很旧(如果我没记错的话,是 2007 年)。 使用 C++ 编写的本机库进行网络摄像头访问。 适用于 Windows 的 DirectX 和适用于(显然)Linux 的 Video4Linux。 但查看 C++ 代码,很明显它是面向 视频流这不是我的目的(正如我需要的描述中所反映的)
如果有人能给我指出一个适合我需要的Java库,我将不胜感激。
谢谢。
Anyone knows a Java library which can be used for the purpose of capturing high-resolution image snapshots from a webcam?
More precisely:
- Detect the available webcams (laptops may have a built-in one and an external one attached trough an USB connection)
- Choose a webcam to work with.
- Detect available resolutions for IMAGE capture (ex: up to 1280x1024 for a web camera with 1.3 Mp sensor).
They are generally much greater than the for VIDEO capture (ex: up to 640x480 for the same web camera).
- Choose a resolution to work with.
- On request (calling an API function), capture a snapshot from the selected camera with the selected resolution.
I've tried:
- JMF: sucks, doesn't support automatic detection of attached web cameras.
- FMJ: uses LTI-CIVIL for webcam support.
- LTI-CIVIL: only supports VIDEO capture.
The code is also very old (2007 if i remember correctly).
Uses native libraries written in C++ for webcam access.
DirectX for Windows and Video4Linux for (obviously, ) Linux.
But looking over the C++ code, it becomes obvious that it's oriented towards
video streaming which is not my purpose (as reflected in the description of what i need)
I would be thankful if anyone could point me to a Java library which fits the profile i need.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
openCV 是一个流行的 C++ 计算机视觉库。然而,它们也有 Java 绑定。
http://code.google.com/p/javacv/
OpenCV 让您访问图像以及视频处理以及从多个网络摄像头捕获图像和视频。
openCV is a popular C++ computer vision library. However, they have Java bindings as well.
http://code.google.com/p/javacv/
OpenCV lets u access to image and video processing and capturing of image and video from multiple webcams as well.
这个 Java API 应该可以完成这项工作: http://webcam-capture.sarxos.pl/
以下代码拍摄一张图片并将其作为 .png 文件保存在项目的工作区文件夹中。请务必查看创建者网站上的其他示例。
This Java API should do the job: http://webcam-capture.sarxos.pl/
The following code takes a picture and saves it as a .png file in the project's workspace folder. Be sure to look through the creator's other examples on their website.
以下开源项目 webcamstudio http://code.google.com/ p/webcamstudio/ 使用 Java 来支持网络摄像头,做得非常出色。也许可以从那里得到一些想法。
The following open source project, webcamstudio http://code.google.com/p/webcamstudio/ has done a great job using Java for webcam support. Perhaps take some ideas from there.
您可以使用JMyron,库是此处,您可以看到它如何与 此示例
You can use JMyron, the library is here and you can see how it works with this example