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
stbomei
- 粉丝: 44
- 资源: 1180
最新资源
- 搜广推推荐系统中传统推荐系统方法思维导图整理-完整版
- 微藻检测19-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 使用AS的自定义功能块与OS之间WINCC自定义功能块图标,自定义功能块面板教程 1.不是采用西门子APL面板实现 2.AS可以采用LAD或者SCL语言生成功能块 3.实现弹窗功能 4.事件可
- 等发达地区的无穷大无穷大无穷大请问
- Python实现常见排序算法详解
- JWaaaaaaaaaaaaaaaaaaaa
- Python复制重复数据工具.exe
- 2024圣诞节海外消费市场趋势及营销策略分析报告
- 基于Java的网上教务评教管理系统的设计与实现.doc
- EventHandlerError解决办法.md
- NotImplementedError.md
- SecurityException(解决方案).md
- IllegalAccessException(解决方案).md
- NameError.md
- NSRunLoopError如何解决.md
- OSError.md
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