From 40402f78f6eda0712923d6628082c2b335300950 Mon Sep 17 00:00:00 2001 From: Shahbaz Khan Date: Wed, 16 Oct 2019 14:03:00 +0530 Subject: [PATCH] Fix px vector computation The paper mentions computation of px as 'summing the rows' of cmat (GLCM matrix) i.e sum of values in x (horizontal) direction, which in python corresponds to summation along axis=1; and py as sum of column values or sum of values in y (vertical) direction, which in Python corresponds to summation along axis=0. --- mahotas/features/texture.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mahotas/features/texture.py b/mahotas/features/texture.py index bac16fda..fb013cdf 100644 --- a/mahotas/features/texture.py +++ b/mahotas/features/texture.py @@ -271,8 +271,8 @@ def haralick_features(cmats, p = cmat / float(T) pravel = p.ravel() - px = p.sum(0) - py = p.sum(1) + px = p.sum(1) + py = p.sum(0) ux = np.dot(px, k) uy = np.dot(py, k)