如何在C#中跟踪视频中矩形所包围的区域? [英] How to track an area enclosed by a rectangle on a video in C# ?

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

问题描述

这就是我正在做的事情,我将网络摄像头的输入带到C#的图片框中,然后用鼠标在视频上画一个矩形。然后我计划跟踪由矩形包围的特定区域(例如右眼)作为视频流,例如,如果人向右移动,矩形也将向右移动但将保持粘在右眼上。换句话说,矩形将与人眼一起移动。在下面的视频中,正在考虑的区域是右眼。



我还在学习绘制视频。我一直在看Directshow示例bitmapmixer来获得一个想法。



我想知道的是如何隔离具有整个矩形的框架(因为一个人)不能在单个框架上绘制)以及如何跟踪该区域。我想要获得封闭区域的颜色直方图,然后在后续帧中搜索该区域。



查看图像>>> http://i29.tinypic.com/2466s02.jpg



任何想法。



非常感谢。

Hi, this is what I am doing, I take the input from a web camera onto a picturebox in C# and draw a rectangle on the video using a mouse. Then I plan to track that particular area(e.g. right eye)enclosed by the rectangle, as the video streams, for instance if the person moves to the right, the rectangle will also move to the right but will stay glued to the right eye. In other words the rectangle will move along with the human eye. In the below video, the area under consideration is the right eye.

I am still learning to draw on a video. I have been looking at the Directshow sample bitmapmixer to get an idea.

What I want to know is how to isolate the frame which has the whole rectangle(since a person cant draw on a single frame) and how to track the region. I was thinking of getting the color histogram of the enclosed area and then searching for that area in the subsequent frames.

Check Image >>> http://i29.tinypic.com/2466s02.jpg

Any ideas.

Many Thanks.

推荐答案





你的主要问题是模式识别。根据您在图像中尝试识别的内容,这可能非常棘手,并且有很多库可以为您完成这项工作但非常昂贵。

- Cognex www.cognex.com



- National Instruments:http://www.ni.com/vision/ [ ^ ]

- AForge图书馆: AForge.NET框架 [ ^ ]



这里有一些关于codeproject的好文章可能对你有帮助。有些甚至涵盖了面部和眼睛检测的问题:



使用OpenCV进行面部和眼睛检测 [ ^ ]



C#中的人脸检测 [ ^ ]



运动检测算法 [ ^ ]



这应该让你开始,因为这些文章做了类似你想要达到的事情。



问候,



JF
Hi,

your main problem will be the pattern recognition. Depending on what you are trying the recognize in an image this can be quite tricky and there are lots of libraries out there that will do this job for you but are very expensive.
- Cognex www.cognex.com

- National Instruments: http://www.ni.com/vision/[^]
- AForge Library: AForge.NET framework[^]

There are several good articles here on codeproject that might help you. Some even cover the problem of face and eye detection:

Face and Eyes Detection Using OpenCV[^]

Face Detection in C#[^]

Motion Detection Algorithms[^]

This should get you started since these articles do similar things like you want to achieve.

Regards,

JF


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

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