[bug #67905] [image] graycomatrix does not handle NaN consistently and correctly

Avinoam Kalma <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Update of bug #67905 (group octave):

                 Release:                  10.3.0 => other
                 Summary: [image] graycomatrix does not handle NaN
consistently.   => [image] graycomatrix does not handle NaN consistently and
correctly

    _______________________________________________________

Follow-up Comment #10:

According to MATLAB documentation, graycomatrix ignores NaN values, replaces
+Infs with the value NumLevels, and replaces -Infs with the value 1.

I have checked the example on Windows.
1. With 'use_oct' = true, there is no error message, but the result is wrong.
Should be:

>> [glcm,SI] = graycomatrix(I)

glcm =

   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   7

SI =

     8     8     8     8     8
     8     8     8     8   NaN

glcm(8,1) should be 0 and not 1.

2. With 'use_oct' = False we get an error message

In any case we need a special treatment for the case of NaN values. Maybe some
masking should be done.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67905>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaY+HZQAKCRCqLAuaBUf3
TrMhAP9B5GXTUSU2P21xlagASwXkG+9ZrfFFJvLJlEeDPdqQKQD+J8xG9gpXFlHC
panbDS+Lc6XYh/rCFzXyijJUsaAzeAo=
=36kI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.