actually,

since 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)

so if using
row = r + round(sin(angle)) * distance
col = c + round(cos(angle)) * distance

we got the expected result.





2014-03-11 10:17 GMT-03:00 Johannes Schönberger <notifications@github.com>:

> In skimage/feature/_texture.pyx:
>
> > @@ -48,8 +48,8 @@ def _glcm_loop(cnp.uint8_t[:, ::1] image, double[:] distances,
> >                      i = image[r, c]
> >
> >                      # compute the location of the offset pixel
> > -                    row = r + <int>(sin(angle) * distance + 0.5)
> > -                    col = c + <int>(cos(angle) * distance + 0.5)
> > +                    row = r + np.round(sin(angle)) * distance
>
> You probably meant to do np.round(sin(angle) * distance) and not np.round(sin(angle))
> * distance...
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/scikit-image/scikit-image/pull/914/files#r10471885>
> .
>