从视频中删除分割(例如人或鸟)的标准技术是什么?
假设您正在拍摄视频(相机处于稳定位置),并且一只鸟飞过相机的视野。应该可以进行图像分割并自动从视频中删除这只鸟。
这些类型的算法叫什么?它们通常是如何实现的?
Let's say you are taking a video (with the camera in a steady position) and a bird flies through the view of the camera. It should be possible to do image segmentation and automatically remove this bird from the video.
What are these styles of algorithms called and how are they normally accomplished?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一种名为简单图像对象提取 (SIOX) 的技术 - 它使用一种识别静态和视频图像中的前景与背景对象的技术。开源 GIMP 编辑器有它的实现,并且有 GIMP 编辑器。 siox.org/" rel="nofollow">更多信息请参见此处。
从概述来看:
这里是 SIOX 的 Java 参考实现的链接。
< strong>这是PDF 的链接,其中详细介绍了如何该算法的变体有效。
您应该能够对其进行调整,以使用帧间插值,通过使用周围帧的时间数据从视频的每个帧中删除特定的前景对象。
There's a technique called Simple Image Object Extraction (SIOX) - it uses a technique to identify foreground vs. background objects in still and video images. The open source GIMP editor has an implementation of it, and there's more information about it here.
From the overview:
Here's a link to the Java Reference Implementation of SIOX.
Here's a link to the PDF with details about how a variation of the algorithm works.
You should be able to adapt it to use inter-frame interpolation to remove a specific foreground object from each frame of a video by using temporal data from surrounding frames.
如果相机是固定的并且场景中没有太多运动,那么我会建议一种基于背景减法的方法。
步骤 1:计算视频每一帧的背景。有复杂的算法可以实现此目的,但一种非常简单且有效的算法是计算 3 秒时间窗口内图像中每个像素的中值。如果所讨论的物体移动缓慢,则时间更长。顺便说一句,如果您只是执行这种过滤,如果相机是固定的,它将从视频中删除大多数移动对象,因此我之前提出了关于所有对象与一个对象的问题。
步骤2:用画笔工具标记每帧中要删除的区域,并用背景像素替换它们。不必费心使用精细画笔或套索工具,因为您标记的任何非对象像素都将被其过滤后的版本替换。您可能可以对多个帧使用相同的画笔标记,因为边界并不那么重要。如果该对象是场景中唯一移动的物体,您可以标记整个帧并将其替换为背景。
无论如何,为了回答您更普遍的问题,您想要研究的主题称为图像修复视频。关于这个主题有很多文献,我所描述的只是一个超级简单的方法,你可以用 opencv 在一个小时左右的时间内实现。
If the camera is fixed and there isn't too much motion in the scene, then I would suggest a method based on background subtraction.
Step 1: Compute background for each frame of the video. There are complicated algorithms for doing this, but a very simple and effective one would be to compute the median value of every pixel in the image across a 3 second time window. Longer if the object in question is moving slowly. Incidentally, if you just perform this kind of filtering it will remove most moving objects from the video if the camera is fixed, hence my earlier question about all objects vs. one object.
Step 2: Mark the regions you want to remove in each frame with a brush tool, and replace them with the background pixels. Don't bother with a fine brush or lasso tool as any non-object pixels you mark will just be replaced with their filtered version. You could probably use the same brush marks for several frames since the boundary is not so important. If the object is the only thing moving in the scene, you could just mark the entire frame and have it replaced with the background.
Anyways, to answer your more general question, the topic you want to research is called inpainting for images and video. There is quite a bit of literature out there on the subject, what I described was just a super simple method you could implement in an hour or so with opencv.