【发布时间】:2019-11-09 22:11:27
【问题描述】:
我有一个 2D 频谱图数据数组,我正在使用 scikit-image 对其进行缩放,以便在 Web 浏览器中显示。我想在 y 轴上以对数方式缩放数组。”
我可以使用 Matplotlib 在 y 轴上以对数方式绘制数据,但我想访问这个新缩放图像的二维数组表示,但 Matplotlib 只提供原始的、未缩放的数组。 Scikit-image 线性缩放二维数组,但不是对数。
# plot a log-scaled z
w, h = z.shape
fig, ax = plt.subplots()
ax.set_yscale('symlog')
mesh = ax.pcolormesh(np.arange(h+1), np.arange(w+1), z)
# get the array of z
logimg = mesh.get_array().reshape(mesh._meshHeight, mesh._meshWidth)
【问题讨论】:
-
为什么不能只在这个数组上应用日志来获得所需的值?为什么要从图像中提取数据?另外,请阅读How to create a Minimal, Complete, and Verifiable example
标签: python image numpy matplotlib scikit-image