<?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"
	>
<channel>
	<title>Comments on: Detecting edge pixels with Marching Squares Algorithm</title>
	<atom:link href="http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/</link>
	<description>I Flash und I Flex Jaaaa</description>
	<pubDate>Fri, 12 Mar 2010 15:21:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: SF &#8211; Flash + Flex + Graphics &#187; Blog Archive &#187; Detecting Edge Pixels with Marching Squares Algorithm</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1262</link>
		<dc:creator>SF &#8211; Flash + Flex + Graphics &#187; Blog Archive &#187; Detecting Edge Pixels with Marching Squares Algorithm</dc:creator>
		<pubDate>Wed, 18 Nov 2009 19:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1262</guid>
		<description>[...] is a great experiment from Sakri.net.  I applications for this should be amazing.  It's incredibly simple to use as well.  Say you [...]</description>
		<content:encoded><![CDATA[<p>[...] is a great experiment from Sakri.net.  I applications for this should be amazing.  It&#8217;s incredibly simple to use as well.  Say you [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Noble</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1250</link>
		<dc:creator>Josh Noble</dc:creator>
		<pubDate>Thu, 03 Sep 2009 14:40:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1250</guid>
		<description>Super Cool thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Super Cool thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: delfeld</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1248</link>
		<dc:creator>delfeld</dc:creator>
		<pubDate>Tue, 01 Sep 2009 16:57:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1248</guid>
		<description>I think that the garbage collection is affecting frame rate.  If you hammer on one of the buttons, you will see your frame rate drop and the memory spike.  Not sure if this matters to your results . . . .</description>
		<content:encoded><![CDATA[<p>I think that the garbage collection is affecting frame rate.  If you hammer on one of the buttons, you will see your frame rate drop and the memory spike.  Not sure if this matters to your results . . . .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lithander</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1239</link>
		<dc:creator>lithander</dc:creator>
		<pubDate>Sat, 25 Jul 2009 00:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1239</guid>
		<description>I just implemented the same algorithm in C#. Have you considered to use a byte instead of string to store the cell type? It should be way faster to lookup a Point by a byte index then by a string key. It's also faster to calculate. Or are there AS3 specific reasons for your approach?

private static function getGridStringFromPoint(bmd:BitmapData,position:Point):byte{
   var type:byte = 0;
   if(bmd.getPixel32(position.x+_scan_point0.x,position.y+_scan_point0.y)&#62;0x0)
     type +=1;
   if(bmd.getPixel32(position.x+_scan_point1.x,position.y+_scan_point1.y)&#62;0x0)
     type += 2;
   if(bmd.getPixel32(position.x+_scan_point2.x,position.y+_scan_point2.y)&#62;0x0)
     type += 4;
   if(bmd.getPixel32(position.x+_scan_point3.x,position.y+_scan_point3.y)&#62;0x0)
     type += 8;

   return byte;
}</description>
		<content:encoded><![CDATA[<p>I just implemented the same algorithm in C#. Have you considered to use a byte instead of string to store the cell type? It should be way faster to lookup a Point by a byte index then by a string key. It&#8217;s also faster to calculate. Or are there AS3 specific reasons for your approach?</p>
<p>private static function getGridStringFromPoint(bmd:BitmapData,position:Point):byte{<br />
   var type:byte = 0;<br />
   if(bmd.getPixel32(position.x+_scan_point0.x,position.y+_scan_point0.y)&gt;0&#215;0)<br />
     type +=1;<br />
   if(bmd.getPixel32(position.x+_scan_point1.x,position.y+_scan_point1.y)&gt;0&#215;0)<br />
     type += 2;<br />
   if(bmd.getPixel32(position.x+_scan_point2.x,position.y+_scan_point2.y)&gt;0&#215;0)<br />
     type += 4;<br />
   if(bmd.getPixel32(position.x+_scan_point3.x,position.y+_scan_point3.y)&gt;0&#215;0)<br />
     type += 8;</p>
<p>   return byte;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: trop bien le blog &#187; vectorisation v0</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1194</link>
		<dc:creator>trop bien le blog &#187; vectorisation v0</dc:creator>
		<pubDate>Thu, 04 Jun 2009 11:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1194</guid>
		<description>[...] c&#8217;est cool&#8230;  sakri nous a pondu un savoureux petit algorithme de marching squares  qui est le petit frère des marching cubes et qui sert à détourer (vectoriser) des formes dans [...]</description>
		<content:encoded><![CDATA[<p>[...] c&#8217;est cool&#8230;  sakri nous a pondu un savoureux petit algorithme de marching squares  qui est le petit frère des marching cubes et qui sert à détourer (vectoriser) des formes dans [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: HIDIHO! &#187; vectorization v0</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1181</link>
		<dc:creator>HIDIHO! &#187; vectorization v0</dc:creator>
		<pubDate>Sat, 30 May 2009 23:12:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1181</guid>
		<description>[...] a nice twitter story&#8230;  sakri released a marching squares algorithm  which is a fast and efficient way to outline rasterized [...]</description>
		<content:encoded><![CDATA[<p>[...] a nice twitter story&#8230;  sakri released a marching squares algorithm  which is a fast and efficient way to outline rasterized [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Zwaga</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1178</link>
		<dc:creator>Roland Zwaga</dc:creator>
		<pubDate>Sat, 30 May 2009 11:17:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1178</guid>
		<description>Does your demo have a memoryleak? If I continuously switch between the different algorythms the used memory seems to be constantly increasing.
Perhaps you could check if it's just your demo, or perhaps the leak is in the algorythm's implementation, that way every app that uses the class will have the same problem...
Other than that, this is pretty cool stuff, thank you for sharing!</description>
		<content:encoded><![CDATA[<p>Does your demo have a memoryleak? If I continuously switch between the different algorythms the used memory seems to be constantly increasing.<br />
Perhaps you could check if it&#8217;s just your demo, or perhaps the leak is in the algorythm&#8217;s implementation, that way every app that uses the class will have the same problem&#8230;<br />
Other than that, this is pretty cool stuff, thank you for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sakri</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1174</link>
		<dc:creator>sakri</dc:creator>
		<pubDate>Fri, 29 May 2009 10:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1174</guid>
		<description>Hi Nicopetre, cheers for the links!  I'm really interested in the "smoothing" of the points the motiondraw demo.  In my 3D extruded text demo the lines and diagonals are pretty much "clean", only the curves need work, such smoothing of the positions looks ideal! 

Also, did you blog about that experiment you mentioned (from last year)? I'd be curious to see...

Rothrock, that sounds good, I might give it a shot.  Alan ported a Java implementation of MarchinSquares which I've been looking at this morning, seems to solve the problem (and is fast)...  More about that once he wakes up :D</description>
		<content:encoded><![CDATA[<p>Hi Nicopetre, cheers for the links!  I&#8217;m really interested in the &#8220;smoothing&#8221; of the points the motiondraw demo.  In my 3D extruded text demo the lines and diagonals are pretty much &#8220;clean&#8221;, only the curves need work, such smoothing of the positions looks ideal! </p>
<p>Also, did you blog about that experiment you mentioned (from last year)? I&#8217;d be curious to see&#8230;</p>
<p>Rothrock, that sounds good, I might give it a shot.  Alan ported a Java implementation of MarchinSquares which I&#8217;ve been looking at this morning, seems to solve the problem (and is fast)&#8230;  More about that once he wakes up <img src='http://www.sakri.net/blog/wp-includes/images/smilies/biggrin_sakri_blue.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rothrock</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1172</link>
		<dc:creator>Rothrock</dc:creator>
		<pubDate>Thu, 28 May 2009 20:49:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1172</guid>
		<description>Glad I could help. I think I know about one of the issues you found.

For my purposes so far a one pixel line hasn't happened and even if it did it would still be the contour of that shape. I've mostly been using this track fingers and stuff. And I don't know about you, but under no amount of scaling do my fat little sausage fingers get to be one pixel!

But issue two is the one about ambiguous patterns that I mentioned in my other post. At least I think it is. Somewhere else I found this idea. If you get one of the ambiguous cases ("0101" or "1010" or 5 and 10) you need to know what came before it.

So in some pseudo code....

if you've got a 5 and it was preceded by 8, 9, or 11 then x+1, else x-1;
if you've got a 10 and it was preceded by 1, 3, or 7 then y+1, else y-1;

Does that make any sense? It seemed to work for me in my naive AS2 version that I made awhile ago....

-- Rothrock</description>
		<content:encoded><![CDATA[<p>Glad I could help. I think I know about one of the issues you found.</p>
<p>For my purposes so far a one pixel line hasn&#8217;t happened and even if it did it would still be the contour of that shape. I&#8217;ve mostly been using this track fingers and stuff. And I don&#8217;t know about you, but under no amount of scaling do my fat little sausage fingers get to be one pixel!</p>
<p>But issue two is the one about ambiguous patterns that I mentioned in my other post. At least I think it is. Somewhere else I found this idea. If you get one of the ambiguous cases (&#8221;0101&#8243; or &#8220;1010&#8243; or 5 and 10) you need to know what came before it.</p>
<p>So in some pseudo code&#8230;.</p>
<p>if you&#8217;ve got a 5 and it was preceded by 8, 9, or 11 then x+1, else x-1;<br />
if you&#8217;ve got a 10 and it was preceded by 1, 3, or 7 then y+1, else y-1;</p>
<p>Does that make any sense? It seemed to work for me in my naive AS2 version that I made awhile ago&#8230;.</p>
<p>&#8211; Rothrock</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nicoptere</title>
		<link>http://www.sakri.net/blog/2009/05/28/detecting-edge-pixels-with-marching-squares-algorithm/#comment-1171</link>
		<dc:creator>nicoptere</dc:creator>
		<pubDate>Thu, 28 May 2009 19:32:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.sakri.net/blog/?p=322#comment-1171</guid>
		<description>hi, 
very neat. congrats !
last year I had to do quite the same and my take ended up quite like your first version.
to perform the second step of the Potras algorithm (simplifying), I found an intersting algorithm by Andreas Weber: 
http://www.motiondraw.com/blog/?p=50
and the demo : http://www.motiondraw.com/md/as_samples/t/LineGeneralization/demo.html

once you have thet key points, you can recreate smooth curves thanks to any cubic or quadratic curve algorithm ;)

and btw, the algorithmist is working on how to create one curveTo() instead of hundreds of lineTo() : http://algorithmist.wordpress.com/2009/04/20/spline-to-bezier-preview/

and thanks to Alan for the link :)</description>
		<content:encoded><![CDATA[<p>hi,<br />
very neat. congrats !<br />
last year I had to do quite the same and my take ended up quite like your first version.<br />
to perform the second step of the Potras algorithm (simplifying), I found an intersting algorithm by Andreas Weber:<br />
<a href="http://www.motiondraw.com/blog/?p=50" rel="nofollow">http://www.motiondraw.com/blog/?p=50</a><br />
and the demo : <a href="http://www.motiondraw.com/md/as_samples/t/LineGeneralization/demo.html" rel="nofollow">http://www.motiondraw.com/md/as_samples/t/LineGeneralization/demo.html</a></p>
<p>once you have thet key points, you can recreate smooth curves thanks to any cubic or quadratic curve algorithm <img src='http://www.sakri.net/blog/wp-includes/images/smilies/wink_sakri_blue.gif' alt=';)' class='wp-smiley' /> </p>
<p>and btw, the algorithmist is working on how to create one curveTo() instead of hundreds of lineTo() : <a href="http://algorithmist.wordpress.com/2009/04/20/spline-to-bezier-preview/" rel="nofollow">http://algorithmist.wordpress.com/2009/04/20/spline-to-bezier-preview/</a></p>
<p>and thanks to Alan for the link <img src='http://www.sakri.net/blog/wp-includes/images/smilies/smile_sakri_blue.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
