Path: news.mathworks.com!not-for-mail
From: "Hooman " <hoomanp@rci.rutgers.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Please Help, How to calculate the area percentage of each color
Date: Wed, 10 Jun 2009 21:57:01 +0000 (UTC)
Organization: Rutgers University
Lines: 25
Message-ID: <h0pa7d$bcf$1@fred.mathworks.com>
References: <h0oll9$r0s$1@fred.mathworks.com> <c1d7887a-da8f-4521-baa5-9d764061ac5e@o36g2000vbi.googlegroups.com>
Reply-To: "Hooman " <hoomanp@rci.rutgers.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244671021 11663 172.30.248.38 (10 Jun 2009 21:57:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 10 Jun 2009 21:57:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1723265
Xref: news.mathworks.com comp.soft-sys.matlab:546365


ImageAnalyst <imageanalyst@mailinator.com> wrote in message <c1d7887a-da8f-4521-baa5-9d764061ac5e@o36g2000vbi.googlegroups.com>...
> On Jun 10, 12:06?pm, "Hooman " <hoom...@rci.rutgers.edu> wrote:
> > Hello all,
> > have a rectangular m by n matrix of points and based on a simple function I want to make a contour map with it. but additional to that I also want to know what is the percentage of area of each color in my contour map, (assume I have only four colors).
> >
> > can anyone help me with this?
> 
> ----------------------------------------------------------------------------------------------------
> You can take the histogram of your array to get the area fractions
> between certain numerical levels.  For example, if your array goes
> from 0-1000 and you have contours every 100, then you can get a
> histogram with 10 bins.  The number in each bin divided by the number
> of pixels in the image is the area fraction of each numerical value
> range ("colors" as you call them).  So I could say that
> 0-100 has 23% (or whatever) of the area
> 101-200 has 15% (or whatever) of the area
> 201-300 has 8% (or whatever) of the area
> 301-400 has 19% (or whatever) of the area
> etc.

First of all thanks for your reply.
could you be more specific, since I have never used the histogram I am not sure how to use it.
It would be perfect if you tell me what should I do in a more basic way or tell me which part of Matlab help should I read to get this.

Thanks alot