octave-maintainers
[Top][All Lists]
Advanced

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

Re: type handling bug?


From: Jaroslav Hajek
Subject: Re: type handling bug?
Date: Tue, 26 May 2009 13:53:49 +0200

On Tue, May 26, 2009 at 1:02 PM, Levente Torok <address@hidden> wrote:
> HI Soren,
>
> Thanks for the quick response.
> This behaviour may be questionable.
> It modifies my data hiddenly(!) for the expense of some memory saving.
>
> Unfortunately my example contains a reference to another bug (or bug-like)
> finding as well
> and I found no solution to this yet.
>
> im =imread("p1020037.jpg" );
> octave:10> sum(sum(im==0))
> ans = 16980
>
> z=resize( im, s=rows(im)*columns(im),1 );
> octave:11> sum(sum(z==0))
> ans = 3144192
>
> Levente
>

As Soren said, if your image is RGB, you get an MxNx3 array in im.
The resize call is almost certainly not doing what you meant. resize
is very different from reshape (yes, the description for resize is
poor in 3.0.x).

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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