<?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>Electric Pineapple &#187; Uncategorized</title>
	<atom:link href="http://electricpineapple.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://electricpineapple.net</link>
	<description>Powered by Fruit?</description>
	<lastBuildDate>Wed, 08 Sep 2010 01:26:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<cloud domain='electricpineapple.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Cakefest 2010 &#8211; Acl Permissions</title>
		<link>http://electricpineapple.net/2010/09/07/cakefest-2010-acl-permissions/</link>
		<comments>http://electricpineapple.net/2010/09/07/cakefest-2010-acl-permissions/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 01:20:55 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=370</guid>
		<description><![CDATA[It&#8217;s easier to ask forgiveness than it is to get ACL permissions Access control lists are complicated. Granting permissions to certain people for specific objects can become a jumbled mess. And what if you need object level permissions? This session will help you sort out the basics and give you tools to extend your permissions [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-374 alignright" style="padding-left:10px" title="speaker125" src="http://electricpineapple.net/wp-content/uploads/2010/09/speaker125.jpg" alt="Cakefest 2010 speaker" width="125" height="125" /></p>
<p>It&#8217;s easier to ask forgiveness than it is to get ACL permissions</p>
<p>Access control lists are complicated. Granting permissions to certain people for specific objects can become a jumbled mess. And what if you need object level permissions? This session will help you sort out the basics and give you tools to extend your permissions to fit your application.</p>
<p>Covered:<br />
Basic ACL structure<br />
Strategies for handling complex scenarios<br />
Customizing beyond ACL</p>
<p>Thank you to all who attended. I have posted my code on github.</p>
<p><a href="http://github.com/electricpineapple/CakeFestAclDemo" target="_blank">http://github.com/electricpineapple/CakeFestAclDemo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/09/07/cakefest-2010-acl-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Riapalooza &#8211; The New Cross Platform</title>
		<link>http://electricpineapple.net/2010/07/27/riapalooza-the-new-cross-platform/</link>
		<comments>http://electricpineapple.net/2010/07/27/riapalooza-the-new-cross-platform/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:00:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=354</guid>
		<description><![CDATA[Develop for Windows, Mac or even Linux? That&#8217;s hardly the question asked anymore. We want to know iPhone, Android, Blackberry, iPad, or other mobile device. There are solutions for delivering to all devices plus the traditional desktop. In this session we will walk through how to achieve cross-platform deployment of Rich Internet Applications. Thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>Develop for Windows, Mac or even Linux? That&#8217;s hardly the question asked anymore. We want to know iPhone, Android, Blackberry, iPad, or other mobile device. There are solutions for delivering to all devices plus the traditional desktop. In this session we will walk through how to achieve cross-platform deployment of Rich Internet Applications.</p>
<p>Thanks to everyone who attended RIApalooza 3 in Chicago, IL and to everyone with great questions.</p>
<div class="prezi-player">
<style type="text/css" media="screen">.prezi-player { width: 550px; } .prezi-player-links { text-align: center; }</style>
<p><object id="prezi_0rczu1hopkj7" name="prezi_0rczu1hopkj7" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550" height="400"><param name="movie" value="http://prezi.com/bin/preziloader.swf"/><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="bgcolor" value="#ffffff"/><param name="flashvars" value="prezi_id=0rczu1hopkj7&amp;lock_to_path=0&amp;color=ffffff&amp;autoplay=no&amp;autohide_ctrls=0"/><embed id="preziEmbed_0rczu1hopkj7" name="preziEmbed_0rczu1hopkj7" src="http://prezi.com/bin/preziloader.swf" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="550" height="400" bgcolor="#ffffff" flashvars="prezi_id=0rczu1hopkj7&amp;lock_to_path=0&amp;color=ffffff&amp;autoplay=no&amp;autohide_ctrls=0"></embed></object>
<div class="prezi-player-links">
<p><a title="Develop for Windows, Mac or even Linux? That's hardly the question asked anymore. We want to know iPhone, Android, Blackberry, iPad, or other mobile device. There are solutions for delivering to all devices plus the traditional desktop. In this session we" href="http://prezi.com/0rczu1hopkj7/new-cross-platform/">New Cross Platform</a> on <a href="http://prezi.com">Prezi</a></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/07/27/riapalooza-the-new-cross-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The iPad shuffle</title>
		<link>http://electricpineapple.net/2010/07/01/the-ipad-shuffle/</link>
		<comments>http://electricpineapple.net/2010/07/01/the-ipad-shuffle/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 15:47:13 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=348</guid>
		<description><![CDATA[For the Iona Group&#8217;s company demo, we wanted to feature the iPad. But not just one iPad, we used 3. And we didn&#8217;t just put the same thing on each one but we used the Game Kit framework and Bluetooth for peer-to-peer communication between the iPads. Enjoy. www.youtube.com/watch?v=IGZf0Vgp-sY]]></description>
			<content:encoded><![CDATA[<p>For the Iona Group&#8217;s company demo, we wanted to feature the iPad. But not just one iPad, we used 3. And we didn&#8217;t just put the same thing on each one but we used the Game Kit framework and Bluetooth for peer-to-peer communication between the iPads. Enjoy.</p>
<p><span class="youtube">
<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/IGZf0Vgp-sY&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1" />
<param name="allowFullScreen" value="true" />
<embed wmode="transparent" src="http://www.youtube.com/v/IGZf0Vgp-sY&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="355"></embed>
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=IGZf0Vgp-sY">www.youtube.com/watch?v=IGZf0Vgp-sY</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/07/01/the-ipad-shuffle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropping Cable</title>
		<link>http://electricpineapple.net/2010/05/12/dropping-cable/</link>
		<comments>http://electricpineapple.net/2010/05/12/dropping-cable/#comments</comments>
		<pubDate>Thu, 13 May 2010 03:51:29 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=301</guid>
		<description><![CDATA[The time came to renew our cable subscription (promotional period was ending) and we decided our usage did not justify keeping the television portion of our cable bill. We also receive our broadband through the cable company and so we debated other broadband offerings but as in most places, the options are limited to cable [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/lord_yo/219755250/" title="My Cable Collection by Timm Suess, on Flickr"><img src="http://farm1.static.flickr.com/62/219755250_e323b83671.jpg" width="500" height="350" alt="My Cable Collection" style="padding-top:15px" /></a></p>
<p>The time came to renew our cable subscription (promotional period was ending) and we decided our usage did not justify keeping the television portion of our cable bill. We also receive our broadband through the cable company and so we debated other broadband offerings but as in most places, the options are limited to cable or telephone providers. Cable was going to give us the speed we wanted to stream all of our video online, so we just downgraded our cable service.</p>
<p>A few months before, my wife upgraded here laptop and we had a spare lying around that I moved straight to the entertainment center. The specs are not that impressive but it was a spare:</p>
<ul>
<li>Acer Aspire 5630</li>
<li>Processor: 1.6GHz Core 2 Duo T5200</li>
<li>Memory: 1GB DDR2</li>
<li>HD: 120GB hard drive</li>
<li>Optical: Double-layer DVD±RW</li>
<li>Graphics: Integrated Intel GMA 950</li>
<li>OS: Windows 7 Home Premium (upgraded)</li>
<li>1 Tb attached USB external HD</li>
</ul>
<p>Around the same time we also upgraded our display (television) to an internet connected model (Vizio Via SV472XVT). I wanted to see first hand the capabilities of the integrated widgets which I had previously talked about <a href="http://electricpineapple.net/2010/02/18/widget-update/">here</a>.</p>
<p>I first experimented with Windows Media Center. I &#8220;looked&#8221; on every dvd I owned for a &#8220;digital copy,&#8221; and if there was one, I put in on the computer so I could access it through WMC. I also installed the <a href="http://www.mediabrowser.tv/" target="_blank">Media Browser plugin</a>, which gave me the ability to obsess over all the meta data associated with my movies. I also grabbed the <a href="http://huluwmc.teknowebworks.com/" target="_blank">Hulu desktop plugin</a> which gave me some amount of streaming capability. The Hulu selection paired with antennae reachable stations (network, PBS) was not quite enough coming from our 57+ channels and nothings on. I decided to give <a href="http://www.boxee.tv/" target="_blank">Boxee</a> another shot, having tried it prior and found that the pre-beta versions choking on most feeds. The new beta did not have the same stuttering issues that I found prior but did have some staggering that may be related to the video card or the cpu load. Boxee also offered a greater selection of television shows as well as easily usable apps. I was disappointed that Boxee did not offer any way to manually identify movies and other video data stored on my computer. I looks to be a greatly requested feature from the Boxee community and my OCD concerning extra meta data will hopefully be satisfied soon.</p>
<p>Toting a full keyboard and mouse around was not option for control so we looked to our mobile device to control, a Motorola Droid for both my wife and myself. Since I had decided on Boxee, we went for the Boxee Wifi Remote from Sunil Sadasivan (qr code below).</p>
<p>I am still interested in the upnp server concept that would act as the media server which Boxee mangled in its current form from the XMBC code base. I would also like to upgrade the hardware of the system to get a smoother video playback and I question adding a Bluray drive at this stage because streaming/online HD content is still too rare. I do think that the disc model will go the way of the PC software CD-ROM. Looking at content, there are very few live streams of any cable or network content and bandwidth is still too much of an issue to try to ease compression on the online streams. I&#8217;m sure I will have more to say about dropping cable in the future but for now, I love tinkering with my system and do not miss cable even with the occasional video stutter.</p>
<div id="attachment_330" class="wp-caption alignnone" style="width: 145px"><img class="size-full wp-image-330" title="boxee_qr" src="http://electricpineapple.net/wp-content/uploads/2010/05/boxee_qr.png" alt="Boxee remote qr" width="135" height="135" /><p class="wp-caption-text">Boxee remote qr</p></div>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/05/12/dropping-cable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making the most of your toy robot (Part 4 of 4) – Docks and Beacons</title>
		<link>http://electricpineapple.net/2010/04/14/making-the-most-of-your-toy-robot-part-4-of-4-%e2%80%93-docks-and-beacons/</link>
		<comments>http://electricpineapple.net/2010/04/14/making-the-most-of-your-toy-robot-part-4-of-4-%e2%80%93-docks-and-beacons/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 20:41:37 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=298</guid>
		<description><![CDATA[We have driven our friend Rovio with custom controls, viewed his video, and detected some objects and now it&#8217;s time for Rovio to go home. Here&#8217;s how we got him back to base: First Rovio needs to know where home is. To do this we use the beacon on the base station and optional extender [...]]]></description>
			<content:encoded><![CDATA[<p>We have driven our friend Rovio with custom controls, viewed his video, and detected some objects and now it&#8217;s time for Rovio to go home. Here&#8217;s how we got him back to base:</p>
<p><img class="alignnone size-medium wp-image-307" title="PVC and Beacons" src="http://electricpineapple.net/wp-content/uploads/2010/04/pvcbeacons-300x223.jpg" alt="PVC and Beacons" width="300" height="223" /></p>
<p>First Rovio needs to know where home is. To do this we use the beacon on the base station and optional extender beacons. On the topic of the extender beacons, the single home beacon has more strength than reported in the web interface. Using the api you can see the signal strength (ss) using the http://xxx.xxx.xxx.xxx/rev.cgi?Cmd=nav&amp;action=1 command. The higher the better we found a number above 5000 seemed adequate to get Rovio home. This beacon also projects its beam onto the ceiling and in doing so projects an oval shape with the two dots being the ends of the oval. In our situation we also needed multiple docks which turns out to cause trouble because all dock ids are set to number 0 and are not changeable. The extender beacons allow multiple id but the docks do not respond to anything but 0 as home. The solution is to only use one 0 beacon and place the docks at least 2 feet apart. Rovio only uses the beam on the ceiling to get right in front of his own home. With home positions set independently on each rover they will navigate to right in front of their home and then use the small dot on the top arm to get into the dock. We ended up using photography lens caps to cover the other beacons.</p>
<p>The documented battery status in the api is 0-79 is not charging, while 80 indicates a charging state. After some discussion with Wowwee, we got a few more statuses:<br />
80: charging<br />
72: is in the dock fully charged (not charging)<br />
64: status when the Rovio docks but is not charging yet, usually right as it hits the dock<br />
0: not charging<br />
It&#8217;s not a ton of new information but does help when dealing with some automated docking.</p>
<p>The experience that was designed did not involve 5 year olds needing to navigate the Rovio back to the dock but relied on the application knowing how to get him back and move to another rover when ready. It was quite a twisted web of calls to the rover but it gave the rover the best chance at getting home to charge.</p>
<ol>
<li>Poll the rover to check its battery level with the api call</li>
<li>If the battery level was below the specified level then continue with the checks</li>
<li>Switch the video stream to the next rover to prep streaming for the user</li>
<li>Tell Rovio to go home</li>
<li>Loop over the api call to see if the charging status is one of the acceptable numbers indicated above (80,72,64), if it doesn&#8217;t reach a number send the home request again</li>
<li>When one of the numbers is achieved switch the api call to the next rover</li>
<li>Check the next docked rover for its battery level</li>
<li>If that rover is too low, move to the next until a adequate charge is reached</li>
<li>Set timers in actionscript to allow for unreachable rovers to be passed over (this speeds up the process, rather than using error catching)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/04/14/making-the-most-of-your-toy-robot-part-4-of-4-%e2%80%93-docks-and-beacons/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making the most of your toy robot (Part 3 of 4) – Object Detection</title>
		<link>http://electricpineapple.net/2010/03/18/making-the-most-of-your-toy-robot-part-3-of-4-%e2%80%93-object-detection/</link>
		<comments>http://electricpineapple.net/2010/03/18/making-the-most-of-your-toy-robot-part-3-of-4-%e2%80%93-object-detection/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 18:47:14 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=282</guid>
		<description><![CDATA[With the newly acquired robot eyes, we were left with the question of what distinguishes the objects from each other? Shape and size: Using these characteristics and constructing custom object (similar to facial) recognition using opencv and haartraining the different objects could be &#8220;seen&#8221; by the rover. This ended up being a balance of accuracy [...]]]></description>
			<content:encoded><![CDATA[<p>With the newly acquired robot eyes, we were left with the question of what distinguishes the objects from each other?</p>
<p>Shape and size: Using these characteristics and constructing custom  object (<a href="http://www.quasimondo.com/archives/000687.php" target="_blank">similar  to facial</a>) recognition using <a href="http://opencv.willowgarage.com/wiki/FullOpenCVWiki" target="_blank">opencv</a> and <a href="http://note.sonots.com/SciSoftware/haartraining.html" target="_blank">haartraining</a> the different objects could be &#8220;seen&#8221;  by the rover. This ended up being a balance of accuracy and speed, of  which neither was good enough to use in the application.</p>
<p>Position: Using the rover&#8217;s position, both location and orientation,  the specific object could be determined from its coordinates. The  numbers coming back from the rover, through the beacon, ended up being  too cryptic and not reliable enough to give specific positioning  information, especially for moving a precise onscreen target. There was  also no way to get vertical movement information.</p>
<p>Color: Pairing a unique color with the object to be identified could  allow color detection to run the brain of the rover. This ended up being  the most streamlined and accurate approach to identifying object in the  interactive. Using a vibrant red, green and blue gave enough differentiation  between the objects to bring up specific prompts for each target.  Running the color detection on the video stream and then creating a box  around the identified color gave a specific position in the video frame.  The target could then be positioned in the center of the box, and  exceptions could be made for outlying false positives. Color scraps  could be disregarded and focus could be on heavy concentrations of the  specific colors. Below you can see the blue box (hidden when not in  debug mode) surrounding the green colored image.</p>
<p><img title="Non lit color" src="http://electricpineapple.net/wp-content/uploads/2010/03/boxcolordetect.png" alt="Non lit colored box" width="277" height="261" /></p>
<p><img title="blacked out boxes" src="http://electricpineapple.net/wp-content/uploads/2010/03/blackedout3.png" alt="blacked out boxes" width="556" height="462" /></p>
<p>Lighting  greatly impacted the color detection on the objects. Above is a picture  of two of the colored boxes blacked out by the  background window light.  The objects needed to be lit from a reliable, consistent source of  light. This light would have to be pointed on the object or what was  done in this case from within the object. The targets were lit with  colored light to attempt to nullify lighting differences due to sunny or  cloudy days (the interactive being in a heavily windowed area). Below  are images against the window areas. First, the transparent gels of the  three different colors (the red needed some help and has a light behind  it). Second is a stronger light competing with the self lit color cone.</p>
<p><img title="Colored tubes" src="http://electricpineapple.net/wp-content/uploads/2010/03/tubes.png" alt="Colored tubes" width="554" height="331" /></p>
<p><img title="With light" src="http://electricpineapple.net/wp-content/uploads/2010/03/lightin.png" alt="Color cone with light behind" width="553" height="528" /></p>
<p><strong>Update (prior to posting):</strong></p>
<p>After using the previous version of color detection where one color was identified, it was determined that this was a fickle method given external lighting conditions. The color detection was updated with the following:</p>
<p>For aesthetic reasons, the object was to be internally lit. When in the final space, the bulb was not colorful enough and was whitewashed in the rover&#8217;s view. We tried to use the colored gels and other manipulations but due to the fact that the rover was looking for one specific color we were not able to tune it in enough to be accurate. Take two.</p>
<p>Now we were looking for two objects. First a strong white light source, which is what we had and were trying to fight the first time, and then look below the light for a color. The first method was based on the blob detection outlined <a href="http://play.blog2t.net/fast-blob-detection" target="_blank">here</a> by Tomek Augustyn (Og2t). This takes the video object, draws it to a bitmap object and then creates another bitmap object using the threshold method finding the brightest spots in the video. After singling out the brightest spots, we take some measurements of the individual rectangles found with getColorBoundsRect(). If they meet the minimum and maximum requirements for size, of which in this case the minimum height is a ratio of the width, then we look for the next piece of information.</p>
<p><img class="alignnone size-full wp-image-289" title="Green-Debug-blur" src="http://electricpineapple.net/wp-content/uploads/2010/03/Green-Debug-blur.png" alt="Green fill area on bright lights" width="481" height="311" /></p>
<p>Below the bright spot is a colored ring that can be averaged out and determined to be in a specific range. Using the <a href="http://blog.soulwire.co.uk/code/actionscript-3/extract-average-colours-from-bitmapdata" target="_blank">technique outlined here</a> by <a href="http://twitter.com/soulwire" target="_blank">Justin Windle</a> we have averaged out the ring color and can ask if the RGB values are in the range that we are looking for:</p>
<p><code>if((colorin &gt;&gt; 16 &amp; 0xFF) &lt; 0x5f &amp;&amp; (colorin &gt;&gt; 8 &amp; 0xFF) &gt; 0x84 &amp;&amp; (colorin &amp; 0xFF) &lt; 0xc6){do something}</code></p>
<p>If the color is in the correct range then we are displaying the found target icon over the bright area. This gives a bit more flexibility and accuracy in finding the correct targets.</p>
<p><img class="alignnone size-full wp-image-290" title="Detect-shot-blur" src="http://electricpineapple.net/wp-content/uploads/2010/03/Detect-shot-blur.png" alt="getColorBoundsRect on the filled bright areas" width="488" height="327" /></p>
<p><strong>Update (3/29/10):</strong></p>
<p>You are witnessing the evolution of the color detection idea as it plays out in the physical space. The previous method, which relied on a strong light source, did not play out in a brightly-lit, white-walled space because the light source was buried in the sea of bright white wall behind it. I was able to scavenge the threshold method that was used previously and base the next method around that.</p>
<p>For each of the three colors we were looking for (red, green, blue), I ran the video through a couple of thresholds to filter out the precise color we were looking for. Red for instance uses these lines to filter out the red color from the background images:</p>
<p><code>aBitmapDataObject.draw(theVideoObject);<br />
var pt:Point = new Point(0,0);<br />
var rect:Rectangle = new Rectangle(0,0,aBitmapDataObject.width,aBitmapDataObject.height);<br />
var threshold1:uint = 0x00004040; //green and blue values<br />
private var color1:uint = 0xff000000; //turn this black for next threshold because it is greater than &gt;<br />
private var maskColor1:uint = 0x0000ffff; //mask on green and blue<br />
private var threshold2:uint = 0x00600000; //red value<br />
private var color2:uint = 0xffff0000; //change this to a indicating color (bright red) to mark<br />
private var maskColor2:uint = 0x00ff0000; //mask on red value<br />
//turn anything with green and blue pixel values greater than threshold1 black to filter out strong blue/green color<br />
aSecondBitmapDataObject.threshold(aBitmapDataObject, rect, pt, "&gt;", threshold1, color1, maskColor1, true);<br />
//turn anything with red pixel values greater than threshold2 indicator color2 to find strong red<br />
aSecondBitMapDataObject.threshold(aSecondBitMapDataObject, rect, pt, "&gt;", threshold2, color2, maskColor2, true);<br />
boundRectangle = aSecondBitMapDataObject.getColorBoundsRect(0xffffff, 0xff0000,true);</code></p>
<p>Here is the blue:</p>
<p><code>aBitmapDataObject.draw(theVideoObject);<br />
var pt:Point = new Point(0,0);<br />
var rect:Rectangle = new  Rectangle(0,0,aBitmapDataObject.width,aBitmapDataObject.height);<br />
var threshold1:uint = 0x00000099; //blue values<br />
private var color1:uint = 0xffffffff; //turn this white for next  threshold because it is less than &lt;<br />
private var maskColor1:uint = 0x000000ff; //mask on blue<br />
private var threshold2:uint = 0x00440000; //red value<br />
private var color2:uint = 0xff0000ff; //change this to a indicating  color (bright blue) to mark<br />
private var maskColor2:uint = 0x00ff0000; //mask on red value<br />
//turn anything with blue pixel values less than threshold1 white to filter out weak blue<br />
aSecondBitmapDataObject.threshold(aBitmapDataObject, rect, pt, "&lt;",  threshold1, color1, maskColor1, true);<br />
//turn anything with red pixel values less than threshold2 indicator  color2 because the blue does not contain red<br />
aSecondBitMapDataObject.threshold(aSecondBitMapDataObject,  rect, pt, "&lt;", threshold2, color2, maskColor2, true);<br />
boundRectangle = aSecondBitMapDataObject.getColorBoundsRect(0xffffff,  0xff0000,true);</code></p>
<p>After we have the boundRectangle we can use the technique previously mentioned from <a href="http://play.blog2t.net/fast-blob-detection" target="_blank">Tomek Augustyn (Og2t)</a>, to check for height and width sizes or ratios. And the <a href="http://blog.soulwire.co.uk/code/actionscript-3/extract-average-colours-from-bitmapdata" target="_blank">color averaging method</a> to weed out false positives by Justin Windle.</p>
<p><img class="alignleft size-full wp-image-311" title="fb_fxp" src="http://electricpineapple.net/wp-content/uploads/2010/02/fb_fxp.png" alt="" width="16" height="16" /> <a href="/uploads/StageFourRover.fxp" target="_blank">Download Flex Builder 4 Project</a> &#8211; Simple color detection</p>
<p><img class="alignleft size-full wp-image-311" title="fb_fxp" src="http://electricpineapple.net/wp-content/uploads/2010/02/fb_fxp.png" alt="" width="16" height="16" /> <a href="/uploads/StageFiveRover.fxp" target="_blank">Download Flex Builder 4 Project</a> &#8211; Complex color detection</p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/03/18/making-the-most-of-your-toy-robot-part-3-of-4-%e2%80%93-object-detection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making the most of your toy robot (Part 2 of 4) – Processing the video stream in Flash</title>
		<link>http://electricpineapple.net/2010/03/01/making-the-most-of-your-toy-robot-part-2-of-4-%e2%80%93-processing-the-video-stream-in-flash/</link>
		<comments>http://electricpineapple.net/2010/03/01/making-the-most-of-your-toy-robot-part-2-of-4-%e2%80%93-processing-the-video-stream-in-flash/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 22:58:41 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=241</guid>
		<description><![CDATA[Now that we can move the robot, we need to be able to see where we are going. To give our robot eyes within flash, I first tried a series of images using the still image command from the Rovio api (/Jpeg/CamImg[value].jpg). This produced stuttering, unreliable quality video. I needed to get at the video [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we can <a href="http://electricpineapple.net/2010/02/11/making-the-most-of-your-toy-robot-part-1-of-4-custom-hardware-controls/">move the robot</a>, we need to be able to see where we are going. To give our robot eyes within flash, I first tried a series of images using the still image command from the Rovio api (/Jpeg/CamImg[value].jpg). This produced stuttering, unreliable quality video. I needed to get at the video stream that Rovio broadcasts, the RTSP stream (Rtsp://xxx.xxx.xxx.xxx/webcam). To get the video stream into flash it needed to be transcoded to flv. The go-between for the video was a Red 5 server which took in the live Rovio RTSP stream and output a live flv stream. Catching the flv stream was a netstream connected to a video object. This provided a much cleaner, smoother image for driving the robot.</p>
<p>Not only did the robot need eyes, he also needed to be able to recognize what he was looking at. The objective of the interactive was to have young children track down specific objects on a surface. To give them a prompt and to make the video of the surface a bit more interesting, a target was to be overlayed on the video pointing to where the object was. This meant that the Rovio would need to distinguish between the unique objects on the driving surface. So what set the objects apart from each other? More in the next post.</p>
<p>Recipe for robot eyes:</p>
<p><a href="http://www.wowwee.com/en/products/tech/telepresence/rovio/rovio" target="_blank">Wowwee Rovio</a><br />
<a href="http://osflash.org/red5" target="_blank">Red 5 video server</a><br />
<a href="http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html" target="_blank">Flash netstream/video objects</a></p>
<p><img class="alignleft size-full wp-image-311" title="fb_fxp" src="http://electricpineapple.net/wp-content/uploads/2010/02/fb_fxp.png" alt="" width="16" height="16" /> <a href="/uploads/StageTwoRover.fxp" target="_blank">Download Flash Builder 4 Project</a> &#8211; Using consecutive jpg images, choppy</p>
<p><img class="alignleft size-full wp-image-311" title="fb_fxp" src="http://electricpineapple.net/wp-content/uploads/2010/02/fb_fxp.png" alt="" width="16" height="16" /> <a href="/uploads/StageThreeRover.fxp" target="_blank">Download Flash Builder 4 Project</a> &#8211; Using red 5 connection</p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/03/01/making-the-most-of-your-toy-robot-part-2-of-4-%e2%80%93-processing-the-video-stream-in-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Widget update</title>
		<link>http://electricpineapple.net/2010/02/18/widget-update/</link>
		<comments>http://electricpineapple.net/2010/02/18/widget-update/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 18:19:16 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=240</guid>
		<description><![CDATA[A year ago I published a post about widgets coming to the television. A year later I have widgets on my TV. Now that I have experienced the widgets first hand, there is not much change to my feelings about the basics of the previous post. There is still no bridge between the cable content [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://connectedtv.yahoo.com/services/tv-widgets"><img class="alignnone size-full wp-image-258" title="Widgets" src="http://electricpineapple.net/wp-content/uploads/2010/02/widgetbarsm.png" alt="Widgets" width="600" height="51" /></a></p>
<p>A year ago I published a <a href="http://electricpineapple.net/2009/03/01/interteletube-widgets/">post about widgets coming to the television</a>. A year later I <a href="http://www.vizio.com/flat-panel-hdtvs/sv472xvt.html" target="_blank">have widgets on my TV</a>. Now that I have experienced the widgets first hand, there is not much change to my feelings about the basics of the previous post.</p>
<p>There is still no bridge between the cable content coming over the wire and the widgets on screen. Widget content cannot be populated by on-screen cable content. This leaves out advertising tie-ins and related content that would be automatically populated.</p>
<p>There are however widgets for pulling video content from online. This enables the content to interact with additional features. The main downside to the online content is the timeliness of the content in comparison to traditional counterparts. There is very little to no live television content being delivered through the widget interface, or anywhere online. Any online movie rentals or purchases are delayed by at least a month compared to in-store movies.</p>
<p>HD is another problem area for online content. There are allot of bits to move for HD content and until broadband infrastructure is in place to handle the content, a coaxial cable is the only option.</p>
<p>Online content delivery still needs time to develop and find a viable business model. Timely content will not be allowed to move to an online market unless it promises not to threaten the more profitable traditional models, and until timely content is delivered people will still want cable/satellite and physical dvd rental.</p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/02/18/widget-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making the most of your toy robot (Part 1 of 4) &#8211; Custom hardware controls</title>
		<link>http://electricpineapple.net/2010/02/11/making-the-most-of-your-toy-robot-part-1-of-4-custom-hardware-controls/</link>
		<comments>http://electricpineapple.net/2010/02/11/making-the-most-of-your-toy-robot-part-1-of-4-custom-hardware-controls/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:15:38 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=217</guid>
		<description><![CDATA[Using a keyboard to navigate a virtual space; be it the internet, a game or some other format, is familiar to most adults and older children. The Wowwee Rovio (rover) can be driven by such keyboard controls or mouse clicks with the built-in interface. Couple of problems with this however: The interactive needed a custom [...]]]></description>
			<content:encoded><![CDATA[<p>Using a keyboard to navigate a virtual space; be it the internet, a game or some other format, is familiar to most adults and older children. The Wowwee Rovio (rover) can be driven by such keyboard controls or mouse clicks with the built-in interface. Couple of problems with this however:</p>
<ol>
<li><strong>The interactive needed a custom interface so the built-in web interface (and keyboard controls) would not work.</strong></li>
<li><strong>The interactive needed to be accessible to children as young as 3 years old.</strong><img class="alignnone size-medium wp-image-318" title="Hardware  controls" src="http://electricpineapple.net/wp-content/uploads/2010/02/DSC011811-300x225.jpg" alt="" width="300" height="225" /></li>
</ol>
<p>The custom interface was built with ActionScript3 and so to move the rover, the api was used. With the api, the rover could be sent movements via http requests. These api requests needed to be mapped back to user input and so the web interface was recreated in with as3. The ASDW keys were mapped back to specific movement requests via the api. This is a specific piece of code initiated by a keypress that gets sent to the rover:</p>
<p><code>switch(e.keyCode){<br />
//forward<br />
case 87: //W key<br />
drive = 1; //1 maps to forward<br />
speed = 1;<br />
request.data = "Cmd=nav&amp;action=18&amp;drive=" + drive +  "&amp;speed="+speed; //action 18 is manual drive mode<br />
loader.load(request);<br />
break;<br />
}</code></p>
<p><a href="http://www.happcontrols.com/joysticks/universal_joy_e.htm"><img class="alignleft" style="margin-left: 5px; margin-right: 10px;" title="Happ Joystick" src="http://www.happcontrols.com/images/50/50604800_exploded.gif" alt="Happ Joystick" width="90" height="256" /></a></p>
<p>The drive variable signals the command/direction for the rover (forward, backward, rotate right) and the speed variable is how fast the command should be executed by the rover. Sending one of these http requests would move the rover a fraction of an inch. Mapping each key to a specific movement and sending multiple commands successively reproduces the motion of the built-in interface. This does not remedy our problem of simplifying the interface for 3 year olds. This is where the custom hardware comes in.</p>
<p>Our custom hardware consists primarily of a joystick but also includes some auxiliary buttons for game functionality which I will describe in a following post. The hardware came from <a href="http://www.happcontrols.com/" target="_blank">Suzo Happ</a> and also included a UGCI board for USB interface. The UGCI board had an included key-mapping utility which was used to map the joystick and button contacts to key presses. A constant connection with the joystick in any direction sent a repeating key press rather than a key up and down.</p>
<p>With key presses mapped to the joystick control and to the rover&#8217;s api through actionscript, the rover could now be driven with custom joystick controls. Now if only our rover could see&#8230;</p>
<p><a href="/uploads/StageOneRover.fxp" target="_blank"><img class="alignleft size-full wp-image-311" title="fb_fxp" src="http://electricpineapple.net/wp-content/uploads/2010/02/fb_fxp.png" alt="" width="16" height="16" /> Download Flash Builder 4 Project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/02/11/making-the-most-of-your-toy-robot-part-1-of-4-custom-hardware-controls/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Making the most of your toy robot</title>
		<link>http://electricpineapple.net/2010/01/30/making-the-most-of-your-toy-robot/</link>
		<comments>http://electricpineapple.net/2010/01/30/making-the-most-of-your-toy-robot/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 16:42:55 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricpineapple.net/?p=174</guid>
		<description><![CDATA[Over the past months at work I have been taking a consumer mobile webcam (robot) and converting it to custom interactive experience. Over the next couple of weeks I will be talking about some of the finer point of taking an off-the-shelf WowWee Rovio (which comes with some fine built-in features) and transforming it into [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://electricpineapple.net/wp-content/uploads/2010/01/atplay.png"><img class="size-full wp-image-192  alignright" style="margin-left: 5px; margin-right: 5px;" title="robots at play" src="http://electricpineapple.net/wp-content/uploads/2010/01/atplay.png" alt="Caution robots at play" width="300" height="300" /></a></p>
<p>Over the past months at work I have been taking a consumer mobile webcam (robot) and converting it to custom interactive experience. Over the next couple of weeks I will be talking about some of the finer point of taking an off-the-shelf <a href="http://www.wowwee.com/en/products/tech/telepresence/rovio/rovio" target="_blank">WowWee Rovio</a> (which comes with some fine built-in features) and transforming it into something much more. I will be talking about the following modifications in the coming weeks:</p>
<ul>
<li><a href="http://electricpineapple.net/2010/02/11/making-the-most-of-your-toy-robot-part-1-of-4-custom-hardware-controls/"><strong>Custom hardware controls</strong></a></li>
<li><a href="http://electricpineapple.net/2010/03/01/making-the-most-of-your-toy-robot-part-2-of-4-%E2%80%93-processing-the-video-stream-in-flash/"><strong>Processing the video stream in Flash</strong></a></li>
<li><a href="http://electricpineapple.net/2010/03/18/making-the-most-of-your-toy-robot-part-3-of-4-%E2%80%93-object-detection/"><strong>Object detection</strong></a></li>
<li><a href="http://electricpineapple.net/2010/04/14/making-the-most-of-your-toy-robot-part-4-of-4-%E2%80%93-docks-and-beacons/"><strong>Docks and Beacons</strong></a></li>
</ul>
<p><br/><br />
This is on the side of the Rovio box:</p>
<p><a href="http://electricpineapple.net/wp-content/uploads/2010/01/notatoy.png"><img class="alignnone size-full wp-image-195" title="notatoy" src="http://electricpineapple.net/wp-content/uploads/2010/01/notatoy.png" alt="This product is not a toy." width="270" height="259" /></a></p>
<p>I will be proving this incorrect.</p>
]]></content:encoded>
			<wfw:commentRss>http://electricpineapple.net/2010/01/30/making-the-most-of-your-toy-robot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
