資源簡(jiǎn)介
改進(jìn)的混合高斯背景模型,用于檢測(cè)運(yùn)動(dòng)目標(biāo),能夠有效的提取前景
代碼片段和文件信息
%?This?m-file?implements?the?mixture?of?Gaussians?algorithm?for?background
%?subtraction.??It?may?be?used?free?of?charge?for?any?purpose?(commercial
%?or?otherwise)?as?long?as?the?author?(Seth?Benton)?is?acknowledged.
clear?all
%?source?=?aviread(‘C:\Video\Source\traffic\san_fran_traffic_30sec_QVGA‘);
obj?=?VideoReader(‘畢設(shè)8.avi‘);
%?-----------------------??frame?size?variables?-----------------------
fr?=?read(obj1);???????????%?read?in?1st?frame?as?background?frame把第一幀作為背景幀
fr_bw?=?rgb2gray(fr);?????%?convert?background?to?greyscale把背景轉(zhuǎn)為灰度圖
fr_size?=?size(fr);??????????%背景幀的大小???
width?=?obj.Width;???????????%背景幀的寬度
height?=?obj.Height;??????????%背景幀的高度
fg?=?zeros(height?width);?????%定義一個(gè)與背景幀灰度圖像同等大小的矩陣,用于計(jì)算前景,儲(chǔ)存前景像素
bg_bw?=?zeros(height?width);???%定義一個(gè)與背景幀灰度圖像
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????7738??2016-04-14?12:16??sy5.m
-----------?---------??----------?-----??----
?????????????????7738????????????????????1
評(píng)論
共有 條評(píng)論