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

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

[Octave-bug-tracker] [bug #44309] gray2ind begins using uint16 too early


From: anonymous
Subject: [Octave-bug-tracker] [bug #44309] gray2ind begins using uint16 too early
Date: Thu, 19 Feb 2015 13:01:50 +0000
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?44309>

                 Summary: gray2ind begins using uint16 too early
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Do 19 Feb 2015 13:01:48 UTC
                Category: Libraries
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Klaus-Dieter Bauer
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

According to the documentation *gray2ind(grayscaleimage,N)* should return a
uint8 matrix for N<=256. It does however only do so for N<256: 

Source line 76 in scripts/image/gray2ind.m reads

  if (n < 256)
    I = uint8 (I);
  else
    I = uint16 (I);
  endif

where <= 256 should be. 

This also represents a matlab incompatibility, if matlab's documentation is
consistent with its behaviour. 

Minimal example:

  typeinfo(gray2ind([0.0 0.5 1.0],256))
  # Gives unit16 matrix, unit8 expected
  typeinfo(gray2ind([0.0 0.5 1.0],255))
  # Gives unit8 matrix, as expected





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44309>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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