<?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>prezzey.net * Bogi Takács &#187; eyetracking</title>
	<atom:link href="http://www.prezzey.net/tag/eyetracking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.prezzey.net</link>
	<description></description>
	<lastBuildDate>Sun, 05 Feb 2012 01:49:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>luvcview for fun and for profit</title>
		<link>http://www.prezzey.net/2009/luvcview0/</link>
		<comments>http://www.prezzey.net/2009/luvcview0/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 00:19:35 +0000</pubDate>
		<dc:creator>prezzey</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[eyetracking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://gemeskut.net/prezzey/?p=43</guid>
		<description><![CDATA[(I&#8217;m moving random Linux stuff from my private journal to here, it&#8217;s a bit chaotic at present, but bear with me. And yes, there will be artwork, I know everyone wants the artwork and not random juicy bits of Linux! ) This entry is about using luvcview under Linux for some very simplistic video recording [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">(I&#8217;m moving random Linux stuff from my private journal to here, it&#8217;s a bit chaotic at present, but bear with me. And yes, there will be artwork, I know everyone wants the artwork and not random juicy bits of Linux! <img src='http://www.prezzey.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  )</p>
<p style="text-align: justify;">This entry is about using luvcview under Linux for some <strong>very simplistic video recording for your eye tracker</strong>, or any other purpose. I discovered these things while I was trying to set up the <a href="http://thirtysixthspan.com/openEyes/software.html">visible spectrum Starburst algorithm</a>, but after trying out several algorithms I decided to use a different one&#8230;  so I don&#8217;t know if these will be of any use to anyone! Still, here goes.</p>
<p style="text-align: justify;"><span id="more-43"></span></p>
<p style="text-align: justify;">Once you&#8217;ve bought a webcam (which will be the subject of a different post) you can test it out using luvcview, a very simple video app. (Remember, you want to test with something simple, and if it works, you can move on to something more complicated.) This little Linux app is even suited to recording two concurrent video streams for your eyetracker, try this:</p>
<p style="text-align: justify;"><em>luvcview -d /dev/video1 -i 30 -o videoA.avi<br />
luvcview -d /dev/video0 -i 30 -o videoB.avi</em></p>
<p style="text-align: justify;">luvcview saves <strong>config</strong> with F1, loads with F2! To say this is underdocumented is an understatement &#8211; it&#8217;s not in the help or any of the obvious places, it took me half an hour to find it.</p>
<p style="text-align: justify;">Here is a sample config file. I confess I have no idea where I found it &#8211; Google only brings me up the source code for luvcview.</p>
<p style="text-align: justify;"><em>id         value      # luvcview control settings configuration file<br />
9963776    128        # name:Brightness                       type:1 min:0     max:255   step:1     def:128<br />
9963777    32         # name:Contrast                         type:1 min:0     max:255   step:1     def:32<br />
9963778    32         # name:Saturation                       type:1 min:0     max:255   step:1     def:32<br />
9963788    1          # name:White Balance Temperature, Auto  type:2 min:0     max:1     step:1     def:1<br />
9963795    255        # name:Gain                             type:1 min:0     max:255   step:1     def:0</em></p>
<p style="text-align: justify;">Unfortunately there is no way (that I could find) to save<strong> exposure settings</strong> in luvcview. This is really annoying, because one of the webcams I used required the exposure to be set to a nonstandard setting to capture at 30 fps.</p>
<p style="text-align: justify;">I tried and tried and tried to get <strong>two streams</strong> to start recording at the very same time (either with luvcview or something more complicated) and I couldn&#8217;t find a good solution &#8211; I wasted a whole day with this, but then I realized Joel Clemens who made <a href="http://joelclemens.colinr.ca/eyetrack/software.html">the Windows version of Starburst </a>couldn&#8217;t find one either:</p>
<blockquote>
<p style="text-align: justify;">- While recording your eye tracking videos, be sure to flash the user with a camera flash or equivalent strobe to allow a spot where you can see where to sync the videos. (this is because it is not reasonable to assume that we can start recording from the 2 cameras at exactly the same time)</p>
</blockquote>
<p style="text-align: justify;">So I was a bit relieved <img src='http://www.prezzey.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  His solution worked very well for me in practice. I simply used my cell phone camera to produce a <strong>flash</strong>, and then found the first frame and cut both video streams there. (I haven&#8217;t tried his Windows port of Starburst because I only have Matlab for Linux &#8211; but I have to say his documentation was very useful even for the Linux version!)</p>
<p style="text-align: justify;">Simply using the camera flash method and luvcview to record two streams produces two nice streams which can be input to Starburst&#8230; but Starburst will be the subject of a separate post, IY&#8221;H.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prezzey.net/2009/luvcview0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bandwidth issues that might arise when building an eye tracker</title>
		<link>http://www.prezzey.net/2009/bandwidth-usbeyetracker/</link>
		<comments>http://www.prezzey.net/2009/bandwidth-usbeyetracker/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 20:54:51 +0000</pubDate>
		<dc:creator>prezzey</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[eyetracking]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://gemeskut.net/prezzey/?p=33</guid>
		<description><![CDATA[Maybe I&#8217;m just unlucky, but I ran into this problem head-on a few months back, and it took me a while to figure out exactly what was wrong, as none of the online howtos seemed to have any relevant information&#8230; so I&#8217;m posting a bit about that. I wanted to fit some of this on [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Maybe I&#8217;m just unlucky, but I ran into this problem head-on a few months back, and it took me a while to figure out exactly what was wrong, as none of the online howtos seemed to have any relevant information&#8230; so I&#8217;m posting a bit about that. I wanted to fit some of this on the conference poster I&#8217;m presenting this Friday (before Shabbes) but I couldn&#8217;t shoehorn everything into 90 x 150 cm and still keep it reasonably readable from a distance!</p>
<p style="text-align: justify;">What to do if you experience framedropping, glitches, etc. while recording from two USB webcams at the same time which are not present when you&#8217;re only recording from one of them? 1. Don&#8217;t panic 2. read this quick howto!<br />
<span id="more-33"></span>Basically you have two webcams taking images at a resolution of at least 640 x 480 at 30 frames per second. If you&#8217;re unlucky like me, then you end up in a situation where both cams work fine when used individually, but when both are plugged in, the video seems to stutter and drop frames, even though you have USB 2.0 slots. Unfortunately this situation was not covered on any of the low-cost eyetracking websites I came across. I was really stumped, at first I thought it was a driver issue with my Logitech webcams, but it arose both under Linux and under Windows, so eventually had to I rule that out.</p>
<p style="text-align: justify;">The real reason is that on some laptops (maybe even desktop computers&#8230;), all of the USB slots are assigned to the same USB bus. An USB bus is inside your computer, so normally you can&#8217;t tell by inspecting your laptop visually. <strong>Even slots on different sides of your laptop can be assigned to the same bus!<br />
</strong><br />
This is how to tell:</p>
<p style="text-align: justify;">1. Unplug all of your USB devices.<br />
2. Run the command &#8220;lsusb&#8221; under Linux. This shows you all of your USB buses.<br />
3. Plug one of your devices into one of the slots.<br />
4. Run lsusb again. The device should appear on the list, assigned to a specific bus.<br />
5. Unplug the device.<br />
6. Repeat 3-5 until you&#8217;ve found out which USB slots on your laptop connect to which buses. I have 3 slots, all of which belong to the same bus! (There might even be internal buses you can&#8217;t access without taking the laptop apart &#8211; in my laptop there is a built-in fingerprint reader which has its own bus all to itself, as you&#8217;ll see in the sample image below.)<br />
7. Connect both cams to USB slots which belong to different buses.<br />
8. Record!</p>
<p style="text-align: justify;">This is an example of what you should see when you&#8217;re finished &#8211; both cameras plugged in, each on a different bus (click to enlarge):</p>
<p style="text-align: justify;"><a href="http://gemeskut.net/prezzey/wp-content/uploads/2009/06/differentbuses2.png"><img class="size-medium wp-image-34 aligncenter" title="differentbuses2" src="http://gemeskut.net/prezzey/wp-content/uploads/2009/06/differentbuses2-300x124.png" alt="differentbuses2" width="300" height="124" /></a></p>
<p style="text-align: justify;">If you&#8217;re unlucky, all of the available slots belong to the same bus. Or maybe you have slots where your device does not fit (some laptops have slots in really unwieldy locations) or you just don&#8217;t want to unplug something. What to do now?</p>
<p style="text-align: justify;">The solution is to buy a PCMCIA to USB converter. These are reasonably cheap and most laptops have a PCMCIA slot where you can put them (or even two). Put the PCMCIA card into your laptop, boot up, plug one of your cams into a free USB slot and the other into the card. This way the data flow from both cameras won&#8217;t be directed through the same USB bus and you will hopefully experience smooth video on both.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">Disclaimer:</span><br />
This worked for me and is a cheap solution to a persistent problem I had when building my eye tracker. Still, no guarantees! It might not work for you. Try it at your own risk.</p>
<p style="text-align: justify;">Unfortunately there is a nasty followup to this, namely that the bandwidth required is quite a lot &#8211; take a look at <a href="http://en.wikipedia.org/wiki/List_of_device_bandwidths">device bandwidths on Wikipedia</a> and you can see that USB ranks quite high on the list. So if you want to make your head-mounted rig wireless, then Bluetooth is probably not an option, having much less bandwidth than USB (though I haven&#8217;t tried yet, but it looks futile). The ideal solution would be WUSB or the new third-generation Bluetooth protocol, but these are really &#8220;emerging technology&#8221; in the worst sense of the word &#8211; expensive, easy to break, hard to find, etc. Still, in a few years you will probably be able to do that in a relatively cheap and painless way, so keep this in mind!</p>
<p style="text-align: justify;">For the time being, if you really need to make your recording rig portable, you can mount your laptop on your back&#8230; I have an ultraportable, so this works for me! One might think Eee PCs or similar netbooks would also be suitable, but unfortunately video recording is quite processor-intensive, so you want a powerful computer (or some custom-built setup). And powerful ultraportables are really expensive (I didn&#8217;t buy mine for eye tracking either&#8230;). Anyway, most eye tracking these days is aimed at people sitting in front of a screen, not wandering around and interacting with random objects, so it&#8217;s probably not a problem if your rig is not wireless (it&#8217;s quite portable anyway). I just think it would be cool.</p>
<p style="text-align: justify;">Also, lots of eye trackers only use one camera, but I don&#8217;t like those setups &#8211; compensating for head movements is much easier if you have a scene camera in addition to the eye camera. Of course, I&#8217;m doing offline measurements&#8230; a lot depends on exactly what you want to do, and there is a tradeoff between accuracy and online processing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prezzey.net/2009/bandwidth-usbeyetracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introductory science post</title>
		<link>http://www.prezzey.net/2009/introductory-science-post/</link>
		<comments>http://www.prezzey.net/2009/introductory-science-post/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 20:33:05 +0000</pubDate>
		<dc:creator>prezzey</dc:creator>
				<category><![CDATA[sci]]></category>
		<category><![CDATA[eyetracking]]></category>
		<category><![CDATA[mákony]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://gemeskut.net/prezzey/?p=30</guid>
		<description><![CDATA[I have two scientific projects I&#8217;m involved in at present, I&#8217;m going to describe them briefly just for you to get the idea what the other posts in this category will be about, etc. Click to read more! I&#8217;m a doctoral student in Clinical Neuroscience at the Medical University of Vienna and my thesis is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I have two scientific projects I&#8217;m involved in at present, I&#8217;m going to describe them briefly just for you to get the idea what the other posts in this category will be about, etc. Click to read more!</p>
<p style="text-align: justify;"><span id="more-30"></span></p>
<p style="text-align: justify;">I&#8217;m a doctoral student in Clinical Neuroscience at the Medical University of Vienna and my thesis is about the computational modelling of visual attention in autism spectrum disorders (and hopefully eventual clinical applications, e.g., for diagnosis, etc.). The focus is on the modelling aspect &#8211; my advisor, Georg Dorffner, is a mathematician &#8211; but I wanted to gather some empirical data, and hence I have recently started looking into low-cost eye tracking. The reasoning was that since most of the thesis would be about the model ling work anyway, it might not make sense to buy a top-of-the-line eye tracker just to gather a bit of data. Also, I like building things, so why not?</p>
<p style="text-align: justify;">Unfortunately many of the claims are quite exaggerated when it comes to algorithm performance. Building an eye tracker (even a two-camera head-mounted setup with IR) is quite easy &#8211; much easier than most of the online tutorials would make you think -, but there are serious problems with software stability, reliability, or just accuracy in general. (Stability would be easier to fix&#8230;)</p>
<p style="text-align: justify;">I still think it is possible to gather data on the cheap, but you have to be tricky about it. One of the main reasons I set up this new website, and do so using a blog format, is that I want to rant about various aspects of building a cheap eye tracker ;]  I&#8217;m on the 5th PhD conference of the MUV today, I have a poster about building an eye tracker and choosing algorithms etc., but there are <em>so many</em> things that don&#8217;t fit on a poster, and generally the internet is a good place for, well duh, online tutorials. And I&#8217;m also interested in the exchange of ideas, etc., the comments section is there for a reason! (Yes, I&#8217;m looking at you!)</p>
<p style="text-align: justify;">I&#8217;m also a masters student in Theoretical Linguistics at Eötvös Loránd University in Budapest. I started this degree when I realized I was running out of available courses my psychology masters and I wanted to study something else while I was at it. (It was a scary snap decision. I wanted to do something else related to cognitive science because psychology just didn&#8217;t seem substantial enough by itself. At the time I was working part-time in a lab and I saw this from up close.) I&#8217;m now ABD and have been so for a year &#8211; I haven&#8217;t even been in Budapest since January! -, so I should really really finish my thesis and defend it ASAP, and then publish. I&#8217;ve already put a lot of effort into it so I don&#8217;t want to abandon it altogether, even though I&#8217;m now a doctoral student somewhere else.</p>
<p style="text-align: justify;">It is about a Construction Grammar model of Hungarian (not all of Hungarian, obviously&#8230;. but I aimed for a reasonably broad coverage) which has already been tested on psycholinguistic data for my psychology thesis and it worked fine. Now for my other thesis I&#8217;m making software which will allow everyone to use my model and build on it (add constructions, etc.). It will have a GUI (I&#8217;ve already made that part) and the only prerequisite for using it will be the ability to use XML. XML is easy! I&#8217;ve also written a lot of documentation&#8230; quite an amount of the thesis is essentially documentation so far.</p>
<p style="text-align: justify;">Basically you have a set of constructions in an XML file, and the software parses Hungarian sentences using these constructions and provides a Construction Grammar (-ish) representation. I&#8217;m saying &#8220;-ish&#8221; because no one really agrees on what Construction Grammar really is and how it should work in practice. The parser and construction matching algorithm is written in Python and I&#8217;m not a great programmer so this has taken up most of the time so far. But Python is useful and versatile, so any experience I gain with it is worthwhile I&#8217;d say. Besides, the video game I&#8217;m developing in my spare time also uses Python (and pygame and renpy) so the experience I gain in one should transfer to the other&#8230; in an ideal situation&#8230; well I don&#8217;t need to parse XML with Python for a video game!</p>
<p style="text-align: justify;">Anyway, the &#8220;meat&#8221; of it is in the construction declaration framework and the Python code that makes use of it, and the actual set of constructions. So far a lot of work went into defining the constructions the way I want them to be.</p>
<p style="text-align: justify;">I really want to finish my thesis this summer and defend it this winter. If I post here, that will hopefully help me with that, because then I will have this urge of &#8220;must-post-something&#8221; and if I haven&#8217;t made any advances I could post about, well, too bad. And there are very few linguists reading my personal blog which, when it is not about my thesis projects, is all about my little emo life. (Dear readers, you will be spared all that, this website is for my public projects. If you want to read about my daily aggravations, you will have to find a way to read my friends-only blog somewhere else, it&#8217;s not public and for good reason! My personal life just isn&#8217;t that interesting.) So anyway this seems a good place for myself to urge myself on, and hopefully get other people interested in the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.prezzey.net/2009/introductory-science-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

