資源簡介
matlab下的動作能量圖程序,能有效獲取動作的特征表示。
代碼片段和文件信息
clc;
clear?all;
mov=aviread(‘G:\本科畢業(yè)設(shè)計資料\weizmann\jack\denis_jack.avi‘);
temp=size(mov);?
fnum=temp(2);
for?i=1:fnum
????strtemp=strcat(int2str(i)‘.‘‘JPG‘);
????imwrite(mov(i).cdata(:::)strtemp);
end%%??從視頻中提出每一幀圖像
o=1;
e=‘.jpg‘;
MEI=0;
for?i=1:fnum
????u=o-1;v=o-2;
????m=int2str(o);
????n=int2str(u);h=int2str(v);
????s=strcat(me);%%把字符串b與m連接后在連接e得到圖像文件存儲的位置
????m=imread(s);%%從S處把圖像讀取出來
????m=rgb2gray(m);%%將圖像M灰度化
???
????m=medfilt2(m[33]);
????if(o>=3)
????????????s=strcat(ne);
????????????n=imread(s);
????????????n=rgb2gray(n);
????????????s=strcat(he);
????????????h=imread(s);
????????????h=rgb2gray(h);
????????????n=medfilt2(n[33]);
????????????h=medfilt2(h[33]);
????????????q=im2double(m);%%將圖像數(shù)組轉(zhuǎn)換為double型
????????????w=im2double(n);?g=im2double(h);
????????????c=q-w;j=w-g;
????????????th=10/255;
????????????k=find(abs(c)>=th);
????????????c(k)=1;
????????????k=find(abs(c) ????????????c(k)=0;??
????????????c=bwareaopen(c15);
????????????se90=strel?(‘line‘390);se0=strel?(‘line‘30);
????????????se=strel(‘square‘3);
????????????c=bwmorph(c‘close‘);?%對上述圖像進行形態(tài)學(xué)閉運算?
????????????c=imdilate(c[se90se0]);
????????????c=bwmorph(c‘close‘);
????????????c=bwareaopen(c50);
????????????k=find(abs(j)>=th);
????????????j(k)=1;
????????????k=find(abs(j) ????????????j(k)=0;
????????????j=bwareaopen(j15);?
- 上一篇:LMS matlab
- 下一篇:ID3算法matlab
評論
共有 條評論