0

I have this normalized grey-level co-occurence matrix (GLCM)

d <- matrix(c(0,0,0,0,0,0,0,0,0,0,
          0,0.093654267,0.0253829322,0.0021881838,0.0013129103,0,0,0,0,0,
          0,0.025382932,0.2717724289,0.0494529540,0.0070021882,0.001312910,0.0008752735,0,0,0,
          0,0.002188184,0.0494529540,0.0910284464,0.0363238512,0.009628009,0.0004376368,0,0.0004376368,0,
          0,0.001312910,0.0070021882,0.0363238512,0.0586433260,0.031947484,0.0070021882,0.003063457,0.0008752735,0,
          0,0,0.0013129103,0.0096280088,0.0319474836,0.029759300,0.0188183807,0.006126915,0.0013129103,0,
          0,0,0.0008752735,0.0004376368,0.0070021882,0.018818381,0.0078774617,0.006126915,0.0030634573,0,
          0,0,0,0,0.0030634573,0.006126915,0.0061269147,0.007877462,0.0035010941,0,
          0,0,0,0.0004376368,0.0008752735,0.001312910,0.0030634573,0.003501094,0.00700218820,0,
          0,0,0,0,0,0,0,0,0,0), 10,10,byrow = TRUE)

I want to calculate different texture features after Haralick: Haralick et al. 1973, p. 619 (PDF warning)

How can I calculate for example ASM Textural features after Haralick et al. 1973

where p(i,j) is the (i,j,)th entry in the normalized grey-tone spatial dependence matrix?

Tonechas
  • 13,398
  • 16
  • 46
  • 80
loki
  • 9,816
  • 7
  • 56
  • 82
  • 1
    If you're trying to compute the sum of the squares of every element in `d`, that's just `sum(d^2)`. However, I can't tell from your question if a "grey-tone spatial dependence matrix" is the same as a "grey-level co-occurence matrix"? – josliber Mar 11 '14 at 15:10
  • 1
    Why reinvent the wheel? There is a GLCM package available (http://cran.r-project.org/web/packages/glcm/index.html). The following statistics are available from the GLCM: "mean", "variance", "homogeneity", "contrast", "dissimilarity", "entropy", "second_moment", "correlation". – Jeffrey Evans Mar 11 '14 at 15:14
  • Yes it is the same. I tried `sum(d^2)` and it looks quite fine. I also tried `ASM <- sum(rowSums((d[1:10,1:10])^2))`, which brings the same result. But now I am trying the Contrast value, but don't know how to calculate this. Do you have an idea – loki Mar 11 '14 at 15:19
  • @JeffreyEvans I calculated the GLCMs on object base with eCognition and to check if it works fine I want to calculate the values manually – loki Mar 11 '14 at 15:21

0 Answers0