user2157806
user2157806

Reputation: 319

Dimension of Skewness in Matlab

Can someone help me how to solve this.

grayImage=dicomread('028tm.R.dcm');
sx=32;
sy=32;
theta=[0 pi/4 2*pi/4 3*pi/4 4*pi/4 5*pi/4 6*pi/4 7*pi/4];

gamma=1;
psi=0;
sigma=6; % ????12
lambda=[5 6 7 8 9 7];

# Creating 40 Gabor Filters
G = cell(5,8);
for i = 1:5
  for j = 1:8
    G{i,j}=zeros(65,65);
  end
end
for i = 1:5
  for j = 1:8
    f=1/lambda(i);      

    [T,gabout] = gaborfilter1(grayImage,sx,sy,f,theta(j));
    u{i,j}=mean2(gabout);
    del{i,j}=std2(gabout);  
    skew{i,j} =skewness(gabout);
    sk=[skew{:,:}];
    std=[u{:,:}];
    mn=[del{:,:}];
    disp(sk)             
  end
end

and this is I will show my workspace.

mn <1x40 double>
sk<1x10280 double>
std<1x40 double>

why sk(the value of skewness) is 1X10280 double????? it should be 1x40 like standard deviation and mean. How to make sk(skewness) to be 1x40?

Hope someone can help me.

Upvotes: 1

Views: 445

Answers (1)

Chris Taylor
Chris Taylor

Reputation: 47392

Your problem is that mean2 and std2 operate on the entire image, but skewness operates on the columns of the image. You should define a new function

function sk = skewness2(X)
    sk = skewness(X(:));
end

And use that in place of skewness.

Upvotes: 2

Related Questions