<?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; opencv</title>
	<atom:link href="http://eclecti.cc/tag/opencv/feed" rel="self" type="application/rss+xml" />
	<link>http://eclecti.cc</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 06:31:30 +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>Maker Ant Farm: Minecraft Skin Generation with a Kinect</title>
		<link>http://eclecti.cc/computervision/maker-ant-farm-minecraft-skin-generation-with-a-kinect</link>
		<comments>http://eclecti.cc/computervision/maker-ant-farm-minecraft-skin-generation-with-a-kinect#comments</comments>
		<pubDate>Mon, 27 Jun 2011 02:02:25 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[kinect]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[nite]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[openni]]></category>
		<category><![CDATA[panda3d]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=795</guid>
		<description><![CDATA[www.youtube.com/watch?v=VQJzbT6ldtY Since my seemingly fragile 3D printer had never left my desk before and even in prime condition could only print an object every 10 minutes or so, I decided that I needed a backup project for the Bay Area Maker Faire last month.  I conscripted Will to help me out on a purely software [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=VQJzbT6ldtY&#038;fmt=18">www.youtube.com/watch?v=VQJzbT6ldtY</a></p>
<p><a href="http://www.youtube.com/watch?v=VQJzbT6ldtY&#038;fmt=18"><img src="http://img.youtube.com/vi/VQJzbT6ldtY/default.jpg" width="130" height="97" border=0></a></p>
<p>Since my seemingly fragile 3D printer had never left my desk before and even in prime condition could only print an object every 10 minutes or so, I decided that I needed a backup project for the <a href="http://makerfaire.com/bayarea/2011/">Bay Area Maker Faire</a> last month.  I conscripted <a href="http://compbrain.net">Will</a> to help me out on a purely software Kinect based project.  After downscoping our ideas several times as the Faire weekend approached, we eventually settled on generating <a href="http://www.minecraft.net">Minecraft</a> player skins of visitors.  The printer ended up working fine (and more reliably than the software only project), but the Minecraft &#8220;Maker Ant Farm&#8221; was more of a crowd pleaser.</p>
<p>A visitor would stand in front of the Kinect and enter fieldgoal/psi calibration pose.  We used OpenNI and NITE to find their pose and segment them out of the background for a preview display.  Using OpenCV, we mapped body parts to the corresponding sections of the <a href="http://www.minecraftwiki.net/wiki/Skin">Minecraft skin texture</a>.  Since we could only see the fronts and parts of the sides of a person, we just made up what the back would look like based on the front.  This was of course imprecise and resulted heads that often looked like they had massive bald spots.  Rather than trying to write some kind of intelligent texture fill algorithm on a short schedule, we just gave all of the skins yellow hard hats (not blonde hair, contrary to popular opinion).  After generating the skin, we loaded it back onto <a href="http://www.minecraftforum.net/topic/9581-minecraft-blender-rig-%E2%80%93-show-off-your-skins-in-style/">ShnitzelKiller&#8217;s player rig</a> in Panda3D.  I had planned on writing full skeletal tracking for the rig, but ran out of time and settled on just having it follow the position and rotation of the user and perform an animated walk.  After walking around a bit watching a low res version of him or herself, the user could enter in a Twitter handle or email address to keep the skin.  The blocky doppelgänger was then dropped onto a Minecraft server instance we had running as a bot that did simple things like walk around in circles or drown.</p>
<p><img class="aligncenter size-full wp-image-801" title="Its totally a hard hat, and not blonde hair." src="http://eclecti.cc/files/2011/06/minecraft-e1309139869775.png" alt="Minecraft Skin" width="699" height="539" /></p>
<p>Despite some crashiness in NITE and the extremely short timeframe we wrote the project in, it ended up working reasonably well.  Thanks to the low resolution style and implied insistence on imagination in Minecraft, the players avoid looking like the ghastly zombies in <a href="http://marketplace.xbox.com/en-US/Product/Kinect-Me/66acd000-77fe-1000-9115-d80258480814">Kinect Me</a>.  You can see examples of some of the generated skins on <a href="https://twitter.com/#!/MakerAntFarm">@MakerAntFarm</a>.  I hate not releasing code, but I almost hate releasing this code more.  It is very likely to be the worst I have ever hacked together, and I can&#8217;t help but suspect it will be held against me at some point.  Nonetheless, for the greater good, it&#8217;s <a href="https://github.com/nrpatel/Minecraft-Maker-Ant-Farm">up on github</a>.  There are vague instructions on how one might use it in the <a href="https://github.com/nrpatel/Minecraft-Maker-Ant-Farm/blob/master/README">README</a>.  Good luck, and I&#8217;m sorry.</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/computervision/maker-ant-farm-minecraft-skin-generation-with-a-kinect/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evil Eye: Microvision SHOWWX as a Face Tracking Eyeball</title>
		<link>http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball</link>
		<comments>http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball#comments</comments>
		<pubDate>Sat, 10 Apr 2010 22:04:48 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Computer Graphics]]></category>
		<category><![CDATA[face tracking]]></category>
		<category><![CDATA[microvision]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[projector]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[showwx]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=502</guid>
		<description><![CDATA[www.youtube.com/watch?v=uRnBg9gflZM This idea, like most good ones, came to me while I was in my bathroom.  I recently took delivery of a Microvision SHOWWX laser pico projector, and I was trying to come up with a quick project to show the cool stuff it could do.  I noticed that the light above my mirror was [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">
<p><a href="http://www.youtube.com/watch?v=uRnBg9gflZM&#038;fmt=18">www.youtube.com/watch?v=uRnBg9gflZM</a></p>
<p><a href="http://www.youtube.com/watch?v=uRnBg9gflZM&#038;fmt=18"><img src="http://img.youtube.com/vi/uRnBg9gflZM/default.jpg" width="130" height="97" border=0></a></p>
</p>
<p style="text-align: justify;">This idea, like most good ones, came to me while I was in my bathroom.  I recently took delivery of a <a href="http://www.microvision.com/showwx/index.html">Microvision SHOWWX</a> laser pico projector, and I was trying to come up with a quick project to show the cool stuff it could do.  I noticed that the light above my mirror was diffused by a large frosted glass dome, which led to this strange project.  It&#8217;ll probably make more sense around Halloween.</p>
<p style="text-align: justify;"><a href="http://eclecti.cc/files/2010/04/showwx.jpg"><img class="aligncenter size-large wp-image-503" title="The shot is blurry because my tripod is in the picture." src="http://eclecti.cc/files/2010/04/showwx-700x466.jpg" alt="Microvision SHOWWX Setup" width="700" height="466" /></a></p>
<p style="text-align: justify;">The software is pretty similar to what I wrote the last time I did <a href="http://eclecti.cc/olpc/pyeyes-xeyes-in-python-with-face-tracking">face tracking</a>:  OpenCV&#8217;s very convenient Haar feature detection along with Pygame to do the image display.  I tried taking a picture of my own eye, but Flickr user Sarah Cartwright&#8217;s is <a href="http://www.flickr.com/photos/sarahcartwright/369063792/">much more photogenic</a> and available under Creative Commons Attribution-Share Alike.</p>
<p style="text-align: justify;"><a href="http://eclecti.cc/files/2010/04/evileye.jpg"><img class="aligncenter size-large wp-image-504" title="Now I just need to figure out how to get the camera inside the dome." src="http://eclecti.cc/files/2010/04/evileye-700x466.jpg" alt="Inside the Eye" width="700" height="466" /></a></p>
<p style="text-align: justify;">A regular pico projector would probably work as well, but the contrast ratio on this thing means it looks like the iris is being projected by itself.  I have some much cooler projects planned that will really take advantage of the focus free nature of the laser projector.  In the mean time, the code for this project is available below.  The image is CC A-SA, the code is <a href="http://creativecommons.org/licenses/publicdomain/">public domain</a>, and the Haar file is Intel License Agreement like the rest of <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a>.  I also attached the Python script itself for perusal by search engines or folks who just want to see the code.</p>
<p style="text-align: justify;"><strong>Download:<br />
<a href="http://eclecti.cc/files/2010/04/EvilEye.zip">EvilEye.zip</a><br />
<a href="http://eclecti.cc/files/2010/04/EvilEye.py">EvilEye.py</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/computergraphics/evil-eye-microvision-showwx-as-a-face-tracking-eyeball/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>xeyes with Face Detection</title>
		<link>http://eclecti.cc/bits/xeyes-with-face-detection</link>
		<comments>http://eclecti.cc/bits/xeyes-with-face-detection#comments</comments>
		<pubDate>Thu, 10 Apr 2008 07:31:49 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[OLPC]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[pygame]]></category>
		<category><![CDATA[vision]]></category>
		<category><![CDATA[xeyes]]></category>

		<guid isPermaLink="false">http://eclecti.cc/?p=37</guid>
		<description><![CDATA[I&#8217;ve been writing xeyes with face detection using opencv as a crash course in pygame.  Pictures and code tomorrow. (1)]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing xeyes with face detection using opencv as a crash course in pygame.  Pictures and code tomorrow.</p>
<a href="http://eclecti.cc/bits/xeyes-with-face-detection" rel="bookmark" class="asides-permalink" title="Permanent Link to xeyes with Face Detection">(1)</a>]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/bits/xeyes-with-face-detection/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Dirty Hack for OpenCV on the OLPC XO</title>
		<link>http://eclecti.cc/olpc/a-dirty-hack-for-opencv-on-the-olpc-xo</link>
		<comments>http://eclecti.cc/olpc/a-dirty-hack-for-opencv-on-the-olpc-xo#comments</comments>
		<pubDate>Sun, 23 Mar 2008 06:14:29 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[OLPC]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[ov7670]]></category>
		<category><![CDATA[XO]]></category>

		<guid isPermaLink="false">http://eclecti.cc/code/a-dirty-hack-for-opencv-on-the-olpc-xo</guid>
		<description><![CDATA[OpenCV has issues using the camera on the XO, rising from the way it negotiates color palette settings with the OV7670 v4l2 driver.  I haven&#8217;t delved deep enough into v4l2 yet to come up with a proper fix for either the driver or OpenCV.  However, I have a temporary fix that (probably) works fine but [...]]]></description>
			<content:encoded><![CDATA[<p>OpenCV has issues using the camera on the XO, rising from the way it negotiates color palette settings with the OV7670 v4l2 driver.  I haven&#8217;t delved deep enough into v4l2 yet to come up with a proper fix for either the driver or OpenCV.  However, I have a temporary fix that (probably) works fine but is very ugly.</p>
<p>The easy and dirty solution is to install the opencv, opencv-devel, and opencv-python packages with yum, to download the <a href="http://eclecti.cc/files/2008/03/libhighguiso100" title="libhighgui.so">libhighgui.so.1.0.0</a> that I compiled, and to copy it to /usr/lib/libhighgui.so.1.0.0.  In short:</p>
<blockquote><p>sudo yum install opencv opencv-devel opencv-python<br />
sudo wget  http://eclecti.cc/files/2008/03/libhighguiso100 -O /usr/lib/libhighgui.so.1.0.0</p></blockquote>
<p><span id="more-27"></span><br />
The details of the problem are that when using ioctl with VIDIOC_S_FMT to negotiate the correct fmt.pix.pixelformat, ioctl fails with EINVAL (error 22), even when all the values being supplied by OpenCV are the values that the OV7670 wanted anyway.  The temporary fix involves using VIDIOC_G_FMT instead to let the OV7670 tell OpenCV what it wants.  Luckily, what it wants, OpenCV can handle.  If you want to build OpenCV from source and fix it, you&#8217;ll need to change line 419 in otherlibs/highgui/cvcap_v4l.cpp to the following:</p>
<blockquote><p> if (-1 == xioctl (capture-&gt;deviceHandle, VIDIOC_G_FMT, &amp;capture-&gt;form))</p></blockquote>
<p>Unfortunately, there are other problems with building OpenCV on the XO. (aside from it being painfully slow to compile on)  One of the dependencies, gtk2-devel, currently will not install, <a href="http://dev.laptop.org/ticket/6650" target="_blank">a known bug</a>.  I got it to work with the following, but YMMV:</p>
<blockquote><p>yum -t &#8211;enablerepo=* install libXi-devel<br />
yum -t &#8211;enablerepo=* install gtk2-devel</p></blockquote>
<p>I also ran into a problem trying to compile python/swig support, but that may be from unrelated memory leaks&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/olpc/a-dirty-hack-for-opencv-on-the-olpc-xo/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Face Detection on the OLPC XO</title>
		<link>http://eclecti.cc/olpc/face-detection-on-the-olpc-xo</link>
		<comments>http://eclecti.cc/olpc/face-detection-on-the-olpc-xo#comments</comments>
		<pubDate>Thu, 20 Mar 2008 15:47:28 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[OLPC]]></category>
		<category><![CDATA[face detection]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[vision]]></category>
		<category><![CDATA[XO]]></category>

		<guid isPermaLink="false">http://eclecti.cc/code/face-detection-on-the-olpc-xo</guid>
		<description><![CDATA[Ok, here is some working code for face detection using the XO&#8217;s webcam.  It requires the opencv, opencv-python, and xawtv packages.  Xawtv can be skipped if you change it to use gstreamer instead, but gstreamer takes around 3 seconds to initialize the camera, take a picture, and save it.  Xawtv, on the other hand, takes [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img title="Thats me!" src="http://eclecti.cc/files/2008/03/face.jpg" alt="Sample Face Detection Image" /></p>
<p style="text-align: justify;">Ok, here is some working code for face detection using the XO&#8217;s webcam.  It requires the opencv, opencv-python, and xawtv packages.  Xawtv can be skipped if you change it to use gstreamer instead, but gstreamer takes around 3 seconds to initialize the camera, take a picture, and save it.  Xawtv, on the other hand, takes about a half second.  The face detection algorithm, from <a href="http://opencvlibrary.sourceforge.net/" target="_blank">OpenCV</a> itself takes anywhere from 0.1 seconds to 3 seconds depending on what parameters you choose.  I chose ones that seem to work almost all of the time and take about 0.25 seconds.</p>
<p style="text-align: justify;">Object detection is pretty fascinating stuff, and well beyond the scope of this blog post, so I&#8217;ll just refer you to <a href="http://prism2.mem.drexel.edu/~paul/openCv/openCvPart02.pdf" target="_blank">this pdf</a>.  By training and customizing Haar files, one could detect an endless possibility of objects.  Gesture detection and sign language to tex tare two of the more interesting possibilities.  If I can find image databases, I might try training a Haar filter for hand detection.</p>
<p style="text-align: justify;">This is basically just proof of concept code attached.  I&#8217;m going to try a v4l2 python library and package something up as a usable XO activity this weekend.  To run this, just put both of the files below in the same directory and run &#8220;python face.py&#8221;.  Assuming you&#8217;re on an XO and you have opencv, opencv-python, and xawtv installed, it should pause for a second while the camera turns on and captures a picture, and then display an image with any faces enclosed by green rectangles.  It works best if most of your head is within the image frame and there is a decent amount of light.</p>
<p style="text-align: justify;"><a title="Face detection script" href="http://eclecti.cc/files/2008/03/face.py">Face detection script</a><br />
<a title="The Haar cascade file that it uses" href="http://eclecti.cc/files/2008/03/haarcascade_frontalface_alt.xml">The Haar cascade file that it uses</a></p>
]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/olpc/face-detection-on-the-olpc-xo/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Face Detection using OpenCV on an OLPC XO</title>
		<link>http://eclecti.cc/bits/face-detection-using-opencv-on-an-olpc-xo</link>
		<comments>http://eclecti.cc/bits/face-detection-using-opencv-on-an-olpc-xo#comments</comments>
		<pubDate>Thu, 20 Mar 2008 05:10:34 +0000</pubDate>
		<dc:creator>nrp</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[face detection]]></category>
		<category><![CDATA[OLPC]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[vision]]></category>
		<category><![CDATA[XO]]></category>

		<guid isPermaLink="false">http://eclecti.cc/bits/face-detection-using-opencv-on-an-olpc-xo</guid>
		<description><![CDATA[I&#8217;m working on face detection and tracking using the webcam on the XO.  Expect code and pictures soon. (0)]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on face detection and tracking using the webcam on the XO.  Expect code and pictures soon.</p>
<a href="http://eclecti.cc/bits/face-detection-using-opencv-on-an-olpc-xo" rel="bookmark" class="asides-permalink" title="Permanent Link to Face Detection using OpenCV on an OLPC XO">(0)</a>]]></content:encoded>
			<wfw:commentRss>http://eclecti.cc/bits/face-detection-using-opencv-on-an-olpc-xo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.316 seconds -->

