Kurtosis function on image

I would like to calculate the Kurtosis of an image in matlab. Matlab has a function kurtosis I can use this function on a matrix. For example:

m = rand([4 5]);
kurtosis(m(:));

Though when I use this grayscale image:

I = imread('0.tiff');
kurtosis(I(:));

I get this error:

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);

My question now is: What am I doing wrong, and how can I calculate the kurtosis of an image.

Answers


kurtosis needs I to be double. This works:

kurtosis(double(I(:)));

or this

kurtosis(double(I));

Need Your Help

Changing namespace of the WPF Project Template

wpf project-template

When I modify the xaml's cs's I will have to go in and manually modify the corresponding *.g.cs file. And it seems to get overwritten every time I rebuild.

Altering search form action not working for custom search module, Drupal 6

drupal search drupal-6

I am altering the value of the form action for the basic search form on a Drupal site. Here is the line I added to our hook_form_alter() implementation in our custom search module:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.