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.
This commit is contained in:
emmanuelle
2011-12-08 21:53:31 +01:00
parent 0fa504f320
commit 2f3da9cc8f
+3 -1
View File
@@ -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: