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

 
 

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

Submitted by:  None
Submitted on:  Wed Aug 28 15:06:37 2013  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.4
Operating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon Sep 9 10:55:26 2013, comment #3:

Thank you very much. I have pushed your changes

https://sourceforge.net/p/octave/image/ci/8ce08c719c08
https://sourceforge.net/p/octave/image/ci/92b6657505bb

Carnë Draug <carandraug>
Project Member
Sat Sep 7 23:18:51 2013, 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 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 Aug 28 17:13:06 2013, 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>
Project Member
Wed Aug 28 15:06:37 2013, 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 File(s):
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Sep 9 10:55:26 2013carandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sat Sep 7 23:18:51 2013bkurtzAttached File-=>Added imresize.cs, #29044
      Attached File-=>Added imresize_ceil.cs, #29045
    Wed Aug 28 15:08:48 2013rggjanCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup