matlab代码如下:
%% 初始化foldname='C:\Users\admin\Desktop\16bit'; frameWidth=640; frameHeight=512; listfile=dir(fullfile(foldname,'*.raw')); frames=length(listfile); % 帧数image_sequence = zeros(frameHeight,frameWidth,frames); % 序列图像三维数组%% 读序列图像fori=1:framesfilename=listfile(i).name; filename=fullfile(foldname,filename); fid=fopen(filename,'r'); data_temp=fread(fid,[frameWidth,frameHeight],'uint16'); image_raw=data_temp'; image_sequence(:,:,i)=image_raw; fclose(fid); end%% 序列均值image_mean = mean(image_sequence,3); image_mean = uint16(image_mean);