Contents
KisoHB_ColorSpaceTransformation.m
clear all; close all
Smith & Pokorny (1975) 錐体分光感度 と Judd-Vos修正等色関数を読み込む
load OurT_cones_sp
T_cones_sp = OurT_cones_sp;
S_cones_sp = OurS_cones_sp;
load T_xyzJuddVos
wls = SToWls(S_cones_sp);
各データをプロットしてみる。
Fig. 1: Smith & Pokorny (1975) 錐体分光感度のプロット
figure(1);
plot(wls,T_cones_sp(1,:)','r');
hold on
plot(wls,T_cones_sp(2,:)','g');
plot(wls,T_cones_sp(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Fig.1: Smith & Pokorny Cone Spectral Sensitivity Functions', 'FontSize',14);
Fig. 2: Judd-Vos修正等色関数のプロット
figure(2);
plot(wls,T_xyzJuddVos(1,:)','r');
hold on
plot(wls,T_xyzJuddVos(2,:)','g');
plot(wls,T_xyzJuddVos(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Tristimulus value', 'FontSize',14);
title('Fig.2: Judd-Vos Modified Color Matching Functions', 'FontSize',14);
Judd-Vos修正等色関数からSmith & Pokorny (1975) 錐体分光感度への変換行列を求める
M_JuddVosToCones = ((T_xyzJuddVos')\(T_cones_sp'))';
T_cones_fromJuddVos = M_JuddVosToCones*T_xyzJuddVos;
Fig. 3: 計算結果と元データを重ねて確認
figure(3);
plot(wls,T_cones_sp(1,:)','r');
hold on
plot(wls,T_cones_sp(2,:)','g');
plot(wls,T_cones_sp(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Fig.3: Smith & Pokorny Cone Spectral Sensitivity Functions', 'FontSize',14);
plot(wls,T_cones_fromJuddVos(1,:)','rs');
plot(wls,T_cones_fromJuddVos(2,:)','gs');
plot(wls,T_cones_fromJuddVos(3,:)','bs');
axis([350 800 -0.05 1.1]);
Smith & Pokorny (1975) 錐体分光感度 と CIE 1931 等色関数
load OurT_cones_sp
load T_xyz1931;
Fig4: CIE1931等色関数のプロット
figure(4);
plot(wls,T_xyz1931(1,:)','r');
hold on
plot(wls,T_xyz1931(2,:)','g');
plot(wls,T_xyz1931(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Tristimulus value', 'FontSize',14);
title('Fig.4: CIE1931 Color Matching Functions', 'FontSize',14);
CIE1931等色関数からSmith & Pokorny (1975) 錐体分光感度への変換行列を無理矢理求める
M_1931ToCones = ((T_xyz1931')\(T_cones_sp'))';
T_cones_from1931 = M_1931ToCones*T_xyz1931;
Fig.5: 計算結果を元データに重ねてみる
figure(5);
plot(wls,T_cones_sp(1,:)','r');
hold on
plot(wls,T_cones_sp(2,:)','g');
plot(wls,T_cones_sp(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Fig.5: Smith&Pokorny vs. ConesFromCIE1931', 'FontSize',14);
plot(wls,T_cones_from1931(1,:)','ro');
plot(wls,T_cones_from1931(2,:)','go');
plot(wls,T_cones_from1931(3,:)','bo');
axis([350 800 -0.05 1.1]);
Stockman & Sharpe (2000) 錐体分光感度 と CIE 1931 等色関数
load T_xyz1931;
load OurT_cones_ss2;
T_cones_ss2 = OurT_cones_ss2;
S_cones_ss2 = OurS_cones_ss2;
T_xyz1931 = SplineCmf(S_xyz1931,T_xyz1931,S_cones_ss2);
wls = SToWls(S_cones_ss2);
M_1931ToCones_SS = ((T_xyz1931')\(T_cones_ss2'))';
T_cones_SS2_from1931 = M_1931ToCones_SS*T_xyz1931;
Fig.6: 計算結果を元データに重ねてみる
figure(6);
ourStep = 1:5:S_cones_ss2(3);
plot(wls,T_cones_ss2(1,:)','r');
hold on
plot(wls,T_cones_ss2(2,:)','g');
plot(wls,T_cones_ss2(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Fig.6: Stockman&Sharpe vs. ConesFromCIE1931-SS', 'FontSize',14);
plot(wls(ourStep),T_cones_SS2_from1931(1,ourStep)','r*');
plot(wls(ourStep),T_cones_SS2_from1931(2,ourStep)','g*');
plot(wls(ourStep),T_cones_SS2_from1931(3,ourStep)','b*');
axis([350 800 -0.05 1.1]);
Stockman & Sharpe (2000) 錐体分光感度 と Judd-Vos修正等色関数
load T_xyzJuddVos
load T_cones_ss2;
T_xyzJuddVos = SplineCmf(S_xyzJuddVos,T_xyzJuddVos,S_cones_ss2);
wls = SToWls(S_cones_ss2);
M_JuddVosToCones_SS = ((T_xyzJuddVos')\(T_cones_ss2'))';
T_cones_SS_fromJuddVos = M_JuddVosToCones_SS*T_xyzJuddVos;
Fig.7: 計算結果を元データに重ねてみる
ourStep = 1:5:S_cones_ss2(3);
figure(7);
plot(wls,T_cones_ss2(1,:)','r');
hold on
plot(wls,T_cones_ss2(2,:)','g');
plot(wls,T_cones_ss2(3,:)','b');
xlabel('Wavelength (nm)', 'FontSize',14);
ylabel('Relative Sensitivity', 'FontSize',14);
title('Fig.7: Stockman&Sharpe vs. ConesFromJuddVos-SS', 'FontSize',14);
plot(wls(ourStep),T_cones_SS_fromJuddVos(1,ourStep)','rx');
plot(wls(ourStep),T_cones_SS_fromJuddVos(2,ourStep)','gx');
plot(wls(ourStep),T_cones_SS_fromJuddVos(3,ourStep)','bx');
axis([350 800 -0.05 1.1]);