如何使用C#跟踪视频中橡皮筋矩形内的区域 [英] How to track the area within a rubberband rectangle in a video as it streams using C#

查看:102
本文介绍了如何使用C#跟踪视频中橡皮筋矩形内的区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在用C#进行一个名为用户启动的实时对象跟踪"的项目.我想要的是,将网络摄像机的输入输入到图片框(使用dshownet完成),然后在视频上绘制一个橡皮筋矩形(例如在一个人的脸/眼/鼻子/全身)上-我想我要去使用鼠标将其范围缩小),然后我要跟踪由橡皮筋矩形包围的区域.

我目前正在通过samples文件夹中的dshownet bitmapmixer示例来学习如何在视频上进行绘制(但是还没有成功,但是我已经完成了橡皮筋矩形,现在要使其在视频顶部起作用). br/>
看图片----->>> http://i25.tinypic.com/vd32p1.jpg


我的主要问题是跟踪橡皮筋矩形内包含的内容(绘制矩形后,它保持可见,除非使用按钮命令将其擦除).有人说过要进行人脸和眼睛检测(我真的没有在我的项目中进行检测)使用OpenCV进行人脸和眼睛检测.好吧,我可能错了.

我的想法是这样的,我想是否可以考虑将矩形外部的区域作为背景,并提取矩形(前景)中该区域的颜色直方图,并检查其是否在随后的帧中弹出,我可以成功跟踪[我实际上不知道如何通过代码实现此目标].这是正确的吗?

顺便说一句,我认为跟踪器是矩形,只要视频在流中并且与视频中的人一起移动,跟踪器就将保持可见.首先,我将尝试使用保存的视频文件来进行所有操作.

有关如何进行跟踪的任何想法?跟踪面部或整个身体的运动对人体的哪个部位有影响吗?

谢谢您的时间.

Hi, I am doing a project in C# called User Initiated Real Time Object Tracking. What I want is, take input from a webcamera to a picturebox(done using dshownet), then draw a rubber band rectangle on the video(say on a person''s face/eye/nose/whole body - i think i am going to scope it down to face) using a mouse, then I want to track the area enclosed by the rubber band rectangle.

I am currently going through dshownet bitmapmixer sample in the samples folder to learn how to draw on a video(no success yet, however, i have done the rubberband rectangle, its now a matter of making it work on top of the video).

Look at the image ----->>>http://i25.tinypic.com/vd32p1.jpg


My main issue is to track, what is enclosed within the rubber band rectangle(after the rectangle is drawn it stays visible, unless erased with a button command). Someone said to go through Face and eyes Detection(I dont do detection in my project really)Face and Eyes Detection Using OpenCV. Well, I might be wrong.

The way I think of it is as this, I think if I could consider the area outside the rectangle as the background, and the extract the colour histograms of the area within the rectangle(foreground) and check if it pops up in the subsequent frames, I can successfully track[I actually dont know how to achieve this via code]. Is this correct ??

By the way, I consider the tracker to be the rectangle, which will stay visible as long as the video is streaming and move along with the person in the video. To start off, I am experimenting all this with a saved video file.

Any ideas on how to do the tracking ? Does it matter what part of the human I take to track its movements like face or whole body ?

Thank you for your time.

推荐答案

您可以使用AForge:http://www.aforgenet.com/

它具有非常有用的斑点跟踪功能,只需将图像转换为二进制图像(黑白),然后通过AForge斑点检测运行即可.然后,您可以遍历每个矩形(从AForge.Imaging.BlobCounter返回的矩形数组中),使用Graphics.DrawRectangle在图像上绘制矩形.使用原始图像作为来源.

我之前已经做过这些事情,但是制作高效,准确的过滤器相当困难.我希望我的答案是明确的.祝你好运!
You can use AForge: http://www.aforgenet.com/

It has very useful blob tracking, just turn the image to a binary image (black and white) and then run it through AForge blob detection. Then you can run through each rectangle (from the rectangle array returned by: AForge.Imaging.BlobCounter) to draw the rectangle on the image by using Graphics.DrawRectangle. Using your original image as the source.

I''ve done such things before but making a efficient and accurate filter is rather difficult. I hope my answer was clear. I wish you the best of luck!


这篇关于如何使用C#跟踪视频中橡皮筋矩形内的区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