help-octave
[Top][All Lists]
Advanced

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

Re: the number of bits of an image read with imread


From: Eric Nowak
Subject: Re: the number of bits of an image read with imread
Date: Wed, 6 Dec 2006 11:30:47 +0100

On 12/5/06, Søren Hauberg <address@hidden> wrote:
I'd use the class function:
   is8bits  = strcmp(class(im), "uint8");
   is16bits = strcmp(class(im), "uint16");

Søren


Hi Soren,
The class function returns neither uint8 nor uint16 but double.
I am using octave version 2.1.64
Eric

octave:38> X=imread("/tmp/im.png");
octave:39> X(1:5,1:5)
ans =

  122  118  117  116  114
  115  114  115  119  114
  121  118  117  116  114
  120  119  115  113  111
  115  116  117  111  111

octave:40> class(X)
ans = double
octave:41> class(X(1,1))
ans = double



reply via email to

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