Repository: scikit-image/scikit-image

Issue:
DOCS: GLCM example hard to follow
In the GLCM Texture Features example, I find the following sentence popping out by not being understandable:

> For each patch, a GLCM with a horizontal offset of 5 is computed.

What is unclear:
* What means 'horizontal'? 
* Offset from what?

I'm looking at this page:
http://scikit-image.org/docs/dev/auto_examples/features_detection/plot_glcm.html#sphx-glr-auto-examples-features-detection-plot-glcm-py




Discussion:
What do you mean by popping out? If I run the script, nothing is printed (skimage 0.12 or dev).
Thanks @michaelaye ! It's is indeed hard to understand without looking at the example code and the API docs.
What is meant, I think, that GLCM is called with `distance=[5]` and `angles=[0]`.

Feel free to sumbit a PR with an enhancement.
I don't know what a distance and angles stand for in GLCM either. Sorry, I can't submit a PR as I don't understand what is going on. ;) Maybe i should just read a primer on GLCMs...

Resolving patch:
diff --git a/doc/examples/features_detection/plot_glcm.py b/doc/examples/features_detection/plot_glcm.py
--- a/doc/examples/features_detection/plot_glcm.py
+++ b/doc/examples/features_detection/plot_glcm.py
@@ -4,19 +4,25 @@
 =====================
 
 This example illustrates texture classification using grey level
-co-occurrence matrices (GLCMs). A GLCM is a histogram of co-occurring
+co-occurrence matrices (GLCMs) [1]_. A GLCM is a histogram of co-occurring
 greyscale values at a given offset over an image.
 
 In this example, samples of two different textures are extracted from
 an image: grassy areas and sky areas. For each patch, a GLCM with
-a horizontal offset of 5 is computed. Next, two features of the
-GLCM matrices are computed: dissimilarity and correlation. These are
-plotted to illustrate that the classes form clusters in feature space.
-
+a horizontal offset of 5 (`distance=[5]` and `angles=[0]`) is computed.
+Next, two features of the GLCM matrices are computed: dissimilarity and
+correlation. These are plotted to illustrate that the classes form
+clusters in feature space.
 In a typical classification problem, the final step (not included in
 this example) would be to train a classifier, such as logistic
 regression, to label image patches from new images.
 
+References
+----------
+.. [1] Haralick, RM.; Shanmugam, K.,
+       "Textural features for image classification"
+       IEEE Transactions on systems, man, and cybernetics 6 (1973): 610-621.
+       :DOI:`10.1109/TSMC.1973.4309314` 
 """
 import matplotlib.pyplot as plt
 
@@ -47,7 +53,8 @@
 xs = []
 ys = []
 for patch in (grass_patches + sky_patches):
-    glcm = greycomatrix(patch, [5], [0], 256, symmetric=True, normed=True)
+    glcm = greycomatrix(patch, distances=[5], angles=[0], levels=256,
+                        symmetric=True, normed=True)
     xs.append(greycoprops(glcm, 'dissimilarity')[0, 0])
     ys.append(greycoprops(glcm, 'correlation')[0, 0])
 
diff --git a/skimage/feature/texture.py b/skimage/feature/texture.py
--- a/skimage/feature/texture.py
+++ b/skimage/feature/texture.py
@@ -61,9 +61,13 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False,
     ----------
     .. [1] The GLCM Tutorial Home Page,
            http://www.fp.ucalgary.ca/mhallbey/tutorial.htm
-    .. [2] Pattern Recognition Engineering, Morton Nadler & Eric P.
+    .. [2] Haralick, RM.; Shanmugam, K.,
+           "Textural features for image classification"
+           IEEE Transactions on systems, man, and cybernetics 6 (1973): 610-621.
+           :DOI:`10.1109/TSMC.1973.4309314`
+    .. [3] Pattern Recognition Engineering, Morton Nadler & Eric P.
            Smith
-    .. [3] Wikipedia, https://en.wikipedia.org/wiki/Co-occurrence_matrix
+    .. [4] Wikipedia, https://en.wikipedia.org/wiki/Co-occurrence_matrix
 
 
     Examples


Test patch: