<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: POLY2MASK and ROIPOLY &#8211; Part 1</title>
	<atom:link href="http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/</link>
	<description>Steve Eddins manages the Image &#38; Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.</description>
	<lastBuildDate>Sat, 11 Feb 2012 18:27:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Steve Eddins</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-24733</link>
		<dc:creator>Steve Eddins</dc:creator>
		<pubDate>Fri, 09 Dec 2011 18:18:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-24733</guid>
		<description>Leo&#8212;Call roipoly twice.</description>
		<content:encoded><![CDATA[<p>Leo&mdash;Call roipoly twice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-24732</link>
		<dc:creator>Leo</dc:creator>
		<pubDate>Fri, 09 Dec 2011 16:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-24732</guid>
		<description>Hi Steve,
How can I specify more than one polygon (not connected) on the same image using roipoly? For example, I want to create a mask for two distant apples on a tree.
Any suggestions?</description>
		<content:encoded><![CDATA[<p>Hi Steve,<br />
How can I specify more than one polygon (not connected) on the same image using roipoly? For example, I want to create a mask for two distant apples on a tree.<br />
Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-24461</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 06 Sep 2011 21:12:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-24461</guid>
		<description>Jeremy&#8212;The answer is in the doc, which gives the following as the syntax for poly2mask:

&lt;pre class=&quot;code&quot;&gt;
bw = poly2mask(x, y, m, n)
&lt;/pre&gt;

and says that m is the number of rows and n is the number of columns. So your first call to poly2mask is incorrect.

Perhaps I shouldn&#039;t have designed it that way. But I did.</description>
		<content:encoded><![CDATA[<p>Jeremy&mdash;The answer is in the doc, which gives the following as the syntax for poly2mask:</p>
<pre class="code">
bw = poly2mask(x, y, m, n)
</pre>
<p>and says that m is the number of rows and n is the number of columns. So your first call to poly2mask is incorrect.</p>
<p>Perhaps I shouldn&#8217;t have designed it that way. But I did.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Heil</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-24460</link>
		<dc:creator>Jeremy Heil</dc:creator>
		<pubDate>Tue, 06 Sep 2011 19:43:46 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-24460</guid>
		<description>Why does this code (which I think is syntactically intuitive) seems to swap the xdim and ydim when it generates the output.
&lt;pre&gt;
xpts=[ 1 3 3 1];
ypts=[4 4 8 8];
xdim=6;
ydim=10;

poly2mask( xpts, ypts, xdim, ydim )
&lt;/pre&gt;
while  
&lt;pre&gt;
poly2mask( xpts, ypts, ydim, xdim )
&lt;/pre&gt;
gets the output you expect?</description>
		<content:encoded><![CDATA[<p>Why does this code (which I think is syntactically intuitive) seems to swap the xdim and ydim when it generates the output.</p>
<pre>
xpts=[ 1 3 3 1];
ypts=[4 4 8 8];
xdim=6;
ydim=10;

poly2mask( xpts, ypts, xdim, ydim )
</pre>
<p>while  </p>
<pre>
poly2mask( xpts, ypts, ydim, xdim )
</pre>
<p>gets the output you expect?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-23151</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Wed, 26 May 2010 10:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-23151</guid>
		<description>Dear Steve,

Any progress on the &quot;mask2poly&quot; function?  I tried reading the bwboundary and bwperim and bwtraceboundary, but left with confusion.

My goal is to offer an alternative to the use of impoly, by using a simple graythresh command to create a mask.  However, where I am having trouble, is that I would like to save the graythresh information in an roi structure (where I store certain aspects of imroi output, such as the accepted position vector, createmask, color,...).  Because imroi has a createmask subfunction, it&#039;s easy to go from roi vertices to mask.  However, I can&#039;t seem to go from mask to position vertices in an easy manner.  mask2poly seemed like the closest thing I can find (since google returns nothing except answers to the opposite, i.e. &quot;roi to mask&quot;, when searching for &quot;convert mask to roi&quot; not in quotations)

Lemme know,

Eric</description>
		<content:encoded><![CDATA[<p>Dear Steve,</p>
<p>Any progress on the &#8220;mask2poly&#8221; function?  I tried reading the bwboundary and bwperim and bwtraceboundary, but left with confusion.</p>
<p>My goal is to offer an alternative to the use of impoly, by using a simple graythresh command to create a mask.  However, where I am having trouble, is that I would like to save the graythresh information in an roi structure (where I store certain aspects of imroi output, such as the accepted position vector, createmask, color,&#8230;).  Because imroi has a createmask subfunction, it&#8217;s easy to go from roi vertices to mask.  However, I can&#8217;t seem to go from mask to position vertices in an easy manner.  mask2poly seemed like the closest thing I can find (since google returns nothing except answers to the opposite, i.e. &#8220;roi to mask&#8221;, when searching for &#8220;convert mask to roi&#8221; not in quotations)</p>
<p>Lemme know,</p>
<p>Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-22908</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 24 Mar 2010 22:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-22908</guid>
		<description>Paul&#8212;I&#039;m not really sure what you mean by nonscalar m and n, but it sounds to me like the MATLAB function inpolygon might be useful to you.  Just be aware that inpolygon (and poly2mask as well) are plane geometry and not spherical geometry functions.  If your boundary polygon wraps a pole, they probably won&#039;t work for you.</description>
		<content:encoded><![CDATA[<p>Paul&mdash;I&#8217;m not really sure what you mean by nonscalar m and n, but it sounds to me like the MATLAB function inpolygon might be useful to you.  Just be aware that inpolygon (and poly2mask as well) are plane geometry and not spherical geometry functions.  If your boundary polygon wraps a pole, they probably won&#8217;t work for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Alexander</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-22907</link>
		<dc:creator>Paul Alexander</dc:creator>
		<pubDate>Wed, 24 Mar 2010 22:11:16 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-22907</guid>
		<description>Here is a crazy question for you Steve. I have some gridded files of latitude and longitude. I have vectors of some regions in lat and long too. I need to create a mask that represents where when my gridded lat and long fall within the polygon defined by my boundary vectors. Mask2poly comes close; but I really need to use predefined non-scalars for &#039;m&#039; and &#039;n&#039;. Appreciate any help you may be able to offer.</description>
		<content:encoded><![CDATA[<p>Here is a crazy question for you Steve. I have some gridded files of latitude and longitude. I have vectors of some regions in lat and long too. I need to create a mask that represents where when my gridded lat and long fall within the polygon defined by my boundary vectors. Mask2poly comes close; but I really need to use predefined non-scalars for &#8216;m&#8217; and &#8216;n&#8217;. Appreciate any help you may be able to offer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-21928</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 01 Jul 2009 13:12:02 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-21928</guid>
		<description>MoHDa&#8212;It might be possible. You&#039;ll need to use one of the options that produces closed edge contours, or work out some way of closing them yourself.</description>
		<content:encoded><![CDATA[<p>MoHDa&mdash;It might be possible. You&#8217;ll need to use one of the options that produces closed edge contours, or work out some way of closing them yourself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MoHDa</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-21927</link>
		<dc:creator>MoHDa</dc:creator>
		<pubDate>Tue, 30 Jun 2009 20:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-21927</guid>
		<description>I have one question about the ROIPOLY:

I have an image with stripes, I use the &quot;edge&quot; command for finding the edges, is it possible to use the output of edge as input to ROIPOLY and just extract the information that is included in the edges lines?</description>
		<content:encoded><![CDATA[<p>I have one question about the ROIPOLY:</p>
<p>I have an image with stripes, I use the &#8220;edge&#8221; command for finding the edges, is it possible to use the output of edge as input to ROIPOLY and just extract the information that is included in the edges lines?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/#comment-10588</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 25 Sep 2007 13:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=99#comment-10588</guid>
		<description>Sridharan&#8212;Use your polygon vertices to create a patch object that is superimposed over the image.  Then you can adjust the transparency of the patch.</description>
		<content:encoded><![CDATA[<p>Sridharan&mdash;Use your polygon vertices to create a patch object that is superimposed over the image.  Then you can adjust the transparency of the patch.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

