matplotlib颜色表的直方图均衡化
我是 python 和 matplotlib 的新手,我想知道是否有人知道是否有任何实用程序可用于执行等效的直方图均衡,但对于 matplotlib 颜色表?有一个名为 matplotlib.colors.Normalize 的函数,如果给定图像数组,它将自动设置底部和顶部级别,但我想要更智能的东西。我总是可以将直方图均衡应用于数据本身,但我宁愿不接触数据。有什么想法吗?
I'm new to python and matplotlib and I was wondering whether anyone knew if there were any utilities available to do the equavalent of histogram equalization but to a matplotlib color table? There is a function called matplotlib.colors.Normalize which, if given a image array, will automatically set the bottom and top levels but I want something more intelligent that this. I could always just apply histogram equalization to the data itself but I would rather not touch the data. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须创建自己的特定于图像的颜色图,但这并不太棘手:
You have to create your own image-specific colormap, but it's not too tricky:
直方图均衡可以通过修改图像的调色板(或 LUT)来应用,因此它会定义均衡的调色板。
我搜索了一下,找不到计算均衡调色板的源代码,因此除非存在某些内容,否则您必须自己编写代码。
您应该从维基百科文章上的算法描述开始。
您还可以在 matplotlib 列表上寻求帮助。
Histogram equalization can be applied by modifying the palette (or LUT) of your image, so it would the definition of a palette that is equalized.
I searched a bit and couldn't find source code for computing an equalized palette, so unless something exitss you would have to code it yourself.
You should be started with the description of the algorithm on the Wikipedia article.
You could also ask for help on the matplotlib lists.