3

One of the most widely used homogeneity measurements is the Shannon entropy: enter image description here

where p is the normalized histogram of an image of L grey levels.

We can measure such entropy by using not only image intensities but also image local gradients, since homogeneous images not only exhibit well ordered intensities but also well clustered very low gradient values in homogeneous regions ( J.V. Manjon et al, “A Nonparametric MRI Inhomogeneity Correction Method”, Medical Image Analysis, 2007).

Let Y be an image with M pixels and L1 grey levels, and let G be the associated image corresponding to the magnitude of the local gradient with L2 grey levels. The intensity gradient joint histogram is defined as: enter image description here

where δ is the Kronecker delta function. So the normalized intensity-gradient joint histogram: enter image description here

Therefore the entropy associated to the intensity-gradient joint histogram is: enter image description here

I need to calculate the above entropy for biomedical image data: http://i.stack.imgur.com/I4hf4.png. I found this discussion useful: Mutual information and joint entropy of two images - MATLAB, but I don't know if the joint histogram and the joint entropy calculated (by @rayryeng) in this discussion are the same as what I need, and if not, how I could calculate this entropy using Matlab? Any help is as always appreciated.

4

1 回答 1

2

是的,你仍然可以使用我的帖子。

看看您上面的问题,使用了 Kronecker Delta 函数,因此对于每个i联合j直方图中,您想要搜索我们在图像中遇到强度的所有值以及相同空间位置i的梯度值。我们计算遇到这些问题的次数,并将其记入联合直方图的第 th行和第 th列条目。jij

您链接到的帖子正在做同样的事情,但第二张图片只是一张普通的强度图像。你所要做的就是用你的渐变图像替换第二个图像,这样你就可以肯定地使用我的帖子了。

你唯一需要做的就是设置im1 = Yim2 = G。如果您查看链接到的帖子,我刚刚修改了计算联合直方图的帖子以提高效率。当我不需要时,我不必要地声明了一个向量ones

您所指的帖子假定两者都是YG数值。但是,如果您的梯度值G不是整数(可能是这种情况),您仍然可以使用我的帖子,但您必须将每个唯一double值分配给唯一 ID,并将此 ID 数组用作accumarray. 因此,您需要做的是使用的第三个输出unique来帮助您实现这一点。第三个输出将为在 中遇到的每个唯一浮点值提供唯一 ID G。借用我帖子中的代码,这就是您在每种情况下都会做的事情:

整数值梯度

indrow = double(Y(:)) + 1;
indcol = double(G(:)) + 1;
jointHistogram = accumarray([indrow indcol], 1);
jointProb = jointHistogram / length(indrow);
indNoZero = jointHistogram ~= 0;
jointProb1DNoZero = jointProb(indNoZero);
jointEntropy = -sum(jointProb1DNoZero.*log2(jointProb1DNoZero));

浮点梯度

indrow = double(Y(:)) + 1;
[~,~,indcol] = unique(G(:)); %// Change
jointHistogram = accumarray([indrow indcol], 1);
jointProb = jointHistogram / length(indrow);
indNoZero = jointHistogram ~= 0;
jointProb1DNoZero = jointProb(indNoZero);
jointEntropy = -sum(jointProb1DNoZero.*log2(jointProb1DNoZero));

请注意,上面id会自动转换到wheredouble并且它会自动从 1 开始,因此不需要像我们对图像强度所做的那样偏移 1。


祝你好运!

于 2015-01-02T04:33:00.997 回答