[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #56169] [octave forge] (image) images of class
[Octave-bug-tracker] [bug #56169] [octave forge] (image) images of class double or single fail to convert to class uint8
Sat, 3 Aug 2019 17:06:28 -0400 (EDT)
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Follow-up Comment #3, bug #56169 (project octave):
Theoretically, it would also be possible to use im2uint8 on a Lab input image,
but those Lab values should then also be scaled to be in the range 0..1 if
using the double data type.
The help text of im2double mentiones this (and it is Matlab compatible):
'double or single'
Values are truncated to the interval [0 1] and then rescaled
to the range of values of the int16 class [0 255].
(By the way, it should proabably read "uint8 class" here, and not "uint16".
Maybe we could fix this typo on this occasion.)
So if you really want to tranform a Lab image (of signed values between
roughly -100 and 100, as output by rgb2lab) into a uint8 datatype (with
integers between 0 and 127), then you should first figure out a (meaningful)
definition of what you mean by this, without loosing too much information on
the way. And afterwards just do this transformation "by hand", it shouldn't be
more than one addition and one multiplication. Sorry, there is no predifined
function for this in Octave (nor in Matlab, I think).
Reply to this item at:
Message sent via Savannah