Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!o36g2000vbi.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Please Help, How to calculate the area percentage of each color 
	in a contour map?
Date: Wed, 10 Jun 2009 13:35:57 -0700 (PDT)
Organization: http://groups.google.com
Lines: 22
Message-ID: <c1d7887a-da8f-4521-baa5-9d764061ac5e@o36g2000vbi.googlegroups.com>
References: <h0oll9$r0s$1@fred.mathworks.com>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1244666157 28445 127.0.0.1 (10 Jun 2009 20:35:57 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 10 Jun 2009 20:35:57 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: o36g2000vbi.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
Xref: news.mathworks.com comp.soft-sys.matlab:546336


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.