octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39887] imresize (in image package) function b


From: Ben Kurtz
Subject: [Octave-bug-tracker] [bug #39887] imresize (in image package) function behaves differently from matlab version
Date: Sat, 07 Sep 2013 23:18:51 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1

Follow-up Comment #2, bug #39887 (project octave):

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)
    _______________________________________________________

Additional Item Attachment:

File name: imresize.cs                    Size:2 KB
File name: imresize_ceil.cs               Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39887>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]