Hi, who can complete my this code. I find feature extraction using GLCM, in below the formula.
2 次查看(过去 30 天)
显示 更早的评论
I know there is a function graycoprops() in Matlab Image Processing Toolbox that computes four parameters Contrast, Correlation, Energy,and Homogeneity. And already trying and work too.
But I want to count GLCM Manually using this formula I get from paper by Haralick to check did the result same or not. Here the formula:
Contrast = sum_i(sum_j( (i-j)^2 * p(i,j) ) );
Correlation = sum_i( sum_j( (i - u_i)(j - u_j)p(i,j)/(s_i.s_j) ) ) ;
Energy = sum_i( sum_j( p(i,j)^2 ) ) ;
Homogeneity = sum_i( sum_j( p(i,j) / (1 + i-j) ) ) (as in matlab);
Where:
u_i = sum_i( sum_j( i.p(i,j) ) ) ;
u_j = sum_i( sum_j( j.p(i,j) ) ) ;
s_i = sum_i( sum_j( (i - u_x)^2.p(i,j) ) ) ;
s_j = sum_i( sum_j( (j - u_y)^2.p(i,j) ) ) ;
When i run it, I get error 'not defined variabel p(i,j), sum_i, sum_j'.
So, my question is how to declarad p(i,j). p(i,j) is probability from intensity i and j
May some answers can help. thanks
2 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!