java(一些java API)或C#(emgucv,dshownet,Aforge.NET)中的实时对象跟踪
我正在做一个名为用户启动的实时对象跟踪系统的项目。这是我希望在项目中发生的情况:
1) 从网络摄像头获取连续流。
2) 用户可以使用鼠标在感兴趣的对象周围绘制一个正方形。
3) 然后从那里开始,方块会随着感兴趣的对象一起移动。因此,跟踪对象移动的每个位置,因此称为“对象跟踪”。
当前进度
我已经使用 dshownet(DirectShow 的.NET 包装器)从网络摄像头获取输入。我正在将视频分割成帧。我想到了 4 种方法来完成这个项目:
技术 1
- 有一个保存的视频,
- 我加载它。
- 当视频运行时,我在特定场景暂停(使用暂停按钮)它并在对象上绘制一个正方形。
- 当我按下播放按钮时,方块将与对象一起移动,处理时间为 5 秒 [或者] 我会给应用程序一些处理时间(例如 3 分钟),然后它将从该点开始播放,并进行跟踪地方。
技巧2
- 有一个保存的视频,
- 我加载它。
- 当视频运行时,我不会暂停它,而是快速在一个对象上绘制一个正方形(当该对象仍处于某个时刻时)。
- 然后将在没有处理时间的情况下跟踪该对象。 [或] 一些处理时间(10 秒延迟)使文件播放的时间更长一些。
技术 3
- 我从网络摄像头获取输入 1 分钟。
- 将该视频保存到文件
- 并执行方式 1 或方式 2
技术 4 - (显然这看起来更难)
- 连续从网络摄像头获取输入
- 当对象没有显示任何移动时,在对象周围绘制一个正方形,没有任何暂停(例如,当一个人坐在椅子上时)
- 然后通过将方块与对象一起移动来显示跟踪,无需处理时间 [或] 2 秒的轻微处理时间,以便延迟不明显。
要跟踪的对象:-
基本上我可以跟踪任何东西,因为我使用鼠标绘制,所以
- 我计划使用整个身体(但如果这很麻烦..下一个选项)
- 我会尝试跟踪个人的脸部(显然是通过用鼠标绘制区域来实现的。)
编码时间: 1又1/2个月
进度: 拆分时仍然出现错误。 (有人建议先开始分割保存的视频,我现在正在尝试)
我的问题
1) 我可以使用哪种技术(四种)可能在 1 又 1/2 个月的时间内实施?
2)对于编码,java+一些java框架适合这个或C#.net与emgucv/AForge.net/Dshownet [顺便说一句,我在java方面的知识是好,但在方面却不那么好 C#.net]?
提前致谢
I am doing a project called user initiated real time object tracking system. Here, is what I want to happen in the project:
1) Take a continuous stream from a web camera.
2) Using the mouse a user can draw a square, around an object of interest.
3) Then from there onwards, the square moves along with the object of interest. Thereby, tracking each and every place the object moves hence the term object tracking.
Current Progress
I have used dshownet(.NET wrapper for DirectShow)to take input from the web camera. And I am in the process of splitting the video to frames. I have 4 ways in mind to do the project :
Technique 1
- There is a saved video
- I load it.
- when the video is running, i pause (using a pause button) it, at a particular scene and draw a square on an object.
- And when i press play button the square will move along with the object with no/5 seconds processing time [OR] I will give the application some processing time(e.g. 3 minutes) and then it will play from that point onwards with the tracking taking place.
Technique 2
- There is a saved video
- I load it.
- when the video is running i dont pause it but quickly draw a square on an object (when the object is still at some point).
- Then the object will be tracked after that with no processing time. [OR] with some processing time (10 sec delay) making the file to play for a little greater time.
Technique 3
- I take an input from a web cam for 1 min.
- Save that video to a file
- And perform Way 1 or Way 2
Technique 4 - (Apparently this seems alot harder)
- Take input from a web cam continuously
- Draw a square around the object without any pausing, when the object shows no movement (for e.g. when a person is sitting down on a chair)
- And then show the tracking by moving the square along with the object with no processing time [OR] slight processing time of 2 secs such that the delay is not significantly apparent.
Objects to track :-
Basically I can track anything, since I use the mouse to draw
- I am planning to use the whole body (but if this is troublesome.. next option)
- I would try to track the face of an individual (obviously by drawing the area with a mouse.)
Time to code : 1 and 1/2 months
Progress : Still getting errors with the splitting. (Someone suggested to start splitting a saved video first, and I am in the process of trying that now)
MY QUESTIONS
1) Which Technique (out of the four) could I possibly implement in 1 and 1/2 months time frame ?
2) To code, is java + some java framework good for this or C#.net with emgucv/AForge.net/Dshownet [by the way my knowledge in java is good and not so good in C#.net]??
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 Java Media Framework 和 ImageJ 库在 Java 中实现技术 1、2、3。对于技术 4,考虑到时间限制,您最好使用 C++ 或其他非解释语言来实现。
Technique 1,2,3 you could implement in Java using the Java Media Framework and ImageJ libraries. For Technique 4 you are better to implement in C++ or other non-interpreted language given the time constraints.
这个示例基本上实现了您提到的技术4。用户在要跟踪的图案或对象周围绘制一个矩形。在这种情况下,被跟踪的元素用于控制乒乓球游戏中的球拍。因此,用户可以在镜头前使用物体来玩游戏。
我认为它解决了你问题的大部分。
屏幕截图:
源代码:
This example basically implements what you mentioned as Technique 4. The user draws a rect around a pattern or object to be tracked. In this case the tracked element is used to control the paddle in the Pong Game. Therefore the user can use objects to play the game in front of camera.
I think it solves the most parts of your problem.
Screenshot:
Source code:
本文充分解释了与您想要的非常相似的算法,并且附带的源代码在这里。您可以在此视频中查看实际效果。您需要添加的部分是,当用户绘制一个框时,识别该框周围的对象(算法已经找到),然后简单地在整个帧中跟踪具有该 int ID 的对象(该算法将逐帧识别对象,以了解它在整个视频中是同一对象)。
免责声明:我是作者;但我确实认为这非常有用,并且我自己也成功地使用了该算法很多次。)
当谈到商业计算机视觉应用时,OpenCV< /a> 和点云库又名 PCL 是您最好的朋友。类似链接的文章解释了如何使用 OpenCV 等工具来完成全堆栈运动跟踪。 (纯 Java 实现展示了它如何细化到单个像素。)
This article fully explains an algorithm very similar to what you want, and the accompanying source code is here. You can see it in action in this video. The part you would need to add would be, when the user draws a box, to identify which objects (already found by the algorithm) the box is around, and then simply follow the object with that int ID throughout the frames (the algorithm correlates the objects frame-by-frame to know it is the same object throughout the video).
Disclaimer: I'm the author; but I do think this is very useful, and have successfully used the algorithm a lot myself.)
When it comes to commercial computer vision applications, OpenCV and the Point Cloud Library aka PCL are your best friends. And articles like the one linked explains how to use tools like OpenCV to accomplish full stack motion tracking. (The pure Java implementation shows how it works down to the individual pixels.)