[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with imresize keeping aspect ratio
From: |
inor0627 |
Subject: |
problem with imresize keeping aspect ratio |
Date: |
Tue, 4 Feb 2014 02:06:46 -0800 (PST) |
Hello,
I'm trying to resize an image using imresize and want to keep the aspect
ratio.
The function reference for using imresize(im, [M N]) says:
"If M or N is NaN, it will be determined automatically so as to preserve
aspect ratio."
So when doing
A = ones(8,6);
B = imresize(A,[4 NaN]);
I'm expecting B to be 4x3. But in fact B is 4x1.
Can you please tell me where's my missunderstanding?
Currently I'm using the workaround
col=4;
C = imresize(A , [col round(col*size(A,2)/size(A,1)) ] );
which acts as expected. But I want to do it the right way :-)
I'm using Octave-3.6.4-mingw with Octave3.6.4_gcc4.6.2_pkgs.
Thank you,
Ingo
--
View this message in context:
http://octave.1599824.n4.nabble.com/problem-with-imresize-keeping-aspect-ratio-tp4661613.html
Sent from the Octave - General mailing list archive at Nabble.com.
- problem with imresize keeping aspect ratio,
inor0627 <=