资源简介
包括常用的前景提取算法,有GMM,VIBE,帧差法等,方便实用
代码片段和文件信息
/*=================================================================
* Calculate Background Model of a list of frames(Normally a video stream) in the
* method of Background Difference Method & OTSU Algorithm By OpenCV.
*
* Copyright (C) 2017 Chandler Geng. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not write to the Free Software Foundation Inc. 59
* Temple Place Suite 330 Boston MA 02111-1307 USA
===================================================================
*/
#include “BGDifference.h“
/*===================================================================
* 函数名:BackgroundDiff
* 说明:背景差分算法;
* 参数:
* Mat src: 源图像
* Mat& imgForeground: 前景图像
* Mat& imgBackground: 背景图像
* int nFrmNum: 当前帧数
* int threshold_method: 阈值方法
* - CV_THRESH_OTSU: 使用OpenCV自带OTUS方法
* - CV_THRESH_BINARY: 使用该类中的OTSU方法
* double updateSpeed: 背景更新速度
* 返回值:void
*------------------------------------------------------------------
* Function: BackgroundDiff
*
* Summary:
* Background Difference Algorithm;
*
* Arguments:
* Mat src - source image
* Mat& imgForeground - Foreground Image
* Mat& imgBackground - Background Image
* int nFrmNum - Current frame Number
* int threshold_method - the method of getting Threshold Value
* - CV_THRESH_OTSU: Using OpenCV‘s OTSU method
* - CV_THRESH_BINARY: Using this class‘s OTSU method
* double updateSpeed - the Speed of Background Update
*
* Returns:
* void
=====================================================================
*/
void BGDiff::BackgroundDiff(Mat src Mat &imgForeground Mat& imgBackground int nFrmNum int threshold_method double updateSpeed)
{
// 源图像的灰度图像
// Gray Image(uchar) of Source Image
Mat src_gray;
// 单通道浮点图像,用于背景建模
// Gray Image(float) of Source Image and will be used to model background
Mat src_grayf;
// 前景、背景的浮点图像
// Gray Image(float) of Foreground & Background Images
Mat imgForegroundf imgBackgroundf;
// 前景图像缓存
// temp Image of ForeGround Image
Mat imgForeground_temp;
// 初始化浮点图像
// Init float Images
imgBackgroundf.create(src.size() CV_32FC1);
imgForegroundf.create(src.size() CV_32FC1);
src_grayf.create(src.size() CV_32FC1);
// 视频流第一帧,前景与背景都初始化为第一帧的灰度图
// if it is in the first frame of Video stream Foreground & Background Image will be inited as Gray I
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\
文件 1568 2017-12-27 12:21 BackgroundSplit-OpenCV-master\CMakeLists.txt
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Image\
文件 291642 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Image\fr
文件 508651 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Image\GaussBG_Difference.png
文件 181950 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Image\ViBe+.jpg
文件 336626 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Image\ViBe.png
文件 3744 2017-12-27 12:21 BackgroundSplit-OpenCV-master\README - 中文.md
文件 4179 2017-12-27 12:21 BackgroundSplit-OpenCV-master\README.md
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Video\
文件 10960524 2017-12-27 12:21 BackgroundSplit-OpenCV-master\Video\Camera Road 01.avi
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\BGDifference\
文件 11592 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\BGDifference\BGDifference.cpp
文件 1709 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\BGDifference\BGDifference.h
文件 3182 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\BGDifference\main.cpp
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\fr
文件 3288 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\fr
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe+\
文件 38449 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe+\ViBePlus.cpp
文件 5568 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe+\ViBePlus.h
文件 856 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe+\ViBePlusMacro.h
文件 2685 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe+\main.cpp
目录 0 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe\
文件 14498 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe\Vibe.cpp
文件 3141 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe\Vibe.h
文件 2786 2017-12-27 12:21 BackgroundSplit-OpenCV-master\src\ViBe\main.cpp
- 上一篇:泛函分析教程第二版童裕孙
- 下一篇:计算机网络 思维导图笔记.xmind
相关资源
- 基于OpenCV的车牌识别系统
- 贪心算法,opencv,主动轮廓模型,s
- Computer Vision with OpenCV 3 and Qt5 pdf + co
- opencv SVM训练检测车牌
- OpenCV_1.0.exe
- 车牌识别-opencv
- AdaBoost人脸检测程序
- 挥拳动作OpenCV识别
- SIFT算法实现及代码详解239444
- 基于opencv与opengl实现增强现实
- 利用opencv实现疲劳检测
- QT+Opencv2+VS2012 使用多线程显示网络摄
- opencv3.4.1 编译库,可在Qt直接使用
- opencv3.4+contrib vs2017 debug x64 编译好的库
- VS+OPENCV+ZBAR一维,二维码识别[包含中
- 基于OpenCV的车牌识别
- OpenCV_world330.lib
- win32平台的opencv3.4.2
- OpenCV2.1安装包
- 深入理解OpenCV:实用计算机视觉项目
- 学习OpenCV(中文版)pdf文档+源码
- 学习opencv 中文版及源码
- opencv-3.3.1 for vs2013
- OpenCV3.2编译文件
- QtOpencvImageGUI
- OpenCV实现多目三维重建
- opencv2.4.13lib_x86_x64_vs2013
- 形状匹配find_scaled_shape_model
- OpenCV 3.3_x86_minGW_world
- Opencv-stitcher基本原理参考文献
评论
共有 条评论