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 15:05:00 +0200

On Tue, May 26, 2009 at 2:47 PM, John W. Eaton <address@hidden> wrote:
> On 26-May-2009, Levente Torok wrote:
>
> | > > 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
> | >
> | > My guess is that you image is an RGB image (all JPEG's are RGB, right?).
> | > This makes the image NxMx3, but you're treating it as being MxN. But I'm
> | > just guessing here.
> |  Wrong.
> |
> | octave:17> size(im)
> | ans =
> |
> |    1536   2048
> |
> | Instead of
> | octave:18> size(im)
> | ans =
> |
> |    1536   2048      3
> |
> | Other ideas?
>
> Yes.  As mentioned earlier, resize is probably not the function you
> are looking for because it changes the size without preserving the
> data.

To put it precisely, it only preserves that part of the data that is
common to both the old and new dimensions.
The rest is filled with zeros or dropped.

cheers

-- 
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]