如何仅计算 png 图像中红色和绿色像素的估计联合概率分布?
我有一个仅包含红色和绿色通道的 png 图像。为了计算目的,我从图像中删除了蓝色通道。我需要计算这些像素的估计联合概率分布。我遇到了这个函数: numpy.random.multivariate_normal(平均值, cov[, 大小]) 但这是计算已知的分布。我需要计算估计分布。有什么建议吗? 多谢。 阿雷吉
I have a png image that contains the red and green channels only. I removed the blue channel from the image for calculation purposes. I need to calculate the estimated joint probability distribution for these pixels. I came across this function:
numpy.random.multivariate_normal(mean, cov[, size])
but this one computes the known distribution. I need to calculate the estimated distribution. Any suggestions?
Thanks a lot.
Areej
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将数据分成一组直方图很容易
从那里开始互信息很容易:
it's easy to bin the data into a set of histograms
From there the mutual information is easy:
使用 scipy,您可以使用多种分布来拟合数据。下面是如何执行此操作的示例,假设您从 .png 或 .jpg 或相关文件加载图像:
如果您想要不同的发行版,请将上面的
norm
替换为以下之一:< a href="http://docs.scipy.org/doc/scipy/reference/stats.html" rel="nofollow">http://docs.scipy.org/doc/scipy/reference/stats.html< /a>Using scipy, there are a number of distributions you can fit to data. Here's an example of how to do that, assuming you're loading your image from a .png or .jpg or related file:
If you want a different distribution, replace
norm
above with one of these: http://docs.scipy.org/doc/scipy/reference/stats.html