<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Using ismember with the output of regionprops</title>
	<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/</link>
	<description>Steve Eddins manages the Image &#38; Geospatial development team at &#60;a href="http://www.mathworks.com/"&#62;The MathWorks&#60;/a&#62; and coauthored &#60;a href="http://www.mathworks.com/support/books/book5291.html?category=-1&#38;language=-1"&#62;Digital Image Processing Using MATLAB&#60;/a&#62;. He writes here about image processing concepts, algorithm implementations, and MATLAB.&#60;br&#62;&#60;br&#62;&#60;img&#62;</description>
	<pubDate>Mon, 23 Nov 2009 01:03:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21999</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 24 Jul 2009 00:34:48 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21999</guid>
		<description>Ayrton&#8212;"foo" is just a fieldname I made up in order to illustrate the comma-separated list syntax.</description>
		<content:encoded><![CDATA[<p>Ayrton&mdash;&#8221;foo&#8221; is just a fieldname I made up in order to illustrate the comma-separated list syntax.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayrton</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21987</link>
		<dc:creator>Ayrton</dc:creator>
		<pubDate>Tue, 21 Jul 2009 11:00:38 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21987</guid>
		<description>what is foo? 
and what would it be on my script?</description>
		<content:encoded><![CDATA[<p>what is foo?<br />
and what would it be on my script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21983</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 20 Jul 2009 13:42:18 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21983</guid>
		<description>Prashanth&#8212;If you have a relatively recent version of the Image Processing Toolbox, you can pass in your gray scale image as the second argument to &lt;tt&gt;regionprops&lt;/tt&gt; and compute the &lt;tt&gt;'MeanIntensity'&lt;/tt&gt; measurement.</description>
		<content:encoded><![CDATA[<p>Prashanth&mdash;If you have a relatively recent version of the Image Processing Toolbox, you can pass in your gray scale image as the second argument to <tt>regionprops</tt> and compute the <tt>&#8216;MeanIntensity&#8217;</tt> measurement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prashanth</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21978</link>
		<dc:creator>prashanth</dc:creator>
		<pubDate>Fri, 17 Jul 2009 19:23:18 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21978</guid>
		<description>hello steve. I have been doing image procesing for retinal images for past 2 months. I have segmented some required portions from the image.These are gray scale images. now how can i use 'regionprops' for computing the mean intensity of the segmented region in the gray scale image. Pls help.</description>
		<content:encoded><![CDATA[<p>hello steve. I have been doing image procesing for retinal images for past 2 months. I have segmented some required portions from the image.These are gray scale images. now how can i use &#8216;regionprops&#8217; for computing the mean intensity of the segmented region in the gray scale image. Pls help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21906</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 23 Jun 2009 21:01:57 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21906</guid>
		<description>Yuan-Liang&#8212;1. I can't explain formulas that appear in unspecified wikipedia pages or other sources, and "orientation of a shape" is a phrase that needs a more specific definition.  Our code is computing the orientation of the ellipse that has the same normalized 2nd-order moments as the shape in question, and the equations for that come from Haralick and Shapiro, Computer and Robot Vision vol I, Addison-Wesley 1992, Appendix A.  2. I feel no particular need to rederive the Haralick equations at the moment, especially since I just did a spot-check of regionprops using line segments at various angles, and regionprops is returning accurate answers. 3. These formulas are for flat shapes only, so they would not apply directly to grayscale images. 4. Does the code comment not supply sufficient information about where the 1/12 term comes from?</description>
		<content:encoded><![CDATA[<p>Yuan-Liang&mdash;1. I can&#8217;t explain formulas that appear in unspecified wikipedia pages or other sources, and &#8220;orientation of a shape&#8221; is a phrase that needs a more specific definition.  Our code is computing the orientation of the ellipse that has the same normalized 2nd-order moments as the shape in question, and the equations for that come from Haralick and Shapiro, Computer and Robot Vision vol I, Addison-Wesley 1992, Appendix A.  2. I feel no particular need to rederive the Haralick equations at the moment, especially since I just did a spot-check of regionprops using line segments at various angles, and regionprops is returning accurate answers. 3. These formulas are for flat shapes only, so they would not apply directly to grayscale images. 4. Does the code comment not supply sufficient information about where the 1/12 term comes from?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuan-Liang Tang</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21897</link>
		<dc:creator>Yuan-Liang Tang</dc:creator>
		<pubDate>Fri, 19 Jun 2009 03:17:45 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21897</guid>
		<description>Steve,
  I have another question about 'regionprops', and hope that you may shed some light on it. Thanks in advance.

I have been working on calculating the orientation of an image shape based on moments. Here are my questions:

1. From wikipedia and other sources, the orientation of a shape is computed by:

orientation = 0.5*atan(2*u11/(u20-u02))*180/pi,

where u11, u20, and u02 are second order central moments.


2. But the code in the matlab function 'regionprops' is (uxx, uyy, and uxy are actually u20, u02, and u11, respectively):
------------------------
&lt;pre&gt;
if (uyy &#62; uxx)
  num = uyy - uxx + sqrt((uyy - uxx)^2 + 4*uxy^2);
  den = 2*uxy;
else
  num = 2*uxy;
  den = uxx - uyy + sqrt((uxx - uyy)^2 + 4*uxy^2);
end
if (num == 0) &#38;&#38; (den == 0)
  stats(k).Orientation = 0;
else
  stats(k).Orientation = (180/pi) * atan(num/den);
end
&lt;/pre&gt;
-----------------------
Why is the formula different from what is described in wikipedia (the additional 'sqrt' term)?

3. Does the above calculations about image orientations apply both to binary and grayscale images? For grayscale images, the shape would be the whole image.

4. Also, regionprops calculates the second momemts as follows. Would you please explain what the term '1/12' means. Is it still necessary if we are dealing with grayscale images?
---------------------------
&lt;pre&gt;
% Calculate normalized second central moments for the region. 1/12 is
% the normalized second central moment of a pixel with unit length.
uxx = sum(x.^2)/N + 1/12;
uyy = sum(y.^2)/N + 1/12;
uxy = sum(x.*y)/N;
&lt;/pre&gt;
---------------------------

Thanks again.</description>
		<content:encoded><![CDATA[<p>Steve,<br />
  I have another question about &#8216;regionprops&#8217;, and hope that you may shed some light on it. Thanks in advance.</p>
<p>I have been working on calculating the orientation of an image shape based on moments. Here are my questions:</p>
<p>1. From wikipedia and other sources, the orientation of a shape is computed by:</p>
<p>orientation = 0.5*atan(2*u11/(u20-u02))*180/pi,</p>
<p>where u11, u20, and u02 are second order central moments.</p>
<p>2. But the code in the matlab function &#8216;regionprops&#8217; is (uxx, uyy, and uxy are actually u20, u02, and u11, respectively):<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre>
if (uyy &gt; uxx)
  num = uyy - uxx + sqrt((uyy - uxx)^2 + 4*uxy^2);
  den = 2*uxy;
else
  num = 2*uxy;
  den = uxx - uyy + sqrt((uxx - uyy)^2 + 4*uxy^2);
end
if (num == 0) &amp;&amp; (den == 0)
  stats(k).Orientation = 0;
else
  stats(k).Orientation = (180/pi) * atan(num/den);
end
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Why is the formula different from what is described in wikipedia (the additional &#8217;sqrt&#8217; term)?</p>
<p>3. Does the above calculations about image orientations apply both to binary and grayscale images? For grayscale images, the shape would be the whole image.</p>
<p>4. Also, regionprops calculates the second momemts as follows. Would you please explain what the term &#8216;1/12&#8242; means. Is it still necessary if we are dealing with grayscale images?<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre>
% Calculate normalized second central moments for the region. 1/12 is
% the normalized second central moment of a pixel with unit length.
uxx = sum(x.^2)/N + 1/12;
uyy = sum(y.^2)/N + 1/12;
uxy = sum(x.*y)/N;
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21841</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 08 Jun 2009 16:23:56 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21841</guid>
		<description>Koen&#8212;The k-th element of the output of regionprops corresponds to the object labeled the value k in the output of bwlabel.  In other words:

&lt;pre&gt;
s = regionprops(L);
s(10)   % measurements for the object L==10
&lt;/pre&gt;

Does that help?</description>
		<content:encoded><![CDATA[<p>Koen&mdash;The k-th element of the output of regionprops corresponds to the object labeled the value k in the output of bwlabel.  In other words:</p>
<pre>
s = regionprops(L);
s(10)   % measurements for the object L==10
</pre>
<p>Does that help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Koen</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21840</link>
		<dc:creator>Koen</dc:creator>
		<pubDate>Mon, 08 Jun 2009 16:02:30 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21840</guid>
		<description>I'm wondering if there is an easy way to substitute a certain regionprops characteristic with the numbered labels as produced by bwlabel.

This would be a standard reclassification in GIS terms, where you replace the patch number by the characteristics associated with the patch. However I don't seem to find a numbered value in the regionprops output that binds it to the bwlabel output. Although it should be possible as you produce a selected image using ismember().

Any solutions here?</description>
		<content:encoded><![CDATA[<p>I&#8217;m wondering if there is an easy way to substitute a certain regionprops characteristic with the numbered labels as produced by bwlabel.</p>
<p>This would be a standard reclassification in GIS terms, where you replace the patch number by the characteristics associated with the patch. However I don&#8217;t seem to find a numbered value in the regionprops output that binds it to the bwlabel output. Although it should be possible as you produce a selected image using ismember().</p>
<p>Any solutions here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21732</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 04 May 2009 19:58:52 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21732</guid>
		<description>Mix&#8212;Use the BoundingBox property to determine where the object is located in the original image.</description>
		<content:encoded><![CDATA[<p>Mix&mdash;Use the BoundingBox property to determine where the object is located in the original image.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mix</title>
		<link>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21731</link>
		<dc:creator>mix</dc:creator>
		<pubDate>Mon, 04 May 2009 19:17:51 +0000</pubDate>
		<guid>http://blogs.mathworks.com/steve/2009/02/27/using-ismember-with-the-output-of-regionprops/#comment-21731</guid>
		<description>i was wonder when i recieve the stats.Image  , it is smaller from the original  image how i can set it in the original image size?</description>
		<content:encoded><![CDATA[<p>i was wonder when i recieve the stats.Image  , it is smaller from the original  image how i can set it in the original image size?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
