• 大小: 3KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-06-16
  • 语言: Matlab
  • 标签: matlab  

资源简介

matlab下的动作能量图程序,能有效获取动作的特征表示。

资源截图

代码片段和文件信息

clc;
clear all;
mov=aviread(‘G:\本科毕业设计资料\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);%%将图像数组转换为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‘); %对上述图像进行形态学闭运算 
            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); 

评论

共有 条评论