<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598</link>
    <title>MATLAB Central Newsreader - Detection of pixels</title>
    <description>Feed for thread: Detection of pixels</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 31 Oct 2007 21:29:09 -0400</pubDate>
      <title>Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399279</link>
      <author>Christian </author>
      <description>&lt;br&gt;
I have a picture in rgb corresponding to a map, this image&lt;br&gt;
contains a lake, and I need to separate the image of water&lt;br&gt;
from the rest of colors that presents the image, so as to&lt;br&gt;
obtain the number of pixels corresponding to water.&lt;br&gt;
&lt;br&gt;
Appreciate that someone might have an idea as I do not know&lt;br&gt;
how to begin.&lt;br&gt;
	&lt;br&gt;
		</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 01:08:40 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399303</link>
      <author>Pete </author>
      <description>Hi,&lt;br&gt;
Perhaps someone will give you a fuller answer, but in case they don't I will ask &lt;br&gt;
you 2 things:&lt;br&gt;
&amp;nbsp;- does you image contain flat colours, and so you just want to count the pixels &lt;br&gt;
which are a particular shade of blue, or is it more complicated than that (e.g. &lt;br&gt;
there are blue pixels which aren't part of the lake, or there are different shades &lt;br&gt;
of blue in the lake)?&lt;br&gt;
&amp;nbsp;- do you have the image processing toolbox?&lt;br&gt;
&lt;br&gt;
I wasn't sure if you meant a 'colourmap', or a map like you'd find in an atlas.</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 01:26:37 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399307</link>
      <author>Christian </author>
      <description>&quot;Christian &quot; &amp;lt;christian_zepeda_e@yahoo.com.ar&amp;gt; wrote in&lt;br&gt;
message &amp;lt;fgas35$dqm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a picture in rgb corresponding to a map, this image&lt;br&gt;
&amp;gt; contains a lake, and I need to separate the image of water&lt;br&gt;
&amp;gt; from the rest of colors that presents the image, so as to&lt;br&gt;
&amp;gt; obtain the number of pixels corresponding to water.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Appreciate that someone might have an idea as I do not know&lt;br&gt;
&amp;gt; how to begin.&lt;br&gt;
&amp;gt; 	&lt;br&gt;
&amp;gt; 	&lt;br&gt;
&lt;br&gt;
	&lt;br&gt;
The image is an image Lansat, &quot;.tif&quot; format, is rgb real&lt;br&gt;
color and well-defined sectors of water, so that certain&lt;br&gt;
colors necessarily represent levels of water, so it is&lt;br&gt;
necessary to define how many pixels represent this region of&lt;br&gt;
interest and this exactly represented by shades of blue hue.&lt;br&gt;
&lt;br&gt;
In my version I have installed the MATLAB toolbox processing&lt;br&gt;
images.&lt;br&gt;
&lt;br&gt;
A hug.&lt;br&gt;
&lt;br&gt;
Christian</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 01:28:36 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399308</link>
      <author>Christian </author>
      <description>&quot;Christian &quot; &amp;lt;christian_zepeda_e@yahoo.com.ar&amp;gt; wrote in&lt;br&gt;
message &amp;lt;fgas35$dqm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a picture in rgb corresponding to a map, this image&lt;br&gt;
&amp;gt; contains a lake, and I need to separate the image of water&lt;br&gt;
&amp;gt; from the rest of colors that presents the image, so as to&lt;br&gt;
&amp;gt; obtain the number of pixels corresponding to water.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Appreciate that someone might have an idea as I do not know&lt;br&gt;
&amp;gt; how to begin.&lt;br&gt;
&amp;gt; 	&lt;br&gt;
&amp;gt; 		&lt;br&gt;
&lt;br&gt;
The image is an image Lansat, &quot;.tif&quot; format, is rgb real&lt;br&gt;
color and well-defined sectors of water, so that certain&lt;br&gt;
colors necessarily represent levels of water, so it is&lt;br&gt;
necessary to define how many pixels represent this region of&lt;br&gt;
interest and this exactly represented by shades of blue hue.&lt;br&gt;
&lt;br&gt;
In my version I have installed the MATLAB toolbox processing&lt;br&gt;
images.&lt;br&gt;
&lt;br&gt;
A hug.&lt;br&gt;
&lt;br&gt;
Christian</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 01:31:11 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399309</link>
      <author>Christian </author>
      <description>&quot;Pete &quot; &amp;lt;pete.dot.bankhead@btinternet.dot.com&amp;gt; wrote in&lt;br&gt;
