OpenCv 斑点/轮廓标记
您好,我已经为此工作了一段时间,但尚未找到好的解决方案。
我正在逐帧阅读视频,并使用背景减法来“ 识别有运动的区域并使用 cvFindContours() 获取运动对象的矩形边界。
假设程序保持简单,则只能有 2 个人。
这些物体以一定的间隔重叠、转动和移开的方式移动。
我怎样才能正确地标记这个人类x 2。
cvFindContour 可以以随机方式返回边界。 对于 Frame1、Frame2、Frame3...FrameN,
我最初可以比较矩形边界质心以正确标记人体。 一旦人类重叠并移开,这种方法就会失败。
我试图跟踪原始 obj 的像素颜色(但是人类非常相似,并且某些区域具有相似的颜色,例如手、腿、头发),因此还不够好。
我正在考虑使用图像统计,例如:
CountNonZero(), 像素总和() 意思是() 平均值_标准差 () 最小最大定位 () Norm()
唯一区分两个对象。 我相信这将是一个更好的方法。
Hi i have been working on this for a while and yet to have no good solution.
I am reading a video frame by frame and am using background subtraction to '
identify the region where is there movement and use cvFindContours() to get the rectangle boundary of the moving objects.
Assuming the program is kept simple there can be only 2 human.
These objects and move in a manner they can overlapped, make turn and move away at certain interval.
How can i label this humans x 2 correctly.
cvFindContour can return the boundary in a random manner. for Frame1,Frame2,Frame3....FrameN
I can initially compare rect boundary centroid to label the human correctly. Once the human overlapped and move away this approach will fail.
I tried to keep track of pixel color of the original obj (however the human are fairly similar and certain areas have similar colors like hand,leg,hair ) hence not good enough.
I was considering using Image Statistic like :
CountNonZero(),
SumPixels()
Mean()
Mean_StdDev ()
MinMaxLoc ()
Norm ()
to uniquely distinguish the two objects. I believe that would be a better approach.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来很困难,尤其是当视频中有很多噪音时。
也许可以识别两个人互动的不同情况。 一些例子:
计算机视觉教科书可以帮助确定其他情况。
考虑测量您为视频中的每一帧列出的所有这些函数,然后绘制它们的结果。 由此确定是否有一种方法可以匹配诸如人类在交叉路径后的边界框中像素颜色的标准偏差之类的东西。
Sounds difficult, especially if there is a lot of noise in the video.
Perhaps identifying the different cases in which two humans would interact. Some examples:
Computer Vision textbooks could help in determining other cases.
Consider measuring all of those functions you listed for every frame in the video and then graph their results. Determine from that if there is a way to match something like the standard deviation of pixel colour in a bounding box to which human is which after they cross paths.
这是一个难题,任何解决方案都不会是完美的。 计算机视觉被戏称为“人工智能完整”学科:如果你解决了计算机视觉,你就解决了所有人工智能。
背景扣除是检测物体的好方法。 如果您需要改进背景扣除结果,您可以考虑使用 MRF。 据推测,您可以根据 Blob 的大小判断何时存在单个对象以及何时两个 Blob 合并。 如果在合并 blob 期间轨迹没有快速变化,您可以执行 卡尔曼跟踪并使用一些启发式之后消除斑点的歧义。
即使两个对象之间的颜色相似,您也可以考虑尝试使用 均值漂移跟踪器。 您可能需要执行一些粒子过滤来跟踪有关谁是的多个假设WHO。
还有一些更复杂的技术,称为分层跟踪。 Jojic 和 Frey 最近的一些工作,作者:Winn,作者:周和陶,以及其他人。 大多数这些技术都带有非常强的假设和/或需要大量工作才能正确实施。
如果您总体上对这个主题感兴趣,我强烈建议您参加计算机视觉课程和/或阅读教科书,例如 庞塞和福赛思的。
This is a difficult problem and any solution will not be perfect. Computer vision is jokingly known as an "AI-complete" discipline: if you solve computer vision and you have solved all of artificial intelligence.
Background subtraction can be a good way of detecting objects. If you need to improve the background subtraction results, you might consider using an MRF. Presumably, you can tell when there is a single object and when the two blobs have merged, based on the size of the blob. If the trajectories don't change quickly during the times the blobs are merged, you can do Kalman tracking and use some heuristics to disambiguate the blobs afterwards.
Even though the colors are similar between the two objects, you might consider trying to use a mean shift tracker. It's possible that you may need to do some particle filtering to keep track of multiple hypotheses about who is who.
There are also some even more complicated techniques called layered tracking. There is some more recent work by Jojic and Frey, by Winn, by Zhou and Tao, and by others. Most of these techniques come with very strong assumptions and/or take a lot of work to implement correctly.
If you're interested in this topic in general, I highly recommend taking a computer vision course and/or reading a textbook such as Ponce and Forsyth's.
您可以尝试记住每一帧的一个角(例如左上角)。 然后,当您收到新的一组框架时,您可以将它们的角点距离与之前保存的角点距离进行比较。 这当然不是完美的解决方案。
You could try to remember one corner of each frame (top left for example). Then, when you receive your new set of frames, you compare the distance of their corners to the ones previously saved. This is of course no perfect solution.