<?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>eclecticc &#187; camera</title>
	<atom:link href="http://eclecti.cc/tag/camera/feed" rel="self" type="application/rss+xml" />
	<link>http://eclecti.cc</link>
	<description></description>
	<lastBuildDate>Sun, 05 Sep 2010 20:47:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>XBee Remote Trigger for CHDK Enabled Cameras</title>
		<link>http://eclecti.cc/wireless/xbee-remote-trigger-for-chdk-enabled-cameras</link>
		<comments>http://eclecti.cc/wireless/xbee-remote-trigger-for-chdk-enabled-cameras#comments</comments>
		<pubDate>Sun, 17 May 2009 02:36:03 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Wireless]]></category>
		<category><![CDATA[802.15.4]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[chdk]]></category>
		<category><![CDATA[xbee]]></category>
		<category><![CDATA[zigbee]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=258</guid>
		<description><![CDATA[I&#8217;ve been trying to get as much use as possible out of these XBees before I have to return them to my department. CHDK was perhaps the main reason I paid the premium for a Canon SD870, but I haven&#8217;t had time to play around with it until now. One of the features CHDK has [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://eclecti.cc/files/2009/05/img_2247.jpg"><img class="size-large wp-image-259 aligncenter" title="Had to borrow a camera for this shot" src="http://eclecti.cc/files/2009/05/img_2247-700x525.jpg" alt="XBee Trigger" width="700" height="525" /></a><br />I&#8217;ve been trying to get as much use as possible out of these XBees before I have to return them to my department.  <a href="http://chdk.wikia.com/wiki/CHDK" target="_blank">CHDK</a> was perhaps the main reason I paid the premium for a Canon SD870, but I haven&#8217;t had time to play around with it until now.  One of the features CHDK has enabled is <a href="http://chdk.wikia.com/wiki/USB_Remote_Cable" target="_blank">remote triggering</a> via the USB port on the camera.  Most solutions I&#8217;ve seen around the internet are wired or use hacked apart doorbells.  I thought it would be nice to have it both wireless and computer controlled.</p>
<p style="text-align: left;"><a href="http://eclecti.cc/files/2009/05/img_2257.jpg"><img class="size-large wp-image-260 aligncenter" title="This probably doesn't void your warranty..." src="http://eclecti.cc/files/2009/05/img_2257-700x525.jpg" alt="Battery Closeup" width="700" height="525" /></a><br />The entire project is almost absurdly simple, and the part count on the camera end is merely an XBee, a pin header to avoid soldering to it, a hacked apart mini USB cable, and a resistor.  The XBee is powered off of the camera&#8217;s onboard lithium ion by running wires straight off of the battery contacts.  Luckily, there is a hole in the battery door that I could route the ground and VCC wires through.  I stuck a 7.5 ohm resistor on VCC to pull it down a little to avoid burning the XBee, but it probably isn&#8217;t necessary.  The +5 line on USB is then just connected to one of the digital IO pins on the XBee, pin 7 in my case.  The XBee on the camera and the one on the computer are programmed into API mode.  All that is left is having a simple Python script using the <a href="http://code.google.com/p/python-xbee/" target="_blank">python-xbee</a> library to toggle the remote pin up and down to take a picture.  The main downside is the constant 50mA draw on the battery, though you could probably use some kind of sleep mode on the XBee to save power.</p>
<p><strong>Download: <a href="http://eclecti.cc/files/2009/05/trigger.py">XBee Trigger</a></strong></p>
<p><!-- bablooO --></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/wireless/xbee-remote-trigger-for-chdk-enabled-cameras/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reflection Rejection: A Pygame Camera Game</title>
		<link>http://eclecti.cc/videogames/reflection-rejection-a-pygame-camera-game</link>
		<comments>http://eclecti.cc/videogames/reflection-rejection-a-pygame-camera-game#comments</comments>
		<pubDate>Fri, 06 Feb 2009 21:37:38 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Video Games]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[game creation society]]></category>
		<category><![CDATA[pygame]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=196</guid>
		<description><![CDATA[Here is another Game Creation Society competition entry I wrote in an evening. The theme was &#8220;reflection&#8221;, and I took it literally. The game generates a jagged and changing world based on what a webcam sees. This of course, means that it requires a webcam supported by the Pygame Camera module, which should be just [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" title="Polygonal me looks happy." src="http://eclecti.cc/files/2009/02/reflection_rejection.png" alt="Reflection Rejection" /></p>
<p>Here is another <a href="http://www.gamecreation.org/forum/viewtopic.php?f=18&amp;t=140">Game Creation Society</a> competition entry I wrote in an evening.  The theme was &#8220;reflection&#8221;, and I took it literally.  The game generates a jagged and changing world based on what a webcam sees.  This of course, means that it requires a webcam supported by the Pygame Camera module, which should be just about any USB webcam that works in Linux.</p>
<p>In the game, you must steer the heart across the treacherous world without colliding with anything.  If you do, you start back at the beginning.  If you succeed, the heart gets bigger and you start again.  Note that in many cases, the worlds generated will actually be impossible, just like real life.</p>
<p>The game uses the latest <a href="http://www.pygame.org/wiki/cvs">Pygame out of SVN</a>, so I compiled it and included it locally for those who don&#8217;t have it.</p>
<p><strong>Download:<br />
<a href="http://eclecti.cc/files/2009/02/reflection_rejection.i386.tar.gz">Reflection Rejection i386</a><br />
<a href="http://eclecti.cc/files/2009/02/reflection_rejection.amd64.tar.gz">Reflection Rejection amd64</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/videogames/reflection-rejection-a-pygame-camera-game/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>v4l2 camera module now in Pygame SVN</title>
		<link>http://eclecti.cc/olpc/v4l2-camera-module-now-in-pygame-svn</link>
		<comments>http://eclecti.cc/olpc/v4l2-camera-module-now-in-pygame-svn#comments</comments>
		<pubDate>Sun, 28 Sep 2008 04:49:32 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[OLPC]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[v4l2]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=95</guid>
		<description><![CDATA[My Google Summer of Code Project has finally grown up and flown out of my personal git repo to enter the Pygame SVN. All development will now occur there, though I will leave my git up for archival purposes. The project is a module for Pygame to support v4l2 cameras. The impetus for this was [...]]]></description>
			<content:encoded><![CDATA[<p>My Google Summer of Code Project has finally grown up and flown out of my personal <a href="http://git.n0r.org">git repo</a> to enter the <a href="http://www.pygame.org/wiki/cvs">Pygame SVN</a>.  All development will now occur there, though I will leave my git up for archival purposes.</p>
<p>The project is a module for Pygame to support v4l2 cameras.  The impetus for this was to make the webcam on the OLPC XO usable without intimate knowledge of GStreamer, and to allow for some basic computer vision.  The module does, however, support many camera pixelformats beyond those used on the XO, and is pretty flexible to adding new ones.</p>
<p>At the moment, there is no support for v4l cameras beyond detecting that they are attached to the computer, and there is no support at all for Windows or OS X.  René Dudfield is starting work on Windows support using directshow.  OS X support will come eventually.</p>
<p>The API documentation for the module is pretty thorough, but I haven&#8217;t uploaded any tutorials or example scripts yet.  For now, you can look at some of the <a href="http://eclecti.cc/tag/pygame">scripts</a> I&#8217;ve posted on this blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/olpc/v4l2-camera-module-now-in-pygame-svn/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Living Pointillism packaged as an OLPC Activity</title>
		<link>http://eclecti.cc/olpc/living-pointillism-packaged-as-an-olpc-activity</link>
		<comments>http://eclecti.cc/olpc/living-pointillism-packaged-as-an-olpc-activity#comments</comments>
		<pubDate>Fri, 18 Jul 2008 02:23:05 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[OLPC]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[pointillism]]></category>
		<category><![CDATA[pygame]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=73</guid>
		<description><![CDATA[I packaged the script I wrote a few posts back as a .xo file that can be installed on an OLPC XO. This isn&#8217;t really because the script itself is that great, but because I wanted to test a way to deliver the Pygame stuff I&#8217;m working on for GSoC for the months until my [...]]]></description>
			<content:encoded><![CDATA[<p>I packaged the <a href="http://eclecti.cc/bytes/living-pointillism-a-pygame-webcam-script">script I wrote a few posts back</a> as a .xo file that can be installed on an OLPC XO.  This isn&#8217;t really because the script itself is that great, but because I wanted to test a way to deliver the Pygame stuff I&#8217;m working on for GSoC for the months until my code is merged, Pygame 1.9 is released, and the package is included on XO&#8217;s.  This also explains why a 2KB Python script is now a 750KB .xo that takes up over 2MB when installed.</p>
<p>So, while the Activity itself just runs the Living Pointillism script, the activity directory (/home/olpc/Activities/Pointillism.activity/ on my XO running release ~690) contains the whole Pygame library with my modifications to date.  So, you can just drop scripts (like <a href="http://eclecti.cc/olpc/pixel-perfect-collision-between-real-and-virtual-objects">these</a> or <a href="http://git.n0r.org/?p=pygame-nrp;a=tree;f=examples/camera">these</a>) that use pygame into that directory and run them from there, and they will use the local pygame instead of the one installed on the XO.  This saves you from having to install all the stuff necessary to compile pygame on an XO.</p>
<p><strong>Download: <a href='http://eclecti.cc/files/2008/07/Pointillism-1.xo'>Living Pointillism</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/olpc/living-pointillism-packaged-as-an-olpc-activity/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pixel Perfect Collision between Real and Virtual Objects in Pygame</title>
		<link>http://eclecti.cc/olpc/pixel-perfect-collision-between-real-and-virtual-objects</link>
		<comments>http://eclecti.cc/olpc/pixel-perfect-collision-between-real-and-virtual-objects#comments</comments>
		<pubDate>Thu, 17 Jul 2008 02:10:13 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[OLPC]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[collision]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[vision]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=62</guid>
		<description><![CDATA[The Quick Version: I wrote a few scripts to test the possibility of using pixel perfect collision detection in pygame to allow for interactions between real life and on screen objects.  They require the installation of my branch of pygame, which includes support for v4l2 cameras.  The download links for the scripts (including OLPC versions) [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" title="A rare screenshot not showing any glitches. :p" src="http://eclecti.cc/files/2008/07/bouncy_ball.png" alt="bouncy ball" /></p>
<p style="text-align: left;"><strong>The Quick Version:<br />
</strong>I wrote a few scripts to test the possibility of using pixel perfect collision detection in pygame to allow for interactions between real life and on screen objects.  They require the installation of my branch of pygame, which includes support for v4l2 cameras.  The download links for the scripts (including OLPC versions) and pygame source are at the bottom of the post.</p>
<p style="text-align: left;"><strong>The Verbose and Occasionally Tangential Version:</strong></p>
<p style="text-align: left;">Joel Stanley of OLPC sent me a patch for my GSoC project a few days ago, along with a link to a <a href="http://picasaweb.google.com/joel.stan/California/photo#5109972492706149618" target="_blank">picture of an exhibit</a> at The Tech Museum of Innovation in San Jose, in which a person can manipulate virtual falling sand with his or her shadow.  That is exactly the kind of killer tech demo I&#8217;ve been looking for for my project.  The kind of thing that anyone could pick up in an instant and realize the beauty of human computer interaction.  Of course, the museum setup had a controlled environment, a projector, a screen, and probably a whole lot of processing power.  I have hundreds of thousands of kids around the world on 433mhz laptops.</p>
<p style="text-align: left;">At first, in response to Joel&#8217;s email, I had just planned to describe how to get the equivalent of the shadow.  It obviously could not require a projector, a screen, a uniformly colored background (green screen), or even a consistant source of light to project a shadow.  Instead, this requires an initial calibration step.  When the scripts start, they wait for the user to hit a button.  The user should then get out of view of the camera, so it only sees the background.  It then waits a couple seconds and takes a picture of the background.  The shadow is then created by thresholding frames currently being captured against the original background image.  This actually works pretty well as long as the background isn&#8217;t moving.  So, play it with the camera facing a wall if possible.</p>
<p style="text-align: left;">I had planned to just leave it at that, but then I figured since I already have that written, might as well just add a few lines of code to see if I could do pixel collisions between the shadow and objects on screen.  Nothing complicated like sand, just a bubble on screen that the user pops.  When this worked, I decided to extend it by having it place a new bubble on a random spot of the screen whenever one is popped.  A few minutes later, my friend stopped by and asked what the hell I was doing jumping around in the middle of the room.  I told her about the vision stuff, and then we both started jumping around in the middle of the room, popping fake bubbles.  Who would have thought something that simple could be fun?  That script is Pop Bubbles; you can download it at the bottom of the post and jump around your own room.</p>
<p style="text-align: left;">I thought I might be finished there, but it was still a far cry from the sand demo that Joel saw.  I decided making the bubble move could be fun, so I added a fixed &#8220;velocity&#8221; of pixels that the bubble would move every frame if it wasn&#8217;t popped.  It would be pretty silly if it kept going off the edge of the screen, so turned the edges into &#8220;walls&#8221; that would reverse the x or y velocity if the ball hit them.  I then tried adding &#8220;gravity&#8221; by having the y velocity increase one step downward each frame, which turned the bubble into a ball.  Then I added some inelasticity by decreasing the velocity a little upon impacting walls.  Since the bubble was now pretty much a bouncy ball, I made it no longer pop upon hitting the shadow.  Instead, it would bounce off the shadow in the opposite direction of where the shadow hit the ball, also adding some more velocity.  By this point, I had a hideous doppelganger of physics that would make Newton wish he never saw an apple tree.  This is what Bouncy Ball is, at the bottom of the post.  Try it at your own risk.  It is absurdly glitchy, and really only responds well to slow movements.</p>
<p style="text-align: left;">This still isn&#8217;t quite what the sand demo is, but I think it comes close enough to prove that it would be possible in Pygame.  The biggest thing that is necessary is a real physics engine, which Zhang Fan is currently working on for Pygame as a GSoC project.  Its likely that I will need to extend the bitmask module in pygame to make things like pinching an object possible.  If anyone wants to improve this stuff, please do, there is a lot of room for it.  I&#8217;d be happy to help out any way I can.  I do hope to have something closer to the sand demo by the end of the summer.</p>
<p style="text-align: left;">As a note to OLPC users, I know its pretty inconvenient to have to build the library on the XO.  I&#8217;m still working on packaging an .rpm and an .xo that contains all of my demo scripts.  Also, for now, to get it running at a usable speed on the XO, it has to be at 320&#215;240, which makes it pretty un-immersive, but I&#8217;m working on ways to scale it up without sacrificing much performance.</p>
<p style="text-align: left;"><strong>Download Python Scripts</strong>:<br />
<a href="http://eclecti.cc/files/2008/07/bouncy_ball.py">Bouncy Ball</a><br />
<a href="http://eclecti.cc/files/2008/07/bouncy_ball_olpc.py">Bouncy Ball (OLPC)</a><br />
<a href="http://eclecti.cc/files/2008/07/pop_bubbles.py">Pop Bubbles</a><br />
<a href="http://eclecti.cc/files/2008/07/pop_bubbles_olpc.py">Pop Bubbles (OLPC)</a><br />
<strong>Download Pygame with camera module source:</strong><br />
<a href="http://eclecti.cc/files/2008/07/pygame-181pre.tar.gz">Pygame 1.8.1 with camera module</a><br />
<strong>Checkout Pygame with camera from git:</strong><br />
git clone git://git.n0r.org/git/pygame-nrp</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/olpc/pixel-perfect-collision-between-real-and-virtual-objects/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Living Pointillism: A pygame webcam script</title>
		<link>http://eclecti.cc/olpc/living-pointillism-a-pygame-webcam-script</link>
		<comments>http://eclecti.cc/olpc/living-pointillism-a-pygame-webcam-script#comments</comments>
		<pubDate>Sun, 22 Jun 2008 06:00:35 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[OLPC]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[pointillism]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=58</guid>
		<description><![CDATA[Living Pointillism is a quick little example script I wrote to showcase the camera module I&#8217;m writing for pygame through GSoC.  It places a few dozen points (it automatically changes the number based on the framerate) for every frame of video, so the image is only clear if everything is perfectly still.  This also results [...]]]></description>
			<content:encoded><![CDATA[<p><img title="Apologies to Georges Seurat" src="http://eclecti.cc/files/2008/06/pointillism.png" alt="Living Pointillism" /></p>
<p>Living Pointillism is a quick little example script I wrote to showcase the camera module I&#8217;m writing for pygame through GSoC.  It places a few dozen points (it automatically changes the number based on the framerate) for every frame of video, so the image is only clear if everything is perfectly still.  This also results in some interesting visual effects when things are in motion.  The screenshot above doesn&#8217;t quite capture the essence of it, but I don&#8217;t have the kind of bandwidth here to upload a video.</p>
<p>To use it, you need pygame with the camera module, which is currently only available from my repository: <a href="http://git.n0r.org/?p=pygame-nrp;a=summary">http://git.n0r.org/?p=pygame-nrp;a=summary</a></p>
<p>It runs fairly well on the OLPC XO too, and I&#8217;ll release an Activity for it along with an rpm of my branch of pygame soon.</p>
<p>Download: <a href="http://eclecti.cc/files/2008/06/pointillism.py">Living Pointillism</a></p>
<p><strong>Update:</strong> This is now available packaged as <a href="http://eclecti.cc/olpc/living-pointillism-packaged-as-an-olpc-activity">an OLPC Activity</a>.</p>
<p><strong>Update 2:</strong> Pygame with the camera module should now be downloaded from the <a href="http://www.pygame.org/wiki/cvs">Pygame SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/olpc/living-pointillism-a-pygame-webcam-script/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
