Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!p4g2000vba.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: Thu, 11 Jun 2009 04:36:55 -0700 (PDT)
Organization: http://groups.google.com
Lines: 26
Message-ID: <83024988-b7a3-409e-b58c-19e769e51240@p4g2000vba.googlegroups.com>
References: <h0oll9$r0s$1@fred.mathworks.com> <c1d7887a-da8f-4521-baa5-9d764061ac5e@o36g2000vbi.googlegroups.com> 
	<97e3fbc1-db73-4c25-b961-c8771cef00fe@3g2000yqk.googlegroups.com>
NNTP-Posting-Host: 75.186.70.56
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1244720215 5150 127.0.0.1 (11 Jun 2009 11:36:55 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 11 Jun 2009 11:36:55 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: p4g2000vba.googlegroups.com; posting-host=75.186.70.56; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 
	3.5.30729),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:546517


Not sure I understand you Rune.  So your image contains 24 0's and one
1.  So you specify that you take a histogram with 4 bins (and you can
specify their positions if you want), and then the histogram function
will return a histogram that looks like
Bin(value)       # elements
0                        24
1                          1
2                          0
3                          0

Take this and divide by 25 and you'll get the area fractions
Bin (Value)            Area Fraction
0                         0.96
1                          0.04
2                             0
3                             0

At least that's how I'm thinking about it.  I still have questions
about when he talks about color, but even if it's a color image, you
could do color classification first to boil it down to a labeled image
that you could then take the histogram of.  Yes, the original post was
worded sort of strange and ambigously but I'm looking at the contour
drawing and area fraction determination as separate issues. (I mean,
who would really want the area of the colored contour line itself that
outlines the region - that's merely the perimeter (in pixels) of the
region?)