imresize incorrectly clips output to [0,1]
Søren Hauberg
soren at hauberg.org
Fri Apr 3 13:05:15 CDT 2009
Hi
The 'imresize' function is part of the 'image' package, so in general
bug reports should go to the octave-forge list.
> The function imresize(img, [w h], interp), when using double input,
> incorrectly clips its output to the range [0,1].
This is done by the 'imremap' function. The reason is that some
interpolation methods (e.g. bicubic) can overshoot. That is, if your
input image is in the range [0, 1], then the output can have values
outside this range. When an image is represented as doubles it is
supposed to have values in [0, 1]. So, 'imremap' (and hence 'imresize')
can create something that is not a 'proper' image when the input is one.
That being said, I agree that many image processing functions work on
data that isn't 'proper' images. I also work on images with non-standard
ranges, so I can understand the motivation for not wanting the data to
be cropped.
What would be the proper behaviour? Should we just remove the cropping
and accept that overshooting can occur? Should we rescale the output
such that it is in the same range as the input?
Søren
More information about the Bug-octave
mailing list