Hi, I want ask you why the size of graycomatrix 8 x 8 ? that size default 8 x 8 or how ?
조회 수: 1 (최근 30일)
이전 댓글 표시
sir I example matrix gray = [0 1 2 2; 1 1 2 1; 1 0 2 0;]; but after I m=graycomatrix(gray); the result like this :
m =
0 0 0 0 0 0 0 2
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 5
댓글 수: 0
채택된 답변
Walter Roberson
2018년 10월 16일
It is because NumLevels defaults to 8
"Number of gray levels, specified as an integer. For example, if NumLevels is 8, graycomatrix scales the values in I so they are integers between 1 and 8. The number of gray-levels determines the size of the gray-level co-occurrence matrix (glcm)."
댓글 수: 18
sam alsalihy
2020년 5월 16일
it is by defalt the output scale to 8. It ismean that the value of input image will be converted from its range to the range between 0-8 then calculate the glcm matrix
for example if you set image pp=[1 2 5 4 7;5 4 2 5 3; 1 2 3 4 2;2 2 2 3 1 ]
and [GLCMS,SI] = graycomatrix(pp,'NumLevels',7,'G',[]) so the NumLevels=7 it s in the same range ofthe pp image thus will convert matrix SI
1 2 5 4 7
5 4 2 5 3
1 2 3 4 2
2 2 2 3 1
it mean same orginal image. but for example the NumLevels=10 it will convert to range 1-10, thus the SI matrix will be
추가 답변 (1개)
sam alsalihy
2020년 5월 16일
as the following
1 2 7 6 10
7 6 2 7 4
1 2 4 6 2
2 2 2 4 1
then the glcm matrix calculated from SI
1 2 3 4 5 6 7 8 9 10
1: 0 2 0 0 0 0 0 0 0 0
2: 0 2 0 2 0 0 2 0 0 0
3: 0 0 0 0 0 0 0 0 0 0
4: 1 0 0 0 0 1 0 0 0 0
5: 0 0 0 0 0 0 0 0 0 0
6: 0 2 0 0 0 0 0 0 0 1
7: 0 0 0 1 0 2 0 0 0 0
8: 0 0 0 0 0 0 0 0 0 0
9: 0 0 0 0 0 0 0 0 0 0
10: 0 0 0 0 0 0 0 0 0 0
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!