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 28 Aug 2013 03:06:37 PM UTC  
 
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 09 Sep 2013 10:55:26 AM UTC, 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 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 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>
Project 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 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 09 Sep 2013 10:55:26 AM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sat 07 Sep 2013 11:18:51 PM UTCbkurtzAttached File-=>Added imresize.cs, #29044
      Attached File-=>Added imresize_ceil.cs, #29045
    Wed 28 Aug 2013 03:08:48 PM UTCrggjanCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup