<?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>Dino 2.0 &#187; experiment</title>
	<atom:link href="http://www.dino.co.uk/labs/tag/experiment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dino.co.uk/labs</link>
	<description>Better out than in...</description>
	<lastBuildDate>Sat, 04 Feb 2012 22:55:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Stitched up by my own webcam!</title>
		<link>http://www.dino.co.uk/labs/2009/stitched-up-by-my-own-webcam/</link>
		<comments>http://www.dino.co.uk/labs/2009/stitched-up-by-my-own-webcam/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 02:11:41 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=319</guid>
		<description><![CDATA[Another strange webcam experiment! Click the image to launch it. I take the raw cam feed, find what changes between frames and add a threshold filter to colour the bits that change to a solid red. I then simply loop through the pixels to see if any are red then use the pixel position to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dino.co.uk/blogbox/flash/webcam_string/webcam_string2.swf"><img class="alignnone" title="Webcam String" src="http://www.dino.co.uk/blogbox/flash/webcam_string/webcam_string.jpg" alt="" width="450" height="298" /></a></p>
<p>Another strange webcam experiment! Click the image to <a href="http://www.dino.co.uk/blogbox/flash/webcam_string/webcam_string2.swf" target="_blank">launch it</a>.</p>
<p>I take the raw cam feed, find what changes between frames and add a threshold filter to colour the bits that change to a solid red. I then simply loop through the pixels to see if any are red then use the pixel position to draw lines to and from, sampling the original image to get the correct line colour. Completely no use to anyone&#8230; but looks nice enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2009/stitched-up-by-my-own-webcam/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stabbing an LCD screen experiment</title>
		<link>http://www.dino.co.uk/labs/2009/stabbing-an-lcd-screen-experiment/</link>
		<comments>http://www.dino.co.uk/labs/2009/stabbing-an-lcd-screen-experiment/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 22:34:57 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Musings]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[knife]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[stab]]></category>
		<category><![CDATA[stupid]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=266</guid>
		<description><![CDATA[Ever wondered what happens when you cut an LCD screen with a knife? Probably not, but I did. Luckily, I managed to get hold of a damaged monitor and I seized the chance&#8230; NOTE 1: The monitor had a fault anyway, it was due to be thrown out. NOTE 2: DON&#8217;T TRY THIS YOURSELF! It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/eKM4dqNnkLI&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/eKM4dqNnkLI&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span>Ever wondered what happens when you cut an LCD screen with a knife? Probably not, but I did. Luckily, I managed to get hold of a damaged monitor and I seized the chance&#8230;</span></p>
<p><strong>NOTE 1</strong>: The monitor had a fault anyway, it was due to be thrown out.<br />
<strong>NOTE 2</strong>: DON&#8217;T TRY THIS YOURSELF! It&#8217;s pretty dumb.<br />
<strong>NOTE 3</strong>: The weird effect seen on parts of the screen is due to a polarising film covering the entire screen. Under that is the LCD layer and under that, a hard plastic layer with light behind it.<br />
<strong>NOTE 4</strong>: The &#8216;Liquid Crystal&#8217; wasn&#8217;t really liquid. Nothing got wet. Bit disappointed.</p>
<p>Thanks to <a href="http://www.interactionfigure.nl/" target="_blank">Jop</a> for the camera work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2009/stabbing-an-lcd-screen-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webcam background removal in Flash</title>
		<link>http://www.dino.co.uk/labs/2008/webcam-background-removal-in-flash/</link>
		<comments>http://www.dino.co.uk/labs/2008/webcam-background-removal-in-flash/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 03:32:13 +0000</pubDate>
		<dc:creator>Dino</dc:creator>
				<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[bitmapData]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[removal]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.dino.co.uk/labs/?p=231</guid>
		<description><![CDATA[If you&#8217;re a fan of the EyeToy or you&#8217;ve just got You&#8217;re In the Movies on Xbox 360, you&#8217;ll know what this is all about. How to remove yourself from a web cam image and superimpose you on another background. The mighty Jop had a bit of a testbed working and I thought I&#8217;d get [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a fan of the EyeToy or you&#8217;ve just got You&#8217;re In the Movies on Xbox 360, you&#8217;ll know what this is all about. How to remove yourself from a web cam image and superimpose you on another background.</p>
<p>The mighty <a href="http://www.interactionfigure.nl/" target="_blank">Jop</a> had a bit of a testbed working and I thought I&#8217;d get the old brain working again and have a tinker. It&#8217;s not pretty code but it&#8217;s available below if you&#8217;re interested in a few pointers. It&#8217;s also not that good, but if it inspires you to do it better (I.e. properly) then it&#8217;s done its job.</p>
<p>If the web cam doesn&#8217;t initailise. Try this <a href="http://www.dino.co.uk/blogbox/flash/webcam_removal/index.html" target="_blank">link</a>:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="221" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="swliveconnect" value="true" /><param name="src" value="http://www.dino.co.uk/blogbox/flash/webcam_removal/webcam_subtract.swf" /><embed type="application/x-shockwave-flash" width="450" height="221" src="http://www.dino.co.uk/blogbox/flash/webcam_removal/webcam_subtract.swf" swliveconnect="true"></embed></object></p>
<p>In a nutshell:</p>
<p>1: Grab camera feed</p>
<p>2: Take a snap of the background</p>
<p>3: Use a &#8216;difference&#8217; filter on them both to fighure out which pixels have changed the most</p>
<p>4: Use a &#8216;threshold&#8217; filter to remove all the pixels that haven&#8217;t changed much</p>
<p>5: ColourTransform the resulting pixels to black</p>
<p>6: Apply a slight blur to help make it less jagged</p>
<p>7: Cache the resulting image as a bitmap (so it can be used as a mask) and put it over a copy of the live feed</p>
<p>8: Cache the live feed as a bitmap and apply the mask</p>
<p>9: And repeat using an interval or similar</p>
<p>Here&#8217;s the main function:</p>
<p><em>function takeSnapshot() {<br />
<span style="color: #0000ff;"> //grab the cam and render it into a snapshot bitmapData obj</span><br />
snapshot.draw(output_vid);<br />
}</em></p>
<p><em>function checkVid() {<br />
<span style="color: #0000ff;">//grab live cam</span><br />
liveData.draw(output_vid);<br />
</em><em> <span style="color: #0000ff;">// grab snapshot</span><br />
</em><em>maskData.draw(snapshot);<br />
<span style="color: #0000ff;">// apply difference to 2 images</span><br />
maskData.draw(liveData, new Matrix(), new ColorTransform(), &#8216;difference&#8217;);<br />
<span style="color: #0000ff;">// remove all unchanged pixels. Make them transparent</span><br />
maskData.threshold(maskData, new Rectangle(0, 0, output_vid.width, output_vid.height), new Point(0, 0), &#8220;&lt;=&#8221;, (threshVal/100)*0x00ffffff, 0&#215;00000000, 0x00ffffff, true);<br />
<span style="color: #0000ff;">// colour what&#8217;s left black</span><br />
maskData.draw(maskData, new Matrix(), new ColorTransform(0, 0, 0, 1, 0, 0, 0, 0))<br />
<span style="color: #0000ff;">// Blur to improve quality</span><br />
maskData.applyFilter(maskData, maskData.rectangle, new Point(0, 0), blurFiltr);<br />
resultData.draw(liveData);<br />
<span style="color: #0000ff;">// cache the resulting mask and apply it to the live feed</span><br />
mask_mc.cacheAsBitmap = result_mc.cacheAsBitmap = true;<br />
result_mc.setMask(mask_mc);</em></p>
<p><em>}</em></p>
<p>Source is <a href="http://www.dino.co.uk/blogbox/flash/webcam_removal/webcam_subtract.zip" target="_blank">here</a>. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dino.co.uk/labs/2008/webcam-background-removal-in-flash/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

