correcting haralick features code

7 ビュー (過去 30 日間)
eten hyle
eten hyle 2023 年 5 月 6 日
回答済み: Suraj Kumar 2024 年 9 月 4 日
Why is this code not working and returns
('error' .... out = features_calc(GLCMS,{'autoc','dissi','cshad','entro'}), Undefined function or variable 'features_calc'.
Can any one help me in correcting this codes? I need to calculate and display all haralick features,please
I=dicomread('mri.dcm');
k=rgb2gray(I);
h = uint8(k);
offsets=[0 1;-1 1;-1 0;-1 -1; 1 1; 0 -1; 1 -1; 1 0];
[GLCMS,SI] =graycomatrix(h,'Offset',offsets);
out = features_calc(GLCMS,{'autoc','dissi','cshad','entro'});
g1 =out.outoc;
g2 =out.diss;
g3 =out.cshad;
g4=out.entro;
out=('autoc dissi cshad entro');
figure,imshow(g1);
figure,imshow(g2);
figure,imshow(g3);
  4 件のコメント
eten hyle
eten hyle 2023 年 5 月 9 日
I=dicomread('mri.dcm');
k=rgb2gray(I);
h = uint8(k);
offsets=[0 1;-1 1;-1 0;-1 -1; 1 1; 0 -1; 1 -1; 1 0];
[GLCMS,SI] =graycomatrix(h,'Offset',offsets);
out = features_calc(GLCMS,{'autoc','dissi','cshad','entro'});
g1 =out.outoc;
g2 =out.diss;
g3 =out.cshad;
g4=out.entro;
out=('autoc dissi cshad entro');
figure,imshow(g1);
figure,imshow(g2);
figure,imshow(g3);
eten hyle
eten hyle 2023 年 5 月 9 日
sir,the image above is the one i tried to use

サインインしてコメントする。

回答 (1 件)

Suraj Kumar
Suraj Kumar 2024 年 9 月 4 日
Hi Eten,
To calculate and display certain Haralick features from a DICOM image, you can use the ‘graycoprops function in MATLAB and compute some standard Haralick features that are available such as Contrast, Correlation, Energy and Homogeneity.
% Haralick features using graycoprops
stats = graycoprops(GLCMS, {'Contrast', 'Correlation', 'Energy', 'Homogeneity'});
% Display the features
fprintf('Contrast: %f\n', stats.Contrast);
fprintf('Correlation: %f\n', stats.Correlation);
fprintf('Energy: %f\n', stats.Energy);
fprintf('Homogeneity: %f\n', stats.Homogeneity);
To know more about the graycoprops function, you can refer the following page:
Hope this works for you!

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by