<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Smart-Page.net &#187; Webcam</title>
	<atom:link href="http://www.smart-page.net/blog/tag/webcam/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smart-page.net/blog</link>
	<description>C++ / C# / Py / Actionscript ... &#039;My God. It&#039;s full of stars!&#039;</description>
	<lastBuildDate>Thu, 23 Jun 2011 00:14:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Multiple object motion detection</title>
		<link>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/</link>
		<comments>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/#comments</comments>
		<pubDate>Sun, 24 May 2009 00:41:23 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Blobdetection]]></category>
		<category><![CDATA[MJPEG]]></category>
		<category><![CDATA[Motion Tracking]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[Webcam]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=281</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/" title="Multiple object motion detection"><img src="http://www.smart-page.net/blog/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=281&amp;w=200&amp;h=150&amp;zc=1" width="200" height="150" alt="Multiple object motion detection" style="float:left;padding:0 10px 10px 0;" ></a>There are a bunch of motion detection and argumented reality experiments with flash out there &#8211; most involve a webcam and are able to track a moving area quite accurate. I was curious if flash would be able to handle the task of tracking multiple objects/(blobs. Take a look at the result and track some [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/" title="Multiple object motion detection"><img src="http://www.smart-page.net/blog/wp-content/plugins/yet-another-photoblog/YapbThumbnailer.php?post_id=281&amp;w=200&amp;h=150&amp;zc=1" width="200" height="150" alt="Multiple object motion detection" style="float:left;padding:0 10px 10px 0;" ></a><p>There are a bunch of motion detection and argumented reality experiments with flash out there &#8211; most involve a webcam and are able to track a moving area quite accurate.</p>
<p>I was curious if flash would be able to handle the task of tracking multiple objects/(blobs.</p>
<p><b><a href="http://www.smart-page.de/as3/sp_tracking" target="_blank">Take a look at the result and track some cars in the Czech Republic</a> (live).</b><br />
<span style="color: #ffffff;">.</span></p>
<p><span id="more-281"></span>The example is using Justin Windle´s &#8220;<a href="http://blog.soulwire.co.uk/flash/actionscript-3/webcam-motion-detection-tracking/" target="_blank">MotionTracker</a>&#8221; approach, <span style="text-decoration: line-through;">Andrei Thomaz´s port of the <a href="http://andreithomaz.com/labs/?p=9" target="_blank">blobDetection-library</a> from <a href="http://v3ga.net/blog/" target="_blank">v3ga</a></span> and Josh Chernoff´s <a href="http://gfxcomplex.com/air/pure-as3-mjpeg-streaming-class/" target="_blank">version </a>of the <a href="http://www.alagad.com/go/blog-entry/viewing-mjpeg-streams-in-flex" target="_blank">MJPEG streaming-component</a> by Doug Hughe .</p>
<p>Basically two images/frames are filtered and compared. The deviating parts are filtered to show up as white &#8220;blobs&#8221;. This area is grabbed via <em>getColorBoundsRect() </em>and divided to be searched for individual blobs.</p>
<p>The Result has a slight amount of lag, resulting from the cams framerate, MJPEG-decoding of the webcam stream and the fact that it has to be fed via a proxy.</p>
<p>Also it´s much easier to get accurate results, if the background is known and fixed (no day/night changes or changing &#8220;static&#8221; objects like parked cars etc.).<br />
And it would take bigger image source to get a more percise tracking but without further optimisations the limit lies somewhere at 600*x.</p>
<p>So in conclusion realtime multi-object motion detection with flash is possible!</p>
<p><span style="color: #ff6600;">Update:</span></p>
<p>Big thanks to <a href="http://play.blog2t.net/fast-blob-detection" target="_blank">Og2t </a>for bringing Kanpei Baba´s <a href="http://faces.bascule.co.jp/motiondetection/" target="_blank">genious approach </a>to my attention. That guy just thought one step ahead as he harnessed the power of the player itself by using floodFill() to mark found blobs.</p>
<p>This is a perfect example how easy it is to oversee a great pattern &#8211; even while already using it!<br />
Its just the same idea with <em>getColorBoundsRect() </em>- of course you could iterate through the pixels with a simple algo to get the same result &#8211; but why if the runtime does it &#8211; and so much faster than the AVM ?</p>
<p>The experiment has been updated and eats virtually &#8216;no&#8217; cpu-time in comparison to the original.</p>
<p><span style="color: #ff6600;">Update2:</span></p>
<p>The cam I used until now has been moved to face away from the road &#8211; the feed of the new one is till a but too small and lacks quality but its hard to find a relyable realtime stream that captures moving objects, shows a suitable envirionment AND offers the right resolution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/05/24/multiple-object-motion-detection/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

