bugGNU Octave - Bugs: bug #44070, most colormaps return invalid...

 
 

bug #44070: most colormaps return invalid colormap when N is not class double

Submitted by:  Hartmut <hardy>
Submitted on:  Thu 22 Jan 2015 07:15:23 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 23 Jan 2015 04:49:11 PM UTC, comment #1:

The problem is in Octave. Most colormaps use N when calculating the colormap and preserve its class. In this case, N is being of class uint8, so you get a colormap of class uint8 and all values get truncated to 0 or 1. Also, a colormap must by definition be of class double.

This bug was present in the colormaps autumn, bone, cool, copper, cubehelix, gray, hsv, ocean, rainbow, spring, summer, and winter. I have fixed this in Octave by always casting to double. I also added a new test for all colormaps. See http://hg.savannah.gnu.org/hgweb/octave/rev/e8e3a89fa370

I applied a fix for image package anyway http://hg.code.sf.net/p/octave/image/rev/44eedba3a2e6 so it will work for older octave versions

This problem has been fixed in the development version. The fix
will be available in the next major software release. Thank you
for your bug report.

Carnë Draug <carandraug>
Project Member
Thu 22 Jan 2015 07:15:23 PM UTC, original submission:

The command label2rgb seems to works with some colormaps but not with others. Here is a short script to show the behavior:

Both colormaps are implemented, as you can see with

This is a behavior occures with Octave 3.8.2 and the current version 2.2.2 of the image package. (In my case under Linux, but I suspect it to be the same for all OS.)

It seems that the number of distinct values in the input variable "labeled" is relevant. And also the data type uint8 (which is the normal output data type of the "labelmatrix" command.)

Hartmut <hardy>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hardy (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 Jan 2015 04:49:11 PM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release3.8.2=>dev
      Summaryforge package "image": "label2rgb" works only with some colormaps=>most colormaps return invalid colormap when N is not class double

    Back to the top


    Powered by Savane 3.1-cleanup1