Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when creating symmetrical GLCM #261

Merged
merged 2 commits into from Jun 1, 2017

Commits on May 30, 2017

  1. BUG: Fix symmetrical GLCM

    To make GLCM symmetrical, the python code performed an inplace addition: `P_glcm += numpy.transpose(P_glcm, (1, 0, 2))`. However, when the matrix exceeds a certain size, this produces buggy behaviour, where for some elements, the calculated value equals `P_glcm += P_glcm + numpy.transpose(P_glcm, (1, 0, 2))`. This is caused by the fact that numpy.transpose returns a *view*, and not a copy of the array. Then, if the additions have to be processed in multiple chunks, the addition will become erroneous.
    
    Use `numpy.copy` to get a transposed copy of the GLCM and not just a view of the GLCM.
    JoostJM committed May 30, 2017
    Copy the full SHA
    d8032f3 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2017

  1. Copy the full SHA
    9aa8c01 View commit details
    Browse the repository at this point in the history