相机响应函数(CRF)数据集 DoRF,响应曲线绘制
import numpy as np
import matplotlib.pyplot as plt
# DoRF 一共有201个相机的曲线,每条曲线1024个采样点
matrix_x = np.zeros((201, 1024), dtype=np.float)
matrix_y = np.zeros((201, 1024), dtype=np.float)
with open('dorfCurves.txt', 'r') as f:
buffer = f.readlines()
for i in range(201):
matrix_x[i, :] = np.asarray([float(ii) for ii in buffer[i * 6 + 3].split(' ')]) # I
matrix_y[i, :] = np.asarray([float(ii) for ii in buffer[i * 6 + 5].split(' ')]) # B
# 201条曲线太多,选择一部分绘制(间隔10条选1条)
plt.scatter(matrix_x[::10, ], matrix_y[::10, ], edgecolor='none', s=1)
plt.axis([0.0, 1.0, 0.0, 1.0])
plt.show()