By Tingting, 12 September, 2025
Forums

一、安装MATLAB软件安装

二、使用MATLAB分析

参考:https://mp.weixin.qq.com/s/f57wZYcIEzNAoKWv-JBI2Q

% 清除工作区和关闭所有图形窗口
clear; close all;
%读取色卡图像
img = imread('D:\1、博士期间\9、博士-实验以及项目\12、根腐病GWAS\0、材料的照片-处理0天和处理50天\处理50天的材料照片\处理50天的FO的照片\B30203-FO-3.JPEG');
% 手动选择裁剪区域
cropped_img = imcrop(img);
% 显示裁剪色卡的区域,双击确定
figure;
%显示色卡区域
imshow(cropped_img);
%检测色卡图像
chart = colorChecker(cropped_img); 
%% 计算颜色矫正矩阵(CCM)
[colorTable,ccm] = measureColor(chart); % get color correction matrix(ccm)
%%读取原始测试图像

I = imread('D:\1、博士期间\9、博士-实验以及项目\12、根腐病GWAS\0、材料的照片-处理0天和处理50天\处理50天的材料照片\处理50天的FO的照片\B30203-FO-2.JPEG'); % read original image
%进行颜色矫正
I_cc = imapplymatrix(ccm(1:3,:)',I,ccm(4,:)); % color correction
%显示原始图像和矫正后的图像
figure(11);
subplot(1,2,1);imshow(I); title('Raw Image');
subplot(1,2,2);imshow(I_cc); title('Corrected Image');
%导出图像
imwrite(I_cc,'D:\1、博士期间\9、博士-实验以及项目\12、根腐病GWAS\0、材料的照片-处理0天和处理50天\色卡矫正后照片\B30203-FO-3.JPEG'); % save corrected image