From 2f3da9cc8fab4c7afc189e781a9335c0166bb617 Mon Sep 17 00:00:00 2001 From: emmanuelle Date: Thu, 8 Dec 2011 21:53:31 +0100 Subject: [PATCH] BUG: greycomatrix, one of the tests was failing for symmetric case test_glcm.TestGLCM.test_output_symmetric_1 was failing on my computer. I think this is because np.transpose returns a view when possible, so P += np.transpose(P) must do weird things. --- skimage/feature/greycomatrix.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/skimage/feature/greycomatrix.py b/skimage/feature/greycomatrix.py index 5212cf63..081fe8d1 100644 --- a/skimage/feature/greycomatrix.py +++ b/skimage/feature/greycomatrix.py @@ -101,7 +101,9 @@ def greycomatrix(image, distances, angles, levels=256, symmetric=False, # make each GLMC symmetric if symmetric: - P += np.transpose(P, (1, 0, 2, 3)) + Pt = np.transpose(P, (1, 0, 2, 3)) + P = P + Pt + # normalize each GLMC if normed: