OpenCV4中有哪些视频背景/前景分割(背景建模/前景提取)算法的类,它们各自的算法原理和特点是什么。
Posted 昊虹图像算法
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenCV4中有哪些视频背景/前景分割(背景建模/前景提取)算法的类,它们各自的算法原理和特点是什么。相关的知识,希望对你有一定的参考价值。
关于OpenCV4中有哪些视频背景/前景分割(背景建模/前景提取)算法的类,汇总如下:
上面的汇总不仅显示了OpenCV4中有哪些视频背景/前景分割(背景建模/前景提取)算法的类,还显示了它们的继承、派生关系。
每一种具体的算法实现类都是继承于类cv::BackgroundSubtractor,而类cv::BackgroundSubtractor又继承于cv::Algorithm。
接下来分别介绍:
目录
- cv::BackgroundSubtractorKNN
- cv::BackgroundSubtractorMOG2
- cv::bgsegm::BackgroundSubtractorCNT
- cv::bgsegm::BackgroundSubtractorGMG
- cv::bgsegm::BackgroundSubtractorGSOC
- cv::bgsegm::BackgroundSubtractorLSBP
- cv::bgsegm::BackgroundSubtractorMOG
- cv::cuda::BackgroundSubtractorFGD
- cv::cuda::BackgroundSubtractorGMG
- cv::cuda::BackgroundSubtractorMOG
cv::BackgroundSubtractorKNN
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
cv::BackgroundSubtractorMOG2
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
cv::bgsegm::BackgroundSubtractorCNT
cv::bgsegm::BackgroundSubtractorCNT是OpenCV3.1以上版本才有的。
CNT来自于单词count,即计数。它的特点是在常规背景/前景分割类中(即不是cuda实现的背景/前景分割类),速度最快,比如在某一次试验中的结果如下:
pi@pilab2:~/tmp/mnt/build_pi3 $ ./demo -file=/home/pi/tmp/mnt2/samples/data/768x576.avi -nogui -type="MOG2"
Execution took 40.964450 seconds.
pi@pilab2:~/tmp/mnt/build_pi3 $ ./demo -file=/home/pi/tmp/mnt2/samples/data/768x576.avi -nogui -type="CNT"
Execution took 17.633301 seconds.
可见,它的用时还不到MOG2的二分之一。所以,当您的硬件系统不具备CUDA计算功能或者您的硬件系统性能比较低,而您又想耗时尽量小的话,选择它是不错的选择。
它的github地址:https://github.com/sagi-z/BackgroundSubtractorCNT
作者博客主页地址:https://www.theimpossiblecode.com/blog/fastest-background-subtraction-opencv/
具体的算法原理作者并没有告诉大家,下面是作者告诉大家的为什么它快的原因:
The basic reason is that it is very simple, and thoroughly optimized with Valgrind. Simple, because the algorithm was developed with simplicity in mind, trying to capture the essence of the background subtraction process as performed in human vision. The implementation of a simple algorithm is fast as is, but was further optimized by practical software development methods.
翻译如下:
基本原因是它非常简单,并且使用Valgrind进行了彻底优化。简单,因为算法的开发考虑到了简单性,试图捕捉在人类视觉中执行的背景减法过程的本质。简单算法的实现速度很快,但通过实际软件开发方法进行了进一步优化。
cv::bgsegm::BackgroundSubtractorGMG
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
cv::bgsegm::BackgroundSubtractorGSOC
cv::bgsegm::BackgroundSubtractorGSOC是OpenCV4里才有的,它的原理没有相关论文可以参考,OpenCV官网也没有相关原理的描述。
OpenCV官网对它只有一句话介绍,如下:
Implementation of the different yet better algorithm which is called GSOC, as it was implemented during GSOC and was not originated from any paper.
This algorithm demonstrates better performance on CDNET 2014 dataset compared to other algorithms in OpenCV.
翻译如下:
称为GSOC的不同但更好的算法的实现,因为它是在GSOC期间实现的,而不是源于任何论文。
与OpenCV中的其他算法相比,该算法在CDNET 2014数据集上的性能更好。
PS:GSOC是指谷歌编程之夏,Google Summer of Code ,简称GSoC,它是谷歌举行的一个全球性项目,旨在为学生们和开源、自由软件、技术相关的组织建立联系,让学生们贡献代码并获得报酬。组织会提供导师,在学生从熟悉社区到贡献代码的整个过程中提供指导。这个想法的目的是让学生们参与和熟悉开源社区,并帮助他们充分利用暑假时间去得到锻炼。
cv::bgsegm::BackgroundSubtractorLSBP
cv::bgsegm::BackgroundSubtractorLSBP使用使用局部奇异值分解二进制模式进行背景减法。相关原理的论文如下:
L. Guo, D. Xu, and Z. Qiang. Background subtraction using local svd binary pattern. In 2016 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 1159–1167, June 2016.
论文摘要如下:
Background subtraction is a basic problem for change detection in videos and also the first step of high-level computer vision applications. Most background subtraction methods rely on color and texture feature. However, due to illuminations changes in different scenes and affections of noise pixels, those methods often resulted in high false positives in a complex environment. To solve this problem, we propose an adaptive background subtraction model which uses a novel Local SVD Binary Pattern (named LSBP) feature instead of simply depending on color intensity. This feature can describe the potential structure of the local regions in a given image, thus, it can enhance the robustness to illumination variation, noise, and shadows. We use a sample consensus model which is well suited for our LSBP feature. Experimental results on CDnet 2012 dataset demonstrate that our background subtraction method using LSBP feature is more effective than many state-of-the-art methods.
翻译如下:
背景减除是视频变化检测的基本问题,也是高级计算机视觉应用的第一步。大多数背景减法都依赖于颜色和纹理特征。然而,由于不同场景的光照变化和噪声像素的影响,这些方法在复杂的环境中往往会导致较高的误报率。为了解决这个问题,我们提出了一种自适应背景减除模型,该模型使用了一种新的局部奇异值二值模式(LSBP)特征,而不是简单地依赖于颜色强度。该特征可以描述给定图像中局部区域的潜在结构,从而增强对光照变化、噪声和阴影的鲁棒性。我们使用了一个样本共识模型,该模型非常适合我们的LSBP特性。在CDnet 2012数据集上的实验结果表明,使用LSBP特征的背景减除方法比许多最先进的方法更有效。
重点提取:模型使用了一种新的局部奇异值二值模式(LSBP)特征,而不是简单地依赖于颜色强度。该特征可以描述给定图像中局部区域的潜在结构,从而增强对光照变化、噪声和阴影的鲁棒性。所以如果您要处理的视频流光照变化、噪声和阴影的影响比较大,可以选择它试一试。
cv::bgsegm::BackgroundSubtractorMOG
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
cv::cuda::BackgroundSubtractorFGD
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
cv::cuda::BackgroundSubtractorGMG
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
cv::cuda::BackgroundSubtractorMOG
见我昨天写的博文,链接 https://blog.csdn.net/wenhao_ir/article/details/124991529
总结一下,OpenCV4相较OpenCV3.0,增加了以下三个用于视频背景/前景分割(背景建模/前景提取)算法的类:
cv::bgsegm::BackgroundSubtractorCNT
cv::bgsegm::BackgroundSubtractorGSOC
cv::bgsegm::BackgroundSubtractorLSBP
同时去掉了下面这个类:
cv::cuda::BackgroundSubtractorMOG2
以上是关于OpenCV4中有哪些视频背景/前景分割(背景建模/前景提取)算法的类,它们各自的算法原理和特点是什么。的主要内容,如果未能解决你的问题,请参考以下文章
OpenCV的视频背景/前景分割(背景建模/前景提取)类cv::bgsegm::BackgroundSubtractorLSBP的使用示例代码及运行效果
OpenCV的视频背景/前景分割(背景建模/前景提取)类cv::bgsegm::BackgroundSubtractorGSOC的使用示例代码及运行效果
详解OpenCV的视频背景/前景分割(背景建模/前景提取)类cv::bgsegm::BackgroundSubtractorMOG
详解OpenCV的视频背景/前景分割(背景建模/前景提取)类cv::BackgroundSubtractorMOG2,并利用它实现对道路监控视频前景/背景的提取
详解OpenCV的视频背景/前景分割(背景建模/前景提取)类cv::BackgroundSubtractorKNN,并利用它实现对道路监控视频前景/背景的提取
详解OpenCV的视频背景/前景分割(背景建模/前景提取)类cv::bgsegm::BackgroundSubtractorGMG,并利用它实现对道路监控视频前景的提取