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
阿里matlab建模师
- 粉丝: 4256
- 资源: 2843
最新资源
- 每周质量安全排查报告.docx
- 排水报装接入申请表.docx
- 评估报告公示公众意见表.doc
- 评审、登记备案情况表.docx
- 墙板隐蔽前监理检查记录.docx
- 抢救室、输液室周带教计划表.docx
- 人防工程主体结构验收前监理人员检查记录表.docx
- 人防工程竣工验收前监理人员检查记录.docx
- 人防门框及临战封堵框常规数据检查表.docx
- 人防门扇常规数据检查表.docx
- 社区工作者岗位表.docx
- 涉及消防的建筑材料、构配件和设备的进场试验报告汇总表.docx
- 涉及消防的各分部分项工程消防查验结果表.docx
- 十级伤残鉴定标准表.docx
- 市标化优良工地检查自评表(施工、监理企业用表).docx
- 输液结束(拔针)流程表.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
前往页