[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40664] Inconsistent handling of N-dimensional
From: |
Adam H Aitkenhead |
Subject: |
[Octave-bug-tracker] [bug #40664] Inconsistent handling of N-dimensional RGB images |
Date: |
Thu, 21 Nov 2013 21:24:27 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/30.0.1599.114 Chrome/30.0.1599.114 Safari/537.36 |
Follow-up Comment #1, bug #40664 (project octave):
(The example code seems to have gone missing below. I think I messed up using
verbatim... Here it is again.)
This patch makes ind2rgb and rgb2ind reversible for ND arrays - see the
example below for a 4D test RGB image of size 4x5x6x7, with the RGB channels
in the third dimension:
test = rand(4,5,3,6,7);
[x,m] = rgb2ind(test);
rgb = ind2rgb(x,m);
isequal(test,rgb)
ans = 1
whos
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x1 1 logical
m 840x3 20160 double
rgb 4x5x3x6x7 20160 double
test 4x5x3x6x7 20160 double
x 4x5x6x7 1680 uint16
Also, there's an old discussion of this on the mailing list at:
http://octave.1599824.n4.nabble.com/ind2rgb-problem-td4653534.html#a4659386
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40664>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #40664] Inconsistent handling of N-dimensional RGB images,
Adam H Aitkenhead <=