[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help with histogram
From: |
Andy Buckle |
Subject: |
Re: help with histogram |
Date: |
Wed, 8 Jun 2011 12:33:56 +0100 |
On Wed, Jun 8, 2011 at 12:07 PM, plazajp <address@hidden> wrote:
> Hi everyone, I'm new using Octave and I have a problem. Maybe it's easy to
> solve, but I've been unable to do it!
>
> I need to show the histogram of an uint8 image ('im'), but octave only
> allows me to show it if the image type is changed to double. I don't want
> that, because I want every bin to be on the vector 1:256, not between 0 and
> 1. I've tried to do imhist (im), imhist(im, 1:256), and everything I've
> thought of and I haven't been able to get it. I suppose there has to be a
> way to do it, so I guess someone will be able to tell me where I'm failing.
>
> Thank you for the attention, and I hope someone can tell me the answer!
You can cast to double without renormalizing the range to be 0-1. I
don't understand.
im=floor(rand(16)*256);
hist(im(:), 1:256);
I guess you will need the first arg to hist to be a vector, hence the
(:). Is that what is throwing you?
--
/* andy buckle */