1 Star 0 Fork 0

Yyhan/machinevision-toolbox-python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Untitled.ipynb 56.60 KB
一键复制 编辑 原始数据 按行查看 历史
import numpy as np
import matplotlib.pyplot as plt
from color import blackbody
nm = 1e-9

Figure 10.2(a)

lam = np.linspace(300, 1000, 50)
for T in [3000, 4000, 5000, 6000]:
    e = blackbody(lam * nm, T)
    plt.plot(lam, e, label=f"{T}K")
plt.grid(True)
plt.xlabel('Wavelength (nm)')
plt.ylabel('$E(\lambda)\,\, (W sr^{-1} m^{-2} m^{-1})$')
plt.legend()
<matplotlib.legend.Legend at 0x7fec3d9c15d0>

Figure 10.2(b), need to add human eye response

lam = np.linspace(300, 1000, 50)

e = blackbody(lam * nm, 2600)
plt.plot(lam, e / max(e), label="Tungsten lamp (2600K)")

e = blackbody(lam * nm, 5778)
plt.plot(lam, e / max(e), label="Sun (5778K)")

plt.grid(True)
plt.xlabel('Wavelength (nm)')
plt.ylabel('Normalized $E(\lambda)$')
plt.legend()
<matplotlib.legend.Legend at 0x7fec3e3e1a10>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/helloliver/machinevision-toolbox-python.git
git@gitee.com:helloliver/machinevision-toolbox-python.git
helloliver
machinevision-toolbox-python
machinevision-toolbox-python
master

搜索帮助