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

 
 

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

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

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

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>
Project 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>
Project 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>
Project 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 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 project members can vote.

     

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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 <0 and >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 Forge Package
        Summaryimresize defoult method (bicubic) return <0 and >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.9