clear; clc; close all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Brilliantdo
% Last modified time : 2016/12/1
% Blog: http://blog.csdn.net/brilliantdo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Parameters
param.numberOfSamples = 10;
param.matchingThreshold = 10;
param.matchingNumber = 2;
param.updateFactor = 5;
param.numberOfHistoryImages = 2;
param.lastHistoryImageSwapped = 0;
%% Video Information
filename = 'peopleDou.avi';
vidObj = VideoReader(filename);
numFrames = vidObj.NumberOfFrames; %视频总的帧数
firstFrame = true;
height = vidObj.Height;
width = vidObj.Width;
param.height = height;
param.width = width;
%% ViBe Moving Object Detection
for k=1:numFrames
vidFrame = read(vidObj,k);
% figure(1), imshow(vidFrame), title('Original Image');
vidFrame = rgb2gray(vidFrame);
vidFrame = double(vidFrame);
tic;
if firstFrame
firstFrame = false;
initViBe;
end
segmentationMap = vibeSegmentation(vidFrame, historyImages, historyBuffer, param);
[historyImages, historyBuffer] = vibeUpdate(vidFrame, segmentationMap, historyImages, historyBuffer, param, ...
jump, neighborX, neighborY, position);
segmentationMap = medfilt2(segmentationMap);
toc;
figure(2), imshow(segmentationMap), title('Segmentation');
end
![avatar](https://profile-avatar.csdnimg.cn/2588731bac124b388c4a87fce0b1493c_m0_53407570.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
阿里matlab建模师
- 粉丝: 4937
- 资源: 2898
最新资源
- 单相Boost PFC双闭环控制仿真模型:高精度功率因数与详细数据测量注释,单相Boost PFC双闭环控制仿真模型:高功率因数0.9995下的电压外环PI与电感电流滞环控制,详细数据测量及模块注释
- 基于Vue框架的消防一体化系统设计源码
- 衢州市乡镇边界,shp格式
- hotgo-移动应用开发资源
- unisrc-单片机开发资源
- 固态继电器电路.zip
- 光控照明灯自动开关.zip
- 光控式道路施工闪烁警示灯控制电路.zip
- 光电传感器与应用电路.zip
- 安川伺服电机与S7-200SMART PLC及MCGS7.7触摸屏联机程序例程:含CAD图纸、参数详解及运行效果视频说明书,安川伺服电机与西门子S7-200SMART PLC及MCGS7.7触摸屏联机
- 红外测量控器的发射与接收.zip
- 红外探测自动开关.zip
- 红外线集成器件sNS9201在延时开关中的应用.zip
- 霍尔传感器与应用电路.zip
- 继电器电路.zip
- 家用彩色幻灯电路.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
- 1
- 2
- 3
前往页