message &amp;lt;fgb8uo$jie$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; Perhaps someone will give you a fuller answer, but in case&lt;br&gt;
they don't I will ask &lt;br&gt;
&amp;gt; you 2 things:&lt;br&gt;
&amp;gt;  - does you image contain flat colours, and so you just&lt;br&gt;
want to count the pixels &lt;br&gt;
&amp;gt; which are a particular shade of blue, or is it more&lt;br&gt;
complicated than that (e.g. &lt;br&gt;
&amp;gt; there are blue pixels which aren't part of the lake, or&lt;br&gt;
there are different shades &lt;br&gt;
&amp;gt; of blue in the lake)?&lt;br&gt;
&amp;gt;  - do you have the image processing toolbox?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I wasn't sure if you meant a 'colourmap', or a map like&lt;br&gt;
you'd find in an atlas.&lt;br&gt;
&lt;br&gt;
The image is an image Lansat, &quot;.tif&quot; format, is rgb real&lt;br&gt;
color and well-defined sectors of water, so that certain&lt;br&gt;
colors necessarily represent levels of water, so it is&lt;br&gt;
necessary to define how many pixels represent this region of&lt;br&gt;
interest and this exactly represented by shades of blue hue.&lt;br&gt;
&lt;br&gt;
In my version I have installed the MATLAB toolbox processing&lt;br&gt;
images.&lt;br&gt;
&lt;br&gt;
A hug.&lt;br&gt;
&lt;br&gt;
Christian</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 02:46:55 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399323</link>
      <author>Pete </author>
      <description>Wow.  Three answers and three hugs.  I wasn't expecting that.&lt;br&gt;
&lt;br&gt;
I'd suggest looking at some of the colour image segmentation examples at &lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/products/image/demos.html&quot;&gt;http://www.mathworks.com/products/image/demos.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Also, as a very basic starting point you can open the image using IMTOOL in &lt;br&gt;
the image processing toolbox, e.g.&lt;br&gt;
imtool('landsat.tif', []);&lt;br&gt;
then move your cursor over the lakes.  In the bottom left corner of the &lt;br&gt;
window you should see &quot;Pixel info: (X, Y) [R G B]&quot; where X and Y are the cursor &lt;br&gt;
coordinates and R G B are the red, green and blue colour values respectively.  &lt;br&gt;
This will give you an idea of what RGB combinations you are trying to find.  &lt;br&gt;
The image itself will be stored as an (m x n x 3) array, where each m x n &lt;br&gt;
'plane' is for a different colour.  You can treat each of these as if they were &lt;br&gt;
separate greyscale images and threshold them or search for specific values &lt;br&gt;
etc.  If your problem isn't very hard you might not need much more than &lt;br&gt;
this.... but often these things are harder than that.&lt;br&gt;
&lt;br&gt;
In the end, you will probably want a binary image where the lake is white and &lt;br&gt;
everything else is black.  Then you can use BWAREA to get the area of the &lt;br&gt;
white bit, or a combination of BWLABEL and REGIONPROPS.&lt;br&gt;
&lt;br&gt;
Sorry, I'm not sure if you wanted a more or less complicated answer than that.&lt;br&gt;
MATLAB also has a &quot;Mapping toolbox&quot;, but I have no idea about this area so I &lt;br&gt;
don't know if it is relevant to this specific problem - &lt;a href=&quot;http://&quot;&gt;http://&lt;/a&gt;&lt;br&gt;
www.mathworks.com/products/mapping/&lt;br&gt;
Good luck anyway.</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 03:41:43 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399329</link>
      <author>Christian </author>
      <description>Thanks ... Try your way, I think will be useful.&lt;br&gt;
&lt;br&gt;
Christian</description>
    </item>
    <item>
      <pubDate>Thu, 01 Nov 2007 09:56:38 -0400</pubDate>
      <title>Re: Detection of pixels</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/158598#399369</link>
      <author>Dave Robinson</author>
      <description>&quot;Christian &quot; &amp;lt;christian_zepeda_e@yahoo.com.ar&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fgbhtn$12n$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thanks ... Try your way, I think will be useful.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Christian&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
You will almost certainly benefit from converting your rgb &lt;br&gt;
image into an intensity independent image (this is an image &lt;br&gt;
which only displays colour information, where the &lt;br&gt;
variations of illumination have been removed e.g. a pixel &lt;br&gt;
whose rgb values are 128 128 64 is the same colour as a &lt;br&gt;
pixel whose rgb values are 64 64 32 the difference is the &lt;br&gt;
second one is simply darker). &lt;br&gt;
&lt;br&gt;
There are several options open to you, for example &lt;br&gt;
&lt;br&gt;
1) Convert your image into HSV and set up your colour &lt;br&gt;
filter using the values taken from the HS planes, ignoring &lt;br&gt;
the V plane (i.e. you have a 2 plane image). &lt;br&gt;
&lt;br&gt;
2) Convert your image into normalized rgb. The &lt;br&gt;
approximation functions&lt;br&gt;
&amp;nbsp;&lt;br&gt;
Redness(r,g,b) = r/(r+g+b)&lt;br&gt;
Greenness(r,g,b) = g/(r+g+b)&lt;br&gt;
Blueness(r,g,b) = b/(r+g+b)&lt;br&gt;
&lt;br&gt;
applied to every image pixel will do the job.&lt;br&gt;
&lt;br&gt;
Then apply the techniques described by Pete should now &lt;br&gt;
perform substantially better.&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
&lt;br&gt;
Dave Robinson</description>
    </item>
  </channel>
</rss>

