bugGNU Octave - Bugs: bug #39887, imresize (in image package)...

 
 

bug #39887: imresize (in image package) function behaves differently from matlab version

Submitter:  None
Submitted:  Wed 28 Aug 2013 03:06:37 PM 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:  * 3.6.4
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 09 Sep 2013 10:55:26 AM UTC, comment #3: 
Carnë Draug <carandraug>
Group Member
Sat 07 Sep 2013 11:18:51 PM UTC, comment #2: 

I'm not the original reporter, but it seemed so easy I went ahead and made a changeset for you (see attached).

While I was testing this however, I noticed that we actually get different behavior from MATLAB when passing fractional sizes.  For example, say I do:

in = uint8(rand(3,8)*10);
imresize(in, 1.001);


In octave, we round the target size, and end up with a 3x8 result.  MATLAB seems to do a ceil() on the target size instead, because there the result is 4x9.

I also attached a second changeset that (when applied after the first one) fixes that problem too.  Maybe a second bug report would have been better, but since the changesets are intertwined, this seems more logical.

(file #29044, file #29045)

Ben Kurtz <bkurtz>
Wed 28 Aug 2013 05:13:06 PM UTC, comment #1: 

That should be easy to fix. Could you prepare a changeset for that? The repository for the image package is at https://sourceforge.net/p/octave/image/

Carnë Draug <carandraug>
Group Member
Wed 28 Aug 2013 03:06:37 PM UTC, original submission:  

When doing

imresize(img, [400, NaN])

in matlab, it resizes the image "img" to a height of 400 and a width that is proportional to the image before. Doing the same in octave results in an image of size (400, 1)

See also the matlab documentation when giving "NaN" for width or height:

http://www.mathworks.ch/ch/help/images/ref/imresize.html

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #29044:  imresize.cs added by bkurtz (3KiB - application/octet-stream)
file #29045:  imresize_ceil.cs added by bkurtz (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bkurtz (Updated the item)
  • -email is unavailable- added by rggjan
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-09 carandraug StatusNone Fixed
        Open/ClosedOpen Closed
    2013-09-07 bkurtz Attached File- Added imresize.cs, #29044
        Attached File- Added imresize_ceil.cs, #29045
    2013-08-28 rggjan Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code