bugGNU Octave - Bugs: bug #46745, [octave forge] (image) imresize...

 
 

bug #46745: [octave forge] (image) imresize default method (bicubic) Matlab incompatible for the border pixels

Submitter:  None
Submitted:  Tue 22 Dec 2015 08:18:55 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 21 Aug 2022 09:04:52 PM UTC, comment #4: 

After all the improvements in imresize (see bug #60322), this bug seems to be resolved.

For the code from comment #2,
Matlab results is:
max = 1.1014
min = -0.0361
while Octave result is
max = 1.1038
min = -0.036158

Not bit-exact, but close enough to close this report.

Avinoam Kalma <avinoam>
Group Member
Mon 08 Feb 2016 12:35:59 AM UTC, comment #3: 

Keeping this bug open for the Matlab incompatibility of padding before resize. I'm not sure what Matlab is doing and it is not documented.

Carnë Draug <carandraug>
Group Member
Thu 24 Dec 2015 06:36:31 PM UTC, comment #2: 

With the report as it is, the function seems to behave as expected. Since the image has values outside the [0 1] range, it is even of an integer class, and the function is supposed to return a function of the same class as input, the output image should also have values outside the [0 1] range.

I then tested after converting the image to class double (with im2double):


octave> im = imread ('Example.png');
octave> im = im2double (im);
octave> imr = imresize (im, [512 512]);
octave> max (imr(:))
ans =  1.2466
octave> min (imr(:))
ans = -0.20069


However, this is an artifact of the resizing and only happens on the borders. I got it tested on Matlab and apparently Matlab also returns values outside [0 1]. They do return different values so I'm guessing they perform some special padding before interpolation.

Carnë Draug <carandraug>
Group Member
Thu 24 Dec 2015 04:50:42 AM UTC, comment #1: 

imresize belongs to the image package from Octave-Forge.  Re-classifying bug.

The original reporter might want to post what version of the image package you are using since that will make more of a difference then the Octave version.

Rik <rik5>
Group administrator
Tue 22 Dec 2015 08:18:55 AM UTC, original submission:  

I have noticed then while input image has black frame around it,
the resize function may return values out of the range of [0,1].

try on this image the code:

im=imread('example image.png');
imRes=imresizr(im,[512,512]);
min(imRes(:))
max(imRes(:))

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #35832:  Example image.png added by None (155KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by jwe (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-08-21 avinoam StatusNone Fixed
        Open/ClosedOpen Closed
        Operating SystemGNU/Linux Any
        Carbon-Copy- Added carandraug
        Carbon-Copy- Added hardy
    2017-08-13 jwe Summaryimage package: imresize default method (bicubic) Matlab incompatible for the border pixels [octave forge] (image) imresize default method (bicubic) Matlab incompatible for the border pixels
    2015-12-24 carandraug Item GroupIncorrect Result Matlab Compatibility
    2015-12-24 carandraug Release3.8.1 other
        Summaryimresize default method (bicubic) return &lt;0 and &gt;1 values image package: imresize default method (bicubic) Matlab incompatible for the border pixels
    2015-12-24 rik5 Carbon-CopyRemoved 72865 -
    2015-12-24 rik5 CategoryOctave Function Octave Package
        Summaryimresize defoult method (bicubic) return &lt;0 and &gt;1 values imresize default method (bicubic) return <0 and >1 values
    2015-12-22 None Attached File- Added Example image.png, #35832

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code