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

matlab例程

开发平台:

Matlab

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