bugGNU Octave - Bugs: bug #44309, gray2ind begins using uint16 too...

 
 

bug #44309: gray2ind begins using uint16 too early

Submitter:  None
Submitted:  Thu 19 Feb 2015 01:01:48 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Klaus-Dieter Bauer Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.2
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 19 Feb 2015 02:40:04 PM UTC, comment #1: 

Thank you for the bug report. I fixed it as proposed and added more tests. See

http://hg.savannah.gnu.org/hgweb/octave/rev/70911df8ad28

Carnë Draug <carandraug>
Group Member
Thu 19 Feb 2015 01:01:48 PM UTC, original submission:  

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


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-19 carandraug StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code