亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? avi2movie.m

?? 在Matlab環(huán)境下顯示運動圖像
?? M
字號:
function [output] = Avi2Movie(filename,option,option2,option3)
%--------------------------------------------------------------------
% result = Avi2Movie (filename, 
%                     number of frames to process, 
%                     first frame to use, 
%                     last frame to use)
%
% Result = read Frames as MatLab MOVIE-format:
%
% Example: Avi2Mivie('sample.avi',30,10,12)
%            reads and processes the first 30 frames of the file 
%            'sample.avi', and store frame 10, 11 and 12 as 
%            one MatLab Movie-Dataset.       
%
% NOTE: supports only uncompressed plain avi(RIFF) files 
%       (8, 16, 24, 32 Bit per Pixel)
%
% (c) by Rainer Rawer (using Matlab 5.3)
% http://www.rawer.de/rainer/software/
% rrawer@gmx.de
% 22/12/2000 %--------------------------------------------------------------------


% default declarations:
JUNK         = [74 85 78 75];				% <JUNK>
RIFF			 = [82 73 70 70]; 			% <RIFF>
AVI          = [65 86 73 32];				% <AVI >
MOVI         = [109 111 118 105];		% <movi>
ValidFrameID = [48 48 100 98];			% <00db>
AVIH         = [97 118 105 104];			% <avih>
STRF         = [115 116 114 102];		% <strf>
version      = '1.0';
lines        = 240;  % default lines per frame
columns      = 320;  % default colons per frame
bytes        = 1;    % default bytes per pixel
no_of_frames = 1;    % no of frames to read
contador=0;
%-------------------------------------------------------------------------


