scikit-image/scikit-image — pull request #914 by marianapbento (2014-03-11 13:07:49+00:00)
Title: Update _texture.pyx

In function skimage.feature.texture.greycomatrix, I think I detected a bug. For instance, when using the angle 3*pi/4, and distance 1 in line 58, the expected answer would be col = c-1. But the code answer is col = c,

since (cos(3*pi/4)*1+0.5) = (-0.7+0.5) = (-0.2) = 0

So, the computed matrix using angle 3*pi/4 or pi/2 achieves the same results.

Besides, when using larger distances, such as distance = 4 and angle = PI/4
row = r + round(sin(angle) * distance + 0.5) = round(0.7*4+0.5) = 3 (should be 4)
col = c + round(cos(angle) * distance + 0.5) = round(0.7*4+0.5) = 3 (should be 4)

A possible solution would be:
row = r + round(sin(angle)) * distance
col = c + round(cos(angle)) * distance