[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41240] image class is not preserved in cdata
[Octave-bug-tracker] [bug #41240] image class is not preserved in cdata field of graphics handle
Wed, 15 Jan 2014 17:43:23 +0000
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131030 Firefox/17.0 Iceweasel/17.0.10
Summary: image class is not preserved in cdata field of
Project: GNU Octave
Submitted by: carandraug
Submitted on: Wed 15 Jan 2014 17:43:22 GMT
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Other
Assigned to: None
Discussion Lock: Any
Operating System: Any
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.
## image is uint8
img = repmat (uint8 (0:250), [200 1]);
h = imshow (img);
## image comes back as double
nimg = get (h, 'cdata');
## note how changing class has a drastic effect on its representation
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:
Message sent via/by Savannah
- [Octave-bug-tracker] [bug #41240] image class is not preserved in cdata field of graphics handle,
Carnë Draug <=