GOP.m
上传用户:cxsjwj
上传日期:2022-08-09
资源大小:34k
文件大小:2k
源码类别:

matlab例程

开发平台:

Matlab

  1.  function [B2,B3,P4,B5,B6,P7,B8,B9,I10]=GOP(i,resize,long,wide)
  2.         %reading P4 frame
  3.         framedata=aviread('news.avi',i+3);
  4.         P4=frame2im(framedata);
  5.         if resize==1
  6.            P4=imresize(P4,[long,wide]);
  7.         end
  8.         P4=rgb2gray(P4);
  9.          P4=double(P4);
  10.    
  11.         
  12.         %reading B2 frame
  13.         framedata=aviread('news.avi',i+1);
  14.         B2=frame2im(framedata);
  15.         if resize==1
  16.         B2=imresize(B2,[long,wide]);
  17.         end
  18.         B2=rgb2gray(B2);
  19.         B2=double(B2);
  20.         %reading B3 frame
  21.         framedata=aviread('news.avi',i+2);
  22.         B3=frame2im(framedata);
  23.        if resize==1
  24.    B3=imresize(B3,[long,wide]);
  25.     end
  26.         B3=rgb2gray(B3);      
  27.         B3=double(B3);
  28.         %reading B5 frame
  29.         framedata=aviread('news.avi',i+4);
  30.         B5=frame2im(framedata);
  31.         if resize==1
  32.    B5=imresize(B5,[long,wide]);
  33.     end
  34.         B5=rgb2gray(B5); 
  35.         B5=double(B5);
  36.         %reading B6 frame
  37.         framedata=aviread('news.avi',i+5);
  38.         B6=frame2im(framedata);
  39.          if resize==1
  40.    B6=imresize(B6,[long,wide]);
  41.     end
  42.         B6=rgb2gray(B6);        
  43.         B6=double(B6);
  44.         %reading B8 frame
  45.         framedata=aviread('news.avi',i+7);
  46.         B8=frame2im(framedata);
  47.         if resize==1
  48.    B8=imresize(B8,[long,wide]);
  49.     end
  50.         B8=rgb2gray(B8);     
  51.         B8=double(B8);
  52.         %reading B9 frame
  53.         framedata=aviread('news.avi',i+8);
  54.         B9=frame2im(framedata);
  55.         if resize==1
  56.    B9=imresize(B9,[long,wide]);
  57.     end
  58.         B9=rgb2gray(B9); 
  59.         B9=double(B9);
  60.         %reading I10 frame
  61.         framedata=aviread('news.avi',i+9);
  62.         I10=frame2im(framedata);
  63.          if resize==1
  64.   I10=imresize(I10,[long,wide]);
  65.     end
  66.         I10=rgb2gray(I10); 
  67.         I10=double(I10);
  68.         %reading P7 frame
  69.         framedata=aviread('news.avi',i+6);
  70.         P7=frame2im(framedata);
  71.         if resize==1
  72.    P7=imresize(P7,[long,wide]);
  73.     end
  74.         P7=rgb2gray(P7);       
  75.         P7=double(P7);