資源簡介
一種改進的VIBE運動目標檢測算法,屬于背景差分法,能對不同環境的目標進行檢測,能消除鬼影。
代碼片段和文件信息
clearclc;
%?[filenamepathname]?=?uigetfile(‘*.avi‘‘choose?the?video?name:‘);%選擇視頻
video?=?mmReader(‘34.avi‘);
height?=?video.Height;
width?=?video.Width;
tom?=?zeros(heightwidth);
%參數
Numframes?=?video.NumberOfframes;
cardinality?=?2;%基數
r?=?20;%給定半徑
n?=?20;
%
%初始化?%%%取前20幀作為模型初始化
sample?=?zeros(heightwidthn);
for??nn?=?1?:?40
????imrgb?=?read(videonn);
????imgray?=?rgb2gray(imrgb);
????video_dis?=?imgray;
????if(rem(nn2)==0)
????sample(::nn/2)?=?imgray;??
????end
end
bg?=?padarray(sample[1?1]‘replicate‘);
%隨機跟新
%?sd?=?zeros(heightwidth);
%?r?=?zeros(heightwidth);
for?f?=?41?:?Numframes
????imageRGB?=?read(videof);
????imageRGB1?=?read(videof-1);
????imageRGB2?=?read(videof-2);
????imageRGB3?=?read(videof-3);
????imageRGB4?=?read(video
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5530??2016-11-22?16:23??vibe_tom.m
-----------?---------??----------?-----??----
?????????????????5530????????????????????1
- 上一篇:自適應的永磁同步電機無位置傳感器控制系統
- 下一篇:五自由度機械臂阻抗控制下的力跟蹤
評論
共有 條評論