Matlab calculates the maximum, minimum, average and variance of the thermal image sequence
1. Document and data introduction.
There are 55 thermal image data in mat format under the folder.
Each mat file contains a 200*300 juzhen variable.
2. Run the program and the results are as follows.
Maximum
value
Variance
mean
3. Source code.
Show some below 内联代码片
.
clc
clear all
%读取照片名
fid_file=fopen('E:\实用程序\热像\东北大学\k2-1-处理\k2-1-mat\k2-1-matname.txt');
%读图像文件名\
k=1;
filename=fgets(fid_file);
while ischar(filename)
filename=strtrim(filename);
temp_picture=importdata(filename);
%图像裁剪
picture=temp_picture;
%求图像的最大值、最小值、均值、方差 方差:各数据与均值之差的平方的平均数
max_value(k)=max(max(picture));
min_value(k)=min(min(picture));
mean_value(k)=mean(mean(picture));
% variance(k)=std2(picture); %求标准差
[M,N]=size(picture);
pic=reshape(picture,M*N,1);
variance(k)=var(pic,1);
k=k+1;
filename=fgets(fid_file);
end
max_value=max_value'
min_value=min_value'
mean_value=mean_value'
variance=variance'