[Top][All Lists]

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

[Octave-bug-tracker] [bug #41851] ind2rgb tests

From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #41851] ind2rgb tests
Date: Thu, 13 Mar 2014 23:03:55 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20140207 Firefox/24.0 Iceweasel/24.3.0

Update of bug #41851 (project octave):

                  Status:                    None => Invalid                


Follow-up Comment #4:

I second Rik's opinion.

Ignoring the case of the class explanation, you will notice that in your
example, the indexed image has indices with a value of "zero" and "one" (the
first and third row of the first column). From your example, it seems that
Matlab assigns the same colour to both of them. How come two different indices
give the same colour when there's no repeated colours in the colormap?

This is yet another case where Matlab returns rubbish due to improper input
check. A matrix of class double is only an indexed image if all values are
positive integers. Rather than returning a wrong answer, Octave gives an
error. That sounds right to me so I'm marking this as invalid.

Another suggestion. Instead of using

img_double = double (img) + 1;

I'll instead recommend to use the image package which has a set of functions
meant to convert an image between different types. If they are indexed, you
can do

im2double (img, "indexed")

which handles all the details for you.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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