finding homogineity of a matrix

4 ビュー (過去 30 日間)
Mohammad Golam Kibria
Mohammad Golam Kibria 2011 年 11 月 3 日
I have the following code:
[r c]=find(I==1);
smallGrayImage=grayImage([r c]);
smallGLCM=graycomatrix(smallGrayImage);
stats = graycoprops(smallGLCM, 'Energy');
statsEnergy(i,2) = stats.Energy;
stats = graycoprops(smallGLCM, 'Homogeneity');
statsHomogeneity(i,2) = stats.Homogeneity;
where [r c] contains a small region of an image, I need to Homogeneity of that region. but I am confused whether my code is right wrong. can anybody help to do that? thanks.

採用された回答

David Young
David Young 2011 年 11 月 3 日
The first two lines do not look correct:
[r c]=find(I==1);
smallGrayImage=grayImage([r c]);
Indexing grayImage this way does not make sense, because each entry in the matrix [r c] will be treated as a linear index, not as a row or column index.
To give you a better way, I'll need to know what you are aiming to do. You can't just pick out some arbitrary elements of grayImage - you need to pick out a rectangular region - so one question is, how is I generated, and what does it contain?
I suspect the solution might lie in previous answers to your questions - for example this one.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by