opencv java ip-camera(2个问题)

发布于 2024-11-09 08:18:10 字数 253 浏览 0 评论 0原文

这是我第一次使用 ip 摄像机(D-LINK DCS-5605),我的最终任务是检测对象并跟随它们(控制 ip 摄像机)...

我已经编写了检测对象中的 java 代码我想要使​​用 openCV 的方式...

现在我需要使用 opencv 从 java 处理 ip 相机。

问题1)如何通过OpenCV检测网络摄像机?

问题2)如何通过java控制它?

任何东西都会对我有用 我们将不胜感激您的帮助:) 问候。

this is first time i'm working with ip camera (D-LINK DCS-5605), my final task is to detect objects and FOLLOW THEM (control ip camera)...

I've already wrote java code that detects objects in a way i want usint openCV...

Now i need to work with ip camera from java using opencv.

Question 1) How to detect ip camera via OpenCV?

Question 2) How to control it via java?

Anything will be useful to me,
Your help will be appreciated :)
Regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

删除会话 2024-11-16 08:18:10

亲爱的朋友们,我在这里看到没有回复,
所以这就是我在研究中发现的...

如果你使用 C,有一种方法可以做到这一点,有特殊的方法,但不幸的是在 java 接口中它无法访问...

所以我想如果我真的决定要使用 java 实现此目的,那么我需要修改 OpenCV.java 并导出新的修改后的 jar...

希望这对某人有用...

Dear friends, as i see no responses here,
so there is what i found with my research...

There is a way to do this if you use C, there is special method for that, but unfortunately in java interface it is not accessible...

So i think if i really decide to achieve this with java, then i'll need to modify OpenCV.java and export new modified jar...

hope this will be useful for someone...

ヅ她的身影、若隐若现 2024-11-16 08:18:10

我猜您不再关注这个问题,但如果您或其他人偶然发现这个问题,您可以使用 JNI(Java 本机接口)将 OpenCV(C/C++ 版本)和 Java 连接在一起。这将允许您通过 Java 连接到相机并将图像传递回 OpenCV,或者通过 OpenCV 连接并将它们转发到 Java,具体取决于您的偏好。

我仍在努力寻找通过 Java 连接到 IP 摄像机的最佳方法,但 Xuggler 库工作得很好,并且学习曲线很小。但要通过 OpenCV 连接,您可能只需将相机源的地址放入 CreateFileCapture 方法中,大致如下:

 CvCapture *camera = cvCreateFileCapture("rtsp://username:[email protected]:554/ch1-s1");

这对我有用。您传递的实际字符串将取决于相机。

至于通过 Java 控制摄像头,假设您正在谈论 PTZ 摄像头,那么通过 http 发送命令应该可以。

I'm guessing you aren't monitoring this question anymore but in case you are or anyone else stumbles upon it you can use JNI (Java Native Interface) to connect OpenCV (The C/C++ version) and Java together. This will allow you to either connect to your camera via Java and pass the images back to OpenCV or connect via OpenCV and pass them forward to Java, depending on your preference.

I'm still working on finding the best way to connect to an IP camera via Java but the Xuggler library works pretty well and has a small learning curve. But to connect via OpenCV you may be able to just put in the address of the camera source to the CreateFileCapture method, along the lines of:

 CvCapture *camera = cvCreateFileCapture("rtsp://username:[email protected]:554/ch1-s1");

Which works for me. The actual string you pass will depend on the camera.

As for controlling the camera via Java, assuming you are talking about a PTZ camera then sending the commands via http should work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文