%-------------------------------------------------------------------------
% checking if files is existing and a valid RIFF/AVI file
%-------------------------------------------------------------------------

  if nargin == 0; 
     disp(['-------------------------------']);  
     disp([' Avi2Movie V',version, '  by R.Rawer `99-`01'])
     disp(['-------------------------------']);
     disp([' usage: Avi2Movie(filename,'])
     disp(['                  number of frames to process,'])
     disp(['                  first frame to use,'])
     disp(['                  last frame to use)']) 
     error(['### no parameters']); 
  end
  if nargin < 4; option3=option2 ; end
  if nargin < 3; option2 = 0, option3= 0 ; end
  if nargin < 2; option = 0; option2 = 0, option3= 0 ; end
  
  
    fid = fopen(filename, 'r');  if fid < 3; error(['### Avi2Movie: ', filename, ' NOT found.']); end
    xx = uint8(fread(fid, 5000, 'uint8'));    if max(xx(1:4)'==RIFF==0);										%check for: 'RIFF'
     error(['### Avi2Movie: ', filename, ...           ' is not a valid RIFF file.']); 
  elseif max(xx(9:12)'==AVI==0);									%check for: 'AVI '
          error(['### Avi2Movie: ', filename, ...                ' is not a valid AVI file.']); 
  end          fclose(fid);  
  
%-------------------------------------------------------------------------
% Extracting AVI header information
%-------------------------------------------------------------------------

h=1;i=0;h2=0;e=1;
while e==1;
   h=h+1;
   if min(xx(h:(h+3))'== AVIH); 									%check for ID: 'avih'
      h2=h;
      e=0;
   end 		 
end
time_per_frame = double(xx(h2+8))+double(xx(h2+9))*256+double(xx(h2+10))*256*256+double(xx(h2+11))*256*256*256;
no_of_frames   = double(xx(h2+24))+double(xx(h2+25))*256+double(xx(h2+26))*256*256+double(xx(h2+27))*256*256*256;
columns        = double(xx(h2+40))+double(xx(h2+41))*256+double(xx(h2+42))*256*256+double(xx(h2+43))*256*256*256;
lines          = double(xx(h2+44))+double(xx(h2+45))*256+double(xx(h2+46))*256*256+double(xx(h2+47))*256*256*256;

i=0;h3=0;e=1;
while e==1;
   h=h+1;
   if min(xx(h:(h+3))'==STRF); 									%check for ID: 'strf'
      h3=h;
      e=0;
   end 		 
end
color_depth=double(xx(h3+22))+double(xx(h3+23))*256;
switch color_depth
   case 8
      bytes=1;
   case 16
      bytes=2;
   case 24 
      bytes=3;
   otherwise bytes=4;
end

e=1;
while e==1;
   h=h+1;
   if min(xx(h:(h+3))'==MOVI); 									%check for ID: 'movi'
      e=0; 
      h1=h; 
   end 		
end
frame_length=double(xx(h1+8))+double(xx(h1+9))*256+double(xx(h1+10))*256*256+double(xx(h1+11))*256*256*256;
frame_ID=xx(h1+4:h1+7);

% re-open file to check foer actual framelength:
fid = fopen(filename, 'r');if fid < 3; error(['### Avi2Movie: ', filename, ' NOT found.']); end
% seek to place where 2nd frame should be:
fseek(fid,h1+4+frame_length,-1);
xx = uint8(fread(fid, 5000, 'uint8'));  h=0;i=0;h5=0;e=1;
while e==1;
   h=h+1;
   if min(xx(h:(h+3))'==frame_ID'); 							%check for ID: frame_ID
      h5=h;
      e=0;
   end 		 
end
frame_offset=h5;

% check for compressed AVIs:
if ((lines*columns)~=(frame_length/bytes));
   error('### no compressed AVI supported !');
end;   


% check if fra,mes to read exeeds number of frames in file:
if (option > no_of_frames)
   option = no_of_frames;
   disp(sprintf('Warning: No of frames to read adjusted to %d!',option));   
end;

   
%display header information:
frame_ID=double(frame_ID);
disp('---------------------------------------------------------');
disp(['Avi2Movie V',version,' by R.Rawer `99']);
disp(sprintf('   filename                 : "%s"',filename));
disp(sprintf('   number of frames to read : %d',option));
disp(sprintf('   display frame            : #%d to #%d',option2,option3));
disp('---------------------------------------------------------');
disp(sprintf('   number of data blocks : %d',no_of_frames));
disp(sprintf('   frames per second     : %5.2f',1000000*1/time_per_frame));
disp(sprintf('   frame size            : %d x %d',columns,lines));
disp(sprintf('   colour depth          : %d (%dbyte)',color_depth,bytes));
disp(sprintf('   frame length          : %d (0x%x)',frame_length,frame_length));
disp(sprintf('   frame ID              : %c%c%c%c',frame_ID(1),frame_ID(2),frame_ID(3),frame_ID(4)));
disp(sprintf('   frame offset          : %d',frame_offset));
disp('---------------------------------------------------------');



%-------------------------------------------------------------------------
% start reading single frames
%-------------------------------------------------------------------------

% re-open file for actual reading of data:
fid = fopen(filename, 'r');if fid < 3; error(['### Avi2Movie: ', filename, ' NOT found.']); end
fseek(fid,h1+3,-1);

% read frames
frames=0;
if option>0; no_of_frames=option;end
while (i<no_of_frames);
   frames=frames+1;
   i=i+1;
   %disp(sprintf('processing frame %d of %d ',i,no_of_frames));
   
   frame_header = uint8(fread(fid, 8, 'uint8')');
   f_length=double(frame_header(5))+double(frame_header(6))*256+double(frame_header(7))*256*256+double(frame_header(8))*256*256*256;
   
   % seek for next valid pixture dataset:
   e=0;
   while e==0;
      if (frame_header(1:4)==JUNK );
         %found a JUNK frame and skipping it...
         %disp('reading JUNK frame...');
         xx=uint8(fread(fid, f_length, 'uint8')');
         frame_header = uint8(fread(fid, 8, 'uint8')');
         f_length=double(frame_header(5))+double(frame_header(6))*256+double(frame_header(7))*256*256+double(frame_header(8))*256*256*256;
      elseif f_length==0;
         %found empty frame and skipping it...
         %disp('reading empty frame...');
         frame_header = uint8(fread(fid, 8, 'uint8')');
         i=i+1;
         f_length=double(frame_header(5))+double(frame_header(6))*256+double(frame_header(7))*256*256+double(frame_header(8))*256*256*256;
      elseif (frame_header(1:4)== frame_ID')
         %found valid frame....
         %disp('found valid movi-frame...');
         e=1;
      else   
         %found non-movi media frame
         %disp('skipping non-movi frame...');
         %disp('flength');f_length
         xx=uint8(fread(fid, f_length, 'uint8')');
         frame_header = uint8(fread(fid, 8, 'uint8')');
         f_length=double(frame_header(5))+double(frame_header(6))*256+double(frame_header(7))*256*256+double(frame_header(8))*256*256*256;      
      end   
   end
   
   %==================================================================
   % (*1*)																				=
   % 																						=   
   % Reading Image Data (depening on number of bytes per pixel)      =
   % and rearrange it to image-matrix							            =
   %==================================================================
   switch bytes
      case 1
         % read 8bit per Pixel (greyscale) Data:
         xx = uint8(fread(fid, frame_length/bytes, 'uint8'));   
		   % reshape data as 2-dimentional image array:
  	      im = reshape(xx(1,:),columns,lines);
      case 2
         % read 16bit per Pixel Data:
         xx = uint16(fread(fid, frame_length/bytes, 'uint16'));
		   % reshape data as 2-dimentional image array:
         im = reshape(xx(1,:),columns,lines);
      case 3   
         % read 24bit per Pixel (truecolor) Data:
         xx = uint8(fread(fid, frame_length, 'uint8'));
         xx = reshape(xx,3,frame_length/3)';
         contador=contador+1;
         % reshape data as 3-dimentional truecolor image array
         % ([rows,lines,3], three color planes RGB):
         im(:,:,3) = rot90(reshape(xx(:,1),columns,lines));
         im(:,:,2) = rot90(reshape(xx(:,2),columns,lines));
         im(:,:,1) = rot90(reshape(xx(:,3),columns,lines));
         im2(:,:,contador)=im(:,:,1);
         
      otherwise  
         % read 32bit per Pixel Data:
         xx = uint32(fread(fid, frame_length/bytes, 'uint32'));
			% reshape data as 2-dimentional image array:
         im = double(reshape(xx,columns,lines));
      end           
      

  %=================================================================
  % (*2*)																			 =
  % 																					 =   
  % processing data of each frame starts here                      =
  % if you don't want to display any of the frames simply          =
  % delete the folowing lines...  (cut to cut)                     =
  %=================================================================
  
  %---cut---
  % display image data if needed:
  if option2>0;
     if ((i>=option2)&(i<=option3));
        figure('name',sprintf('Frame #%d',i));
        switch bytes
           case 1
              imshow(im');colormap(gray);  
           case 2
              imshow(im');colormap(gray); 
           case 3
              image(im);
           otherwise
              imshow(im);
        end 
     end   
  end
  
   
  %---cut---
  
  
    
  
  % My code comes here..
  
  
  

  %-----------------------------------------------------------------
  % Use the following varibles: 
  %
  % no_of_frames:   number of frames to be read
  % time_per_frame: time to display each frame [ms] (reverse of Frames 
  %					  per 0.001 second)
  % frames:			  number of this frame
  % columns:		  number of pixels per line
  % lines:			  number of lines per image
  % bytes:			  number of bytes per pixel
  % im:				  image data: 
  %					    8bit/pixel:  uint8-Matrix[columns,lines]
  %					    16bit/pixel: uint16-Matrix[columns,lines]
  %					    24bit/pixel: uint8-Matrix[columns,lines,3] 
  %					 	  			     (3 Color Planes R,G,B)
  %					    32bit/pixel: uint32-Matrix[columns,lines]
  % xx:				  raw image data:
  %					    8bit/pixel:  uint8-Matrix[columns*lines] 
  %										  (1-dimentional)
  %					    16bit/pixel: uint16-Matrix[columns*lines]
  %									 	  (1-dimentional)
  %					    24bit/pixel: uint8-Matrix[3,columns*lines] 
  %										  (1-dimentional, 3 Color Planes R,G,B)
  %					    32bit/pixel: uint32-Matrix[columns*lines]					  
  %										  (1-dimentional)
  %
  % Note: if you prefer another byte-arangement in order to speed up
  %		 your image processing refere to section (*1*) and modify 
  %	    the reshape commands in order to speed up the rearanging 
  %		 process
  %
  %-----------------------------------------------------------------
  
  
  %---------
  % store image in MatLab Movie-Format
  
  mov(i)=im2frame(im);
  
end  % end reading single frames -----------------------------------





% output read statistics:
disp('---------------------------------------------------------');
disp(sprintf('Read %d Blocks, %d valid Frames',i,frames));
disp('---------------------------------------------------------');
% plot results of maximum positions

output=mov;
movie(mov);

disp (['script done !']);
disp(' ');


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品av| 成熟亚洲日本毛茸茸凸凹| 精品精品欲导航| 色综合天天综合| 黄网站免费久久| 亚洲成a人片在线不卡一二三区| 欧美精品一区二区久久久| 91黄色免费网站| 成人晚上爱看视频| 久久精品99久久久| 五月天丁香久久| 综合久久久久久| 久久蜜桃av一区精品变态类天堂| 欧美剧情电影在线观看完整版免费励志电影 | 欧美成人精品二区三区99精品| 色综合色狠狠综合色| 丁香五精品蜜臀久久久久99网站| 免费在线观看不卡| 亚洲国产精品一区二区www在线| 欧美国产禁国产网站cc| 精品日本一线二线三线不卡| 欧美日韩五月天| 色婷婷一区二区| av不卡免费在线观看| 国产一区二区三区观看| 久久av中文字幕片| 美女视频第一区二区三区免费观看网站| 亚洲人成网站精品片在线观看 | 日韩一区二区三区电影在线观看| 色视频成人在线观看免| 精品国产髙清在线看国产毛片| 欧美另类久久久品| 欧美日韩综合在线| 欧美三区在线观看| 欧美亚洲愉拍一区二区| 欧洲人成人精品| 91高清视频免费看| 欧亚一区二区三区| 欧美色图一区二区三区| 91黄色激情网站| 在线观看视频一区二区欧美日韩| 99久久er热在这里只有精品66| 成人aa视频在线观看| 波波电影院一区二区三区| 国产aⅴ精品一区二区三区色成熟| 国模冰冰炮一区二区| 国产真实乱对白精彩久久| 国产一区亚洲一区| 国产精品一区二区果冻传媒| 国产成人免费xxxxxxxx| 国产999精品久久| 99在线精品一区二区三区| 成人免费视频网站在线观看| aaa国产一区| 欧美影院精品一区| 欧美日韩一区高清| 欧美成人欧美edvon| 久久久久久一级片| 最近日韩中文字幕| 亚洲一区二区五区| 免费高清成人在线| 国产成人日日夜夜| 色综合久久久久久久久久久| 欧美日韩精品是欧美日韩精品| 日韩亚洲欧美高清| 久久精品这里都是精品| 91.xcao| 欧美成人精品1314www| 麻豆免费看一区二区三区| 国产麻豆9l精品三级站| 99热精品一区二区| 欧美日韩大陆一区二区| 精品福利在线导航| 亚洲欧洲三级电影| 日韩精品电影在线观看| 国产九色sp调教91| 欧美在线free| 欧美精品一区二区久久婷婷| 亚洲欧美日韩一区二区 | 欧美三日本三级三级在线播放| 91精品国产综合久久香蕉麻豆| 久久这里只精品最新地址| 中文字幕五月欧美| 天天综合色天天综合色h| 高清在线成人网| 欧美日韩一区不卡| 国产欧美日韩久久| 婷婷综合久久一区二区三区| 国产精品亚洲第一| 欧美日本免费一区二区三区| 国产日韩欧美不卡在线| 91浏览器入口在线观看| 精品乱人伦小说| 亚洲品质自拍视频| 国产一区二区三区av电影| 欧美性xxxxx极品少妇| 久久精品亚洲精品国产欧美 | 久久久精品免费免费| 亚洲午夜激情av| 成人激情电影免费在线观看| 欧美一区二区福利视频| 亚洲日本在线天堂| 国产成人亚洲综合色影视 | 中文欧美字幕免费| 蜜臀av性久久久久蜜臀aⅴ四虎| 色综合久久久久综合体| 国产午夜精品美女毛片视频| 天天综合网 天天综合色| 色婷婷av一区二区三区之一色屋| 久久精品欧美一区二区三区不卡| 日本视频一区二区| 欧美探花视频资源| 亚洲免费在线视频| 岛国精品一区二区| 久久成人av少妇免费| 色婷婷av一区二区三区大白胸| 欧美激情一区二区三区四区| 精品在线免费观看| 日韩午夜电影av| 日韩av一区二区在线影视| 欧美中文字幕不卡| 一区二区三区成人| 91蜜桃婷婷狠狠久久综合9色| 国产精品视频一二三| 风间由美一区二区三区在线观看| 欧美精品一区二区三| 极品少妇xxxx精品少妇偷拍| 欧美一区二区成人| 青椒成人免费视频| 欧美一级理论片| 性欧美大战久久久久久久久| 波多野结衣中文字幕一区二区三区| 国产亚洲一本大道中文在线| 蜜桃视频一区二区三区在线观看| 欧美午夜精品一区| 午夜精品福利一区二区蜜股av| 色屁屁一区二区| 亚洲精品欧美综合四区| 99久久免费视频.com| 久久五月婷婷丁香社区| 狠狠色2019综合网| 久久青草国产手机看片福利盒子 | 91首页免费视频| 精品国产乱码久久久久久图片| 国产真实乱子伦精品视频| 日韩欧美一区二区视频| 麻豆视频观看网址久久| 欧美岛国在线观看| 国产成人午夜精品影院观看视频| 久久综合色鬼综合色| 国产精品中文有码| 免费看日韩精品| 精品国产成人系列| 成人免费毛片aaaaa**| 国产精品你懂的| 欧美色图在线观看| 日韩国产欧美三级| 国产亚洲精品aa午夜观看| 国产成人精品www牛牛影视| 中文字幕乱码久久午夜不卡| 成人免费三级在线| 亚洲高清免费一级二级三级| 欧美电影一区二区三区| 美女在线视频一区| 久久美女高清视频| 色哦色哦哦色天天综合| 亚洲一区二区三区四区五区黄 | 91精品欧美久久久久久动漫| 免费人成精品欧美精品| 337p粉嫩大胆噜噜噜噜噜91av | 2020国产精品久久精品美国| 国产一区亚洲一区| 亚洲黄色免费电影| 欧美日韩一区二区三区四区五区| 日韩国产精品久久久久久亚洲| 欧美一级午夜免费电影| 国产成人在线色| 午夜精品免费在线观看| 精品乱码亚洲一区二区不卡| 成人黄色电影在线| **欧美大码日韩| 4438x亚洲最大成人网| 风间由美性色一区二区三区| 夜夜嗨av一区二区三区中文字幕| 91精品国产欧美一区二区18 | 欧美亚洲综合网| 久久电影国产免费久久电影| 国产在线视视频有精品| 最新成人av在线| 337p亚洲精品色噜噜| 激情偷乱视频一区二区三区| 亚洲一区影音先锋| 久久先锋影音av鲁色资源网| 91女人视频在线观看| 日本sm残虐另类| 亚洲精选一二三| 精品国产百合女同互慰| 日本精品裸体写真集在线观看 | 综合色中文字幕| 91精品国产91久久久久久最新毛片|