Contents
clear all; close all;
load T_cones_sp;
wls = SToWls(S_cones_sp);
buf = csvread('sp.csv');
wls_sp = buf(:,1)';
CVRL_sp = 10.^buf(:,2:4);
CVRL_sp = CVRL_sp ./ repmat(max(CVRL_sp), size(CVRL_sp,1), 1);
buf = csvread('dpse.csv');
wls_dpse = buf(:,1)';
CVRL_dpse = 10.^buf(:,2:4);
CVRL_dpse = CVRL_dpse ./ repmat(max(CVRL_dpse), size(CVRL_dpse,1), 1);
CVRL_sp = CVRL_sp';
CVRL_dpse = CVRL_dpse';
PTBのT_cones_spの確認:Judd-Vos修正等色関数から計算して、一致度を確認する。
load T_xyzJuddVos
m = [0.15516, 0.54308, -0.03287; ...
-0.15516, 0.45692, 0.03287; ...
0, 0, 0.00801];
LMS = m * T_xyzJuddVos;
LMS = LMS ./ repmat(max(LMS,[],2), 1, size(LMS,2));
wls_LMS = SToWls(S_xyzJuddVos);
計算結果とPTB SP fundamentalsの比較
figure(1);
plot(wls_LMS, LMS','k-'); hold on;
plot(wls, T_cones_sp(1,:)','rx');
plot(wls, T_cones_sp(2,:)','gx');
plot(wls, T_cones_sp(3,:)','bx');
xlim([350 750]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('PTB SP fundamentals', 'FontSize',14);
計算結果とCVRL SP fundamentalsの比較
figure(2);
plot(wls_LMS, LMS','k-'); hold on;
plot(wls_sp, CVRL_sp(1,:)','rx');
plot(wls_sp, CVRL_sp(2,:)','gx');
plot(wls_sp, CVRL_sp(3,:)','bx');
xlim([350 750]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('CVRL SP fundamentals', 'FontSize',14);
計算結果とCVRL DPSE fundamentalsの比較
figure(3);
plot(wls_LMS, LMS','k-'); hold on;
plot(wls_dpse, CVRL_dpse(1,:)','rx');
plot(wls_dpse, CVRL_dpse(2,:)','gx');
plot(wls_dpse, CVRL_dpse(3,:)','bx');
xlim([350 750]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('CVRL DPSE fundamentals', 'FontSize',14);
計算結果と他のデータの差を計算してみる
計算結果とCVRL SP fundamentals
diff_CVRL_sp = sum(sum(abs(LMS - CVRL_sp(:,1:81))));
fprintf('Judd-Vosに基づく計算結果とCVRL SP fundamentalsの差 = %f\n', diff_CVRL_sp);
Judd-Vosに基づく計算結果とCVRL SP fundamentalsの差 = 0.001593
計算結果とPTB SP fundamentals
diff_T_cones_sp = sum(sum(abs(LMS - T_cones_sp)));
fprintf('Judd-Vosに基づく計算結果とPTB SP fundamentalsの差 = %f\n', diff_T_cones_sp);
Judd-Vosに基づく計算結果とPTB SP fundamentalsの差 = 0.194557
計算したL, M錐体分光感度の和と、Judd-Vos修正分光視感効率一致するか?確認してみる。
factors = (LMS(1:2,:)'\T_xyzJuddVos(2,:)');
LMS2 = diag([factors ; 1])*LMS;
V = LMS2(1,:) + LMS2(2,:);
diff_V = sum(sum(abs(V-T_xyzJuddVos(2,:))));
fprintf('計算したL, M錐体分光感度の和とJudd-Vos修正分光視感効率の差 = %e\n', diff_V);
計算したL, M錐体分光感度の和とJudd-Vos修正分光視感効率の差 = 5.041294e-15
計算結果とCVRL SP fundamentalsの比較:詳細その1
diff_LMS = LMS - CVRL_sp(:,1:81);
figure;
plot(wls_LMS,diff_LMS(1,:),'r-'); hold on;
plot(wls_LMS,diff_LMS(2,:),'g-');
plot(wls_LMS,diff_LMS(3,:),'b-');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Difference', 'FontSize',14);
title('CVRL SP fundamentals vs. calculated LMS', 'FontSize',14);
[diff_values, index] = max(abs(((LMS - CVRL_sp(:,1:81)))),[],2);
cone_str = 'LMS';
for co = 1:3,
fprintf('Max difference for %s cone: %e at %d nm\n', cone_str(co), diff_values(co), wls_LMS(index(co)));
end
Max difference for L cone: 3.027765e-05 at 610 nm
Max difference for M cone: 2.261073e-05 at 440 nm
Max difference for S cone: 1.249499e-04 at 490 nm
計算結果とCVRL SP fundamentalsの比較:詳細その2
m_Judd = [0.15514, 0.54312, -0.03286; ...
-0.15514, 0.45684, 0.03286; ...
0, 0, 0.00801];
LMS_Judd = m_Judd * T_xyzJuddVos;
LMS_Judd = LMS_Judd ./ repmat(max(LMS_Judd,[],2), 1, size(LMS_Judd,2));
diff_LMS_Judd_vs_CVRL_sp = sum(sum(abs(LMS_Judd - CVRL_sp(:,1:81))));
fprintf('Judd用係数に基づく計算結果とCVRL SP fundamentalsの差 = %f\n', diff_LMS_Judd_vs_CVRL_sp);
diff_LMS = LMS_Judd - CVRL_sp(:,1:81);
figure;
plot(wls_LMS,diff_LMS(1,:),'r-'); hold on;
plot(wls_LMS,diff_LMS(2,:),'g-');
plot(wls_LMS,diff_LMS(3,:),'b-');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Difference', 'FontSize',14);
title('CVRL SP fundamentals vs. LMS derived with m-Judd', 'FontSize',14);
[diff_values, index] = max(abs(((LMS_Judd - CVRL_sp(:,1:81)))),[],2);
for co = 1:3,
fprintf('Max difference for %s cone: %e at %d nm\n', cone_str(co), diff_values(co), wls_LMS(index(co)));
end
Judd用係数に基づく計算結果とCVRL SP fundamentalsの差 = 0.000532
Max difference for L cone: 1.256124e-05 at 595 nm
Max difference for M cone: 1.988493e-05 at 490 nm
Max difference for S cone: 1.249499e-04 at 490 nm
Judd(1951)での計算とCVRL SP fundamentalsの比較
buf = csvread('ciexyzj.csv');
wls_Judd = buf(:,1)';
T_Judd = buf(:,2:4)';
LMS_Judd2 = m_Judd * T_Judd;
LMS_Judd2 = LMS_Judd2 ./ repmat(max(LMS_Judd2,[],2), 1, size(LMS_Judd2,2));
figure;
plot(wls_Judd(2:end), LMS_Judd2(:,2:end)','k-');
hold on;
plot(wls_Judd(2:end), CVRL_sp(1,1:2:79)','rx');
plot(wls_Judd(2:end), CVRL_sp(2,1:2:79)','gx');
plot(wls_Judd(2:end), CVRL_sp(3,1:2:79)','bx');
ylim([0 1]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('CVRL SP fundamentals vs. LMS derived with Judd(1951)', 'FontSize',14);
diff_LMS = LMS_Judd2(:,2:end) - CVRL_sp(:,1:2:79);
figure;
plot(wls_Judd(2:end),diff_LMS(1,:),'r-'); hold on;
plot(wls_Judd(2:end),diff_LMS(2,:),'g-');
plot(wls_Judd(2:end),diff_LMS(3,:),'b-');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Difference', 'FontSize',14);
title('CVRL SP fundamentals vs. LMS derived with Judd(1951)', 'FontSize',14);
[diff_values, index] = max(abs(((LMS_Judd2(:,2:end) - CVRL_sp(:,1:2:79)))),[],2);
for co = 1:3,
fprintf('Max difference for %s cone: %e at %d nm\n', cone_str(co), diff_values(co), wls_Judd(1+index(co)));
end
Max difference for L cone: 2.552606e-03 at 570 nm
Max difference for M cone: 2.253989e-03 at 540 nm
Max difference for S cone: 7.836241e-02 at 410 nm
おまけ
Golz & MacLeod (2003): Supplementary data
Golz_JV = dlmread('GM_XYZ_Vos.dat');
wls_Golz_JV = Golz_JV(:,1)';
Golz_JV = Golz_JV(:,2:4);
Golz_JV = Golz_JV';
Golz_J = dlmread('GM_XYZ_Judd.dat');
wls_Golz_J = Golz_J(:,1)';
Golz_J = Golz_J(:,2:4);
Golz_J = Golz_J';
Golz & MacLeod (2003): まずは、Juddによる修正等色関数とVosによるさらなる修正とを比較してみる
figure;
plot(wls_Golz_J, Golz_J','k-');
hold on;
plot(wls_Golz_JV, Golz_JV(1,:)','rx');
plot(wls_Golz_JV, Golz_JV(2,:)','gx');
plot(wls_Golz_JV, Golz_JV(3,:)','bx');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Tristimulus value', 'FontSize',14);
title('Golz: Judd(1951) vs. Vos(1978)', 'FontSize',14);
legend('Judd-X','Judd-Y','Judd-Z','Vos-X','Vos-Y','Vos-Z');
Golz & MacLeod (2003): Juddに基づく計算とJudd-Vosに基づく計算を比較してみる
Golz_LMS_J = m_Judd * Golz_J;
Golz_LMS_J = Golz_LMS_J ./ repmat(max(Golz_LMS_J,[],2), 1, size(Golz_LMS_J,2));
Golz_LMS_JV = m * Golz_JV;
Golz_LMS_JV = Golz_LMS_JV ./ repmat(max(Golz_LMS_JV,[],2), 1, size(Golz_LMS_JV,2));
figure;
plot(wls_Golz_J, Golz_LMS_J','k-');
hold on;
plot(wls_Golz_JV, Golz_LMS_JV(1,:)','rx');
plot(wls_Golz_JV, Golz_LMS_JV(2,:)','gx');
plot(wls_Golz_JV, Golz_LMS_JV(3,:)','bx');
ylim([0 1]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Golz: LMS from Judd(1951) vs. LMS from Vos(1978)', 'FontSize',14);
Golz & MacLeod (2003): SP錐体感度に関する確認
Golz_sp = dlmread('GM_LMS_SP.dat');
wls_Golz_sp = Golz_sp(:,1)';
Golz_sp = Golz_sp(:,2:4);
Golz_sp = Golz_sp ./ repmat(max(Golz_sp), size(Golz_sp,1), 1);
Golz_sp = Golz_sp';
figure;
plot(wls_Golz_J, Golz_LMS_JV','k-');
hold on;
plot(wls_Golz_sp, Golz_sp(1,:)','rx');
plot(wls_Golz_sp, Golz_sp(2,:)','gx');
plot(wls_Golz_sp, Golz_sp(3,:)','bx');
ylim([0 1]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Golz: LMS from Judd-Vos vs. SP fundamentals', 'FontSize',14);
diff_Golz_LMS_JV_vs_Golz_sp = sum(sum(abs(Golz_LMS_JV - Golz_sp)));
fprintf('Golz&MacLeodのJudd-Vos修正等色関数に基づく計算結果とGolz_spの差 = %f\n', diff_Golz_LMS_JV_vs_Golz_sp);
diff_LMS = Golz_LMS_JV - Golz_sp;
figure;
plot(wls_Golz_sp,diff_LMS(1,:),'r-'); hold on;
plot(wls_Golz_sp,diff_LMS(2,:),'g-');
plot(wls_Golz_sp,diff_LMS(3,:),'b-');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Difference', 'FontSize',14);
title('Golz: LMS from Judd-Vos vs. SP fundamentals', 'FontSize',14);
Golz&MacLeodのJudd-Vos修正等色関数に基づく計算結果とGolz_spの差 = 0.018581
Golz & MacLeod (2003): SP錐体感度と自分でJudd-Vosから計算した結果の比較
figure;
plot(wls_Golz_sp, Golz_sp','k-');
hold on;
plot(wls_LMS, LMS(1,:)','rx');
plot(wls_LMS, LMS(2,:)','gx');
plot(wls_LMS, LMS(3,:)','bx');
ylim([0 1]);
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Golz SP fundamentals vs. Our LMS derived with Judd-Vos', 'FontSize',14);
diff_Golz_sp_vs_LMS = sum(sum(abs(Golz_sp(:,1:5:end) - LMS)));
fprintf('Golz&MacLeodのSP錐体感度とJudd-Vos修正等色関数に基づく自前の計算結果との差 = %f\n', diff_Golz_sp_vs_LMS);
diff_LMS = Golz_sp(:,1:5:end) - LMS;
figure;
plot(wls_LMS,diff_LMS(1,:),'r-'); hold on;
plot(wls_LMS,diff_LMS(2,:),'g-');
plot(wls_LMS,diff_LMS(3,:),'b-');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Difference', 'FontSize',14);
title('Golz SP fundamentals vs. Our LMS derived with Judd-Vos', 'FontSize',14);
Golz&MacLeodのSP錐体感度とJudd-Vos修正等色関数に基づく自前の計算結果との差 = 0.023057