[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41240] image class is not preserved in cdata
From: |
Carnë Draug |
Subject: |
[Octave-bug-tracker] [bug #41240] image class is not preserved in cdata field of graphics handle |
Date: |
Wed, 15 Jan 2014 17:43:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131030 Firefox/17.0 Iceweasel/17.0.10 |
URL:
<http://savannah.gnu.org/bugs/?41240>
Summary: image class is not preserved in cdata field of
graphics handle
Project: GNU Octave
Submitted by: carandraug
Submitted on: Wed 15 Jan 2014 17:43:22 GMT
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Other
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.8.0
Operating System: Any
_______________________________________________________
Details:
The data of an image being plotted is kept in the field cdata, but the class
has changed. This is important because the class of an image changes how the
data is interpreted.
For example:
## image is uint8
img = repmat (uint8 (0:250), [200 1]);
h = imshow (img);
## image comes back as double
nimg = get (h, 'cdata');
class (nimg)
## note how changing class has a drastic effect on its representation
figure ();
imshow (nimg);
Note how the the same function, imshow, displays the image so differently. As
uint8, it's a gradient, as double, it's all white (since images of class
double should be on range [0 1]).
The effect this has on other functions is that it's not possible to retrieve
the image from a figure (required for things such as impixel and imcrop which
return parts from the current or a specified figure).
I looked at the other fields available from get() but didn't notice anything
that would point to the original class.
Also, this works in MatLab so it stacks as a matlab compatibility bug.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41240>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #41240] image class is not preserved in cdata field of graphics handle,
Carnë Draug <=