我想在 matlab 中计算图像的峰度。
Matlab 有一个函数kurtosis
我可以在矩阵上使用这个函数。例如:
m = rand([4 5]);
kurtosis(m(:));
虽然当我使用这个灰度图像时:
I = imread('0.tiff');
kurtosis(I(:));
我收到这个错误:
Error using - Integers can only be combined with integers of the same class, or scalar doubles.
Error in kurtosis (line 39) x0 = x - repmat(nanmean(x,dim), tile);
我现在的问题是:我哪里做错了,我该如何计算图像的峰度。
最佳答案
峰度需要我是双倍的。这有效:
kurtosis(double(I(:)));
或者这个
kurtosis(double(I));
关于matlab - 图像峰度函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12527812/