1.验证两组数据间的相关性:Spearman相关系数(Spearman Rank-order Correlation Coefficient,SROCC),Pearson相关系数(Pearson Linear Correlation Coefficient, PLCC),Kendall相关系数(Kendall Rank-order Correlation Coefficient, KRCC),平均绝对值误差(Mean Absolute Error, MAE)和均方根误差(Root Mean Squared Error, RMSE)。
matlab代码:
X=xlsread('new.xlsx','A1:A72'); %读数据
Y1=xlsread('new.xlsx','C1:C72');
%选取72组数据,
krocc1 = corr(X , Y1 , 'type' , 'Kendall');
srocc1 = corr(X , Y1 , 'type' , 'Spearman');
plcc1 = corr(X , Y1 , 'type' , 'Pearson');
Rmse=sqrt(sum((X-Y1).^2)/72);
Mae=sum(abs(X-Y1))/72;
2.函数拟合
x1=xlsread('result.xlsx','H2:H104');
x2=xlsread('result.xlsx','C2:C104');
x3=xlsread('result.xlsx','D2:D104');
x4=xlsread('result.xlsx','E2:E104');
y=xlsread('result.xlsx','A2:A104');
p = [x1,x2,x3,x4]\y; %得到对应系数矩阵
%xlswrite('D:\experiment\result.xlsx',p,'sheet1','M');%写入excel中
3.批量处理图像
%批量操作
file_path = '.\img_r\'; % 图像文件夹路径
img_path_list = dir(strcat(file_path,'*.jpg'));%获取该文件夹中所有jpg格式的图像
img_num = length(img_path_list); %获取图像总数量
%rb=[7 23 39 55 71 87 103 119 135 151 167 183 199 215 231 247];
if img_num > 0 %有满足条件的图像
for j = 1:img_num %逐一读取图像
image_name = img_path_list(j).name; % 图像名
image = imread(strcat(file_path,image_name));
%for m=1:1080 %行
% for n=1:1920 %列
% r = image(m,n,1);
% g = image(m,n,2);
% b = image(m,n,3);
% 操作
%
saveddir = 'D:\imageprocess\lianghua\'; % 图像新保存到的路径
str=[image_name,'.png'];
savedname = fullfile(saveddir,str); % 图像名称不变
imwrite(image,savedname); % 保存图像
end
end
4.阈值分割(OpenCV)
#include <opencv2/core/cor