diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7275bb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..13487d1 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +TongueColorCheckerAnalysis +=============== +舌診カラーチェッカーの評価 + +### 開発環境 +- Python 3.12.0 +``` +$ python -m venv venv +$ venv/Scripts/activate +$ pip install -r requirements.txt +``` diff --git a/Spectrum.xlsx b/Spectrum.xlsx new file mode 100644 index 0000000..80fb006 --- /dev/null +++ b/Spectrum.xlsx Binary files differ diff --git "a/TCC\350\250\210\346\270\254\345\206\231\347\234\237.pptx" "b/TCC\350\250\210\346\270\254\345\206\231\347\234\237.pptx" new file mode 100644 index 0000000..abdbb3c --- /dev/null +++ "b/TCC\350\250\210\346\270\254\345\206\231\347\234\237.pptx" Binary files differ diff --git a/calc_xyz.py b/calc_xyz.py new file mode 100644 index 0000000..5e8f410 --- /dev/null +++ b/calc_xyz.py @@ -0,0 +1,37 @@ +import openpyxl +import numpy as np +import matplotlib.pyplot as plt + + +def excel_row(filename, range): + wb = openpyxl.load_workbook(filename) + sheet = wb[wb.sheetnames[0]] + return [cell.value for cell in sheet[range][0]] + + +led_sp = np.float32(excel_row("Spectrum.xlsx", "B2:AF2")) +# print("led=", led_sp) +cmf_x_sp = np.float32(excel_row("Spectrum.xlsx", "B3:AF3")) +cmf_y_sp = np.float32(excel_row("Spectrum.xlsx", "B4:AF4")) +cmf_z_sp = np.float32(excel_row("Spectrum.xlsx", "B5:AF5")) +sum_y = led_sp.dot(cmf_y_sp) +k = 100.0 / sum_y +# tri_x = (led_sp).dot(cmf_x_sp) * k +# tri_y = (led_sp).dot(cmf_y_sp) * k +# tri_z = (led_sp).dot(cmf_z_sp) * k +# print(tri_x, tri_y, tri_z) + +for patch_no in range(1, 25): + row = patch_no + 1 + tcc_sp = np.float32(excel_row("handy_tcc.xlsx", f"F{row}:AJ{row}")) / 100 + # print(f"tcc{patch_no}=", tcc_sp) + + tri_x = (led_sp * tcc_sp).dot(cmf_x_sp) * k + tri_y = (led_sp * tcc_sp).dot(cmf_y_sp) * k + tri_z = (led_sp * tcc_sp).dot(cmf_z_sp) * k + print(patch_no, tri_x, tri_y, tri_z, sep="\t") + +# wavelen = np.linspace(400, 700, 31) +# plt.plot(wavelen, led_sp, c="k") +# plt.plot(wavelen, tcc_sp, c="r") +# plt.show() diff --git a/handy_tcc.xlsx b/handy_tcc.xlsx new file mode 100644 index 0000000..531f522 --- /dev/null +++ b/handy_tcc.xlsx Binary files differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7bc79d3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +matplotlib +numpy +openpyxl +pillow diff --git a/sugawara_tcc_mat8485.xlsx b/sugawara_tcc_mat8485.xlsx new file mode 100644 index 0000000..84e88fd --- /dev/null +++ b/sugawara_tcc_mat8485.xlsx Binary files differ diff --git a/takano_tcc.xlsx b/takano_tcc.xlsx new file mode 100644 index 0000000..f1095f8 --- /dev/null +++ b/takano_tcc.xlsx Binary files differ diff --git a/tongue_spectrum.xlsx b/tongue_spectrum.xlsx new file mode 100644 index 0000000..02c4866 --- /dev/null +++ b/tongue_spectrum.xlsx Binary files differ