octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56950] NaN/Inf values in ind2rgb


From: Guillaume
Subject: [Octave-bug-tracker] [bug #56950] NaN/Inf values in ind2rgb
Date: Wed, 25 Sep 2019 07:32:44 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

URL:
  <https://savannah.gnu.org/bugs/?56950>

                 Summary: NaN/Inf values in ind2rgb
                 Project: GNU Octave
            Submitted by: gyom
            Submitted on: Wed 25 Sep 2019 11:32:43 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

ind2rgb does not allow NaN/Inf values in the indexed image while Matlab
behaves as if they were equal to the maximal index according to the size of
the colormap.


>> rgb = ind2rgb ([NaN Inf 1], jet)
rgb(:,:,1) =
   0.500000000000000   0.500000000000000                   0
rgb(:,:,2) =
     0     0     0
rgb(:,:,3) =
                   0                   0   0.562500000000000


One possible fix would be to add the following before the input check:

if isfloat (x)
  x (isnan (x) | isinf (x)) = size (map, 1);
endif





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]