<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>blog.jjhale.com</title>
	
	<link>http://blog.jjhale.com</link>
	<description>the blog of Joe Hale</description>
	<lastBuildDate>Tue, 14 Dec 2010 01:19:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jjhale" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jjhale" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Pupil Geometry</title>
		<link>http://blog.jjhale.com/2010/10/22/pupil-geometry/</link>
		<comments>http://blog.jjhale.com/2010/10/22/pupil-geometry/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 00:05:40 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[eye tracking]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=320</guid>
		<description><![CDATA[The beginnings of a pupil mapping model depending only on the eye image. Considering the properties of the ellipse describing the pupil in the image.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-326" title="Figure 3" src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_Eyeball_3-300x139.png" alt="" width="150" height="69" />I&#8217;ve been trying to reduce the number of free variables in the mapping between the position of the pupil in a eye-camera image and the point of gaze on a screen, given the head location of a person. Previously I was just fitting an ellipse to the pupil and using the location of its centre. This method did not use all of the information I&#8217;d justÂ obtainedÂ about the ellipse. In this post I explore one theoretical method of using the ellipse parameters.</p>
<p><span id="more-320"></span><br />
We can approximate the eyeball as a sphere with a circle on which corresponds to the pupil. We&#8217;ll describe the size of the pupil by the radius of the sphere <img src='http://s.wordpress.com/latex.php?latex=r&#038;bg=T&#038;fg=000000&#038;s=0' alt='r' title='r' class='latex' /> and the angle <img src='http://s.wordpress.com/latex.php?latex=%5Crho&#038;bg=T&#038;fg=000000&#038;s=0' alt='\rho' title='\rho' class='latex' /> between the lines from the centre of the sphere to the centre of the pupil and to any point on the edge of the pupil, see figure 1.</p>
<div id="attachment_324" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-324 " title="Figure 1 " src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_Eyeball_1.png" alt="" width="500" height="231" /><p class="wp-caption-text">Figure 1 - The major axis</p></div>
<p>If the eye is looking directly into the camera the pupil will appear to be circular (assuming minimal or corrected camera lens distortion). We will define the center of the pupil in the image plane in this case to be <img src='http://s.wordpress.com/latex.php?latex=%28x_o%2C%20y_o%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(x_o, y_o)' title='(x_o, y_o)' class='latex' />. Â Since the pupil will appear to be a circle all its axes are equal. The red and the blue lines in figure 1 have the same length. This length <img src='http://s.wordpress.com/latex.php?latex=a&#038;bg=T&#038;fg=000000&#038;s=0' alt='a' title='a' class='latex' /> can be calculated by:</p>
<div id="_mcePaste" style="text-align: center;">
<p><img src='http://s.wordpress.com/latex.php?latex=a%20%3D%202%20%5Csin%28%5Crho%29%20&#038;bg=T&#038;fg=000000&#038;s=0' alt='a = 2 \sin(\rho) ' title='a = 2 \sin(\rho) ' class='latex' />.</p>
<div style="text-align: center;">
<div id="attachment_325" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-325" title="Figure 2" src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_Eyeball_2.png" alt="" width="500" height="225" /><p class="wp-caption-text">Figure 2 - The rotated eye</p></div>
<p style="text-align: left;">As the eye turns away for the camera the pupil image will become elliptical. Consider the eye following some line on the image plane which passes through <img src='http://s.wordpress.com/latex.php?latex=%28x_o%2C%20y_o%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(x_o, y_o)' title='(x_o, y_o)' class='latex' /> by rotating the eye through an angle <img src='http://s.wordpress.com/latex.php?latex=%5Ctau&#038;bg=T&#038;fg=000000&#038;s=0' alt='\tau' title='\tau' class='latex' /> in the plane defined by our line and the center of rotation of the eye. The pupil will now appear to be an ellipse with its major axis the same length as before (the red line) but with a shorter minor axis.</p>
<p style="text-align: left;">The length of the minor axis <img src='http://s.wordpress.com/latex.php?latex=b&#038;bg=T&#038;fg=000000&#038;s=0' alt='b' title='b' class='latex' /> can be calculated from the internal angles of the quadrilateral to calculate the angle <img src='http://s.wordpress.com/latex.php?latex=%5Clambda&#038;bg=T&#038;fg=000000&#038;s=0' alt='\lambda' title='\lambda' class='latex' />. Note that <img src='http://s.wordpress.com/latex.php?latex=%5Clambda&#038;bg=T&#038;fg=000000&#038;s=0' alt='\lambda' title='\lambda' class='latex' /> is the angle BED and is equal to the angle BFC</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=2%20%5Cpi%20%3D%20%5Cfrac%7B%5Cpi%7D%7B2%7D%20%2B%20%5Cfrac%7B%5Cpi%7D%7B2%7D%20%2B%20%5Ctau%20%2B%5Cfrac%7B%5Cpi%7D%7B2%7D%20%2B%20%5Clambda&#038;bg=T&#038;fg=000000&#038;s=0' alt='2 \pi = \frac{\pi}{2} + \frac{\pi}{2} + \tau +\frac{\pi}{2} + \lambda' title='2 \pi = \frac{\pi}{2} + \frac{\pi}{2} + \tau +\frac{\pi}{2} + \lambda' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%5Clambda%20%3D%20%5Cfrac%7B%5Cpi%7D%7B2%7D%20-%20%5Ctau&#038;bg=T&#038;fg=000000&#038;s=0' alt='\lambda = \frac{\pi}{2} - \tau' title='\lambda = \frac{\pi}{2} - \tau' class='latex' /></p>
<p style="text-align: left;">so we have</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=b%20%3D%202%5Csin%28%5Crho%29%20%5Csin%28%5Clambda%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='b = 2\sin(\rho) \sin(\lambda)' title='b = 2\sin(\rho) \sin(\lambda)' class='latex' /></p>
<p style="text-align: left;">We consider it in 3D by just rotating orthogonally to the plane of rotation of <img src='http://s.wordpress.com/latex.php?latex=%5Ctau%20&#038;bg=T&#038;fg=000000&#038;s=0' alt='\tau ' title='\tau ' class='latex' />.</p>
<div id="attachment_326" class="wp-caption alignnone" style="width: 508px"><img class="size-full wp-image-326" title="Figure 3" src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_Eyeball_3.png" alt="" width="498" height="231" /><p class="wp-caption-text">Figure 3 - Blow up of the angles fromÂ FigureÂ 2 and Â rotation by the second angle</p></div>
<p style="text-align: left;">These two rotations can move to pupil to any place on our model eyeball. There are two nice properties of this circle on a sphere. Firstly the line passing through the minor axis of the ellipse in the image passes through the centre of the eye in the image <img src='http://s.wordpress.com/latex.php?latex=%28x_o%2C%20y_o%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(x_o, y_o)' title='(x_o, y_o)' class='latex' />. This fact means that the center of the eye can be determined from two images of the pupil in different positions by finding the intercept of the two lines defined by the minor axis.</p>
<p style="text-align: left;">This property allows us to calculate the angle <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma&#038;bg=T&#038;fg=000000&#038;s=0' alt='\gamma' title='\gamma' class='latex' /> from the angle of the minor axis and the position of the pupil relative to <img src='http://s.wordpress.com/latex.php?latex=%28x_o%2C%20y_o%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(x_o, y_o)' title='(x_o, y_o)' class='latex' /></p>
<p style="text-align: left;">The second useful property is that can calculate \gamma from the ratio of the minor axis.<br />
We can will consider the ratio of the major and minor axes. This measure will be invariant as the pupil size varies.</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7Ba%7D%7Bb%7D%20%3D%20%5Cfrac%7B2%20%5Csin%28%5Crho%29%7D%7B2%5Csin%28%5Crho%29%20%5Csin%28%5Clambda%29%7D%20%3D%20%5Cfrac%7B1%7D%7B%5Csin%28%5Clambda%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\frac{a}{b} = \frac{2 \sin(\rho)}{2\sin(\rho) \sin(\lambda)} = \frac{1}{\sin(\lambda)}' title='\frac{a}{b} = \frac{2 \sin(\rho)}{2\sin(\rho) \sin(\lambda)} = \frac{1}{\sin(\lambda)}' class='latex' /></p>
<p style="text-align: left;">From this we can directly calculate <img src='http://s.wordpress.com/latex.php?latex=%5Ctau&#038;bg=T&#038;fg=000000&#038;s=0' alt='\tau' title='\tau' class='latex' /> as follows:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Ctau%20%3D%20%5Cfrac%7B%5Cpi%7D%7B2%7D%20-%20%5Csin%5E%7B-1%7D%28%5Cfrac%7Bb%7D%7Ba%7D%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\tau = \frac{\pi}{2} - \sin^{-1}(\frac{b}{a})' title='\tau = \frac{\pi}{2} - \sin^{-1}(\frac{b}{a})' class='latex' /></p>
<p style="text-align: left;">If we have at least two images of the eye we can describe the rotation of the eye by <img src='http://s.wordpress.com/latex.php?latex=%28%5Ctau%2C%20%5Cgamma%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(\tau, \gamma)' title='(\tau, \gamma)' class='latex' />. These angles can be used to generate the unit vector <img src='http://s.wordpress.com/latex.php?latex=g%27&#038;bg=T&#038;fg=000000&#038;s=0' alt='g&#039;' title='g&#039;' class='latex' /> where</p>
<p style="text-align: left;"><img src='http://s.wordpress.com/latex.php?latex=g%27%20%3D%20%20%5Cleft%28%20%5Cbegin%7Barray%7D%7Bc%7D%20%5Ccos%28%5Cgamma%29%20%5Csin%28%5Ctau%29%20%5C%5C%20%5Csin%28%5Cgamma%29%20%5Csin%28%5Ctau%29%20%5C%5C%20%5Ccos%28%5Ctau%29%20%5Cend%7Barray%7D%20%5Cright%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='g&#039; =  \left( \begin{array}{c} \cos(\gamma) \sin(\tau) \\ \sin(\gamma) \sin(\tau) \\ \cos(\tau) \end{array} \right)' title='g&#039; =  \left( \begin{array}{c} \cos(\gamma) \sin(\tau) \\ \sin(\gamma) \sin(\tau) \\ \cos(\tau) \end{array} \right)' class='latex' /></p>
<p style="text-align: left;">These unit vectors then have to be rotated to align with the real world. The rotation matrix can be described by three scalars.</p>
<h3>Further work</h3>
<p style="text-align: left;">In this analysis we assume that the eye is a sphere, rotating about it center: a fixed point relative to the camera and that we are able to accurately extract the ellipse describing the pupil. We do not consider the effects of noise, error or perspective. I&#8217;ve also assumed that the edge of the pupil is always on the edge of the sphere &#8211; when in fact it is more like a circle on a plane cutting through the eye (ouch). I have a feeling that this is not a problem as it is equivalent to the eyeball changing size as the pupil changes size.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/10/22/pupil-geometry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapping pupil position to screen targets</title>
		<link>http://blog.jjhale.com/2010/10/21/mapping-pupil-position-to-screen-targets/</link>
		<comments>http://blog.jjhale.com/2010/10/21/mapping-pupil-position-to-screen-targets/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 22:52:45 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[eye tracking]]></category>
		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=301</guid>
		<description><![CDATA[This post describes the relationship between the different factors I consider in my eye tracking interface set up. I go through the geometric model which I plan to use to constrain my system. To use eye tracking to interact with a computer it is necessary to map the location of the pupil in an image [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-304  alignleft" title="EyeTrackMath_1" src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_1-300x153.png" alt="" width="150" height="76" /></p>
<p>This post describes the relationship between the different factors I consider in my eye tracking interface set up. I go through the geometric model which I plan to use to constrain my system.</p>
<p><span id="more-301"></span></p>
<p>To use eye tracking to interact with a computer it is necessary to map the location of the pupil in an image (from a head mounted camera for example) to the fixation point of gaze on a screen. Most systems require calibration to account for the variations in the positions of the cameras, the user and the screen. To calibrate the system you gather a set of training examples where the user is asked to fixate on a a set of points on the screen. A model is then fitted to this data to allow gaze towardsÂ arbitrary points on the screen to be accurately determined.</p>
<div id="attachment_304" class="wp-caption aligncenter" style="width: 402px"><img class="size-full wp-image-304" title="EyeTrackMath_1" src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_1.png" alt="" width="392" height="200" /><p class="wp-caption-text">Figure 1 - The set up</p></div>
<div id="attachment_317" class="wp-caption aligncenter" style="width: 354px"><img class="size-full wp-image-317" title="EyeTrackMath_2" src="http://blog.jjhale.com/wp-content/uploads/2010/07/EyeTrackMath_2.png" alt="" width="344" height="200" /><p class="wp-caption-text">Figure 2 - the vectors</p></div>
<p style="text-align: center;">
<p>Figure 1 shows the main elements we consider in the tracking. We label these elements as shown in figure 2 &#8211; which are:</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=O&#038;bg=T&#038;fg=000000&#038;s=0' alt='O' title='O' class='latex' /> is the origin of the system, which is centred on the fixed camera below the screen.</li>
<li><img src='http://s.wordpress.com/latex.php?latex=S_o&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_o' title='S_o' class='latex' /> is the origin of the screen relative to the camera origin <img src='http://s.wordpress.com/latex.php?latex=O&#038;bg=T&#038;fg=000000&#038;s=0' alt='O' title='O' class='latex' />.</li>
<li>the vectors <img src='http://s.wordpress.com/latex.php?latex=S_x&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_x' title='S_x' class='latex' /> and <img src='http://s.wordpress.com/latex.php?latex=S_y&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_y' title='S_y' class='latex' /> are the basis vectors for the screen, they correspond to the width and height of a single pixel in the real world.</li>
<li><img src='http://s.wordpress.com/latex.php?latex=Y&#038;bg=T&#038;fg=000000&#038;s=0' alt='Y' title='Y' class='latex' /> is the location of the target on the screen that the user is looking at.</li>
<li><img src='http://s.wordpress.com/latex.php?latex=H&#038;bg=T&#038;fg=000000&#038;s=0' alt='H' title='H' class='latex' /> is centre of the head target. The head target is a plane with four LEDs on it which are tracked by the fixed camera.</li>
<li><img src='http://s.wordpress.com/latex.php?latex=E&#038;bg=T&#038;fg=000000&#038;s=0' alt='E' title='E' class='latex' /> is the centre of the eye which is being tracked.</li>
<li>the vector <img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EG}' title='\vec{EG}' class='latex' /> is a unit vector pointing in the direction that the eye is looking.</li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEY%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EY}' title='\vec{EY}' class='latex' /> isÂ the vectorÂ from the eye to the target</li>
</ul>
<p>It is useful to think of the system in two frames of reference. There is the frame of reference of the fixed camera and the frame of reference of the head.</p>
<h3>Fixed camera frame of reference</h3>
<p>In the fixed camera&#8217;s frame of reference we have three fixed but unknown vectors: <img src='http://s.wordpress.com/latex.php?latex=S_o%2C%20S_x&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_o, S_x' title='S_o, S_x' class='latex' /> and <img src='http://s.wordpress.com/latex.php?latex=S_y&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_y' title='S_y' class='latex' />. Once these are know we can express the target vector <img src='http://s.wordpress.com/latex.php?latex=Y%5E%7B%28i%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='Y^{(i)}' title='Y^{(i)}' class='latex' /> as follows</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=Y%5E%7B%28i%29%7D%20%3D%20S_o%20%2B%20t_x%5E%7B%28i%29%7DS_x%20%2B%20t_y%5E%7B%28i%29%7DS_y&#038;bg=T&#038;fg=000000&#038;s=0' alt='Y^{(i)} = S_o + t_x^{(i)}S_x + t_y^{(i)}S_y' title='Y^{(i)} = S_o + t_x^{(i)}S_x + t_y^{(i)}S_y' class='latex' /></p>
<p>where <img src='http://s.wordpress.com/latex.php?latex=t_x%5E%7B%28i%29%7D%2C%20t_y%5E%7B%28i%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='t_x^{(i)}, t_y^{(i)}' title='t_x^{(i)}, t_y^{(i)}' class='latex' /> are the screen pixel coordinates of the target for training example <em>i</em>.</p>
<p>The relationship between the head and the fixed camera frame of reference is described by the following equation</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=k%20%3D%20R%5E%7B%28i%29%7D%28K%20-%20T%5E%7B%28i%29%7D%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='k = R^{(i)}(K - T^{(i)})' title='k = R^{(i)}(K - T^{(i)})' class='latex' /></p>
<p style="text-align: left;">Where <img src='http://s.wordpress.com/latex.php?latex=k%20%5Cin%20%5Cmathbb%7BR%7D%5E3&#038;bg=T&#038;fg=000000&#038;s=0' alt='k \in \mathbb{R}^3' title='k \in \mathbb{R}^3' class='latex' /> is a point relative in the head frame of reference and <img src='http://s.wordpress.com/latex.php?latex=K%20%5Cin%20%5Cmathbb%7BR%7D%5E3&#038;bg=T&#038;fg=000000&#038;s=0' alt='K \in \mathbb{R}^3' title='K \in \mathbb{R}^3' class='latex' /> is the same point relative to the fixed-camera. <img src='http://s.wordpress.com/latex.php?latex=R&#038;bg=T&#038;fg=000000&#038;s=0' alt='R' title='R' class='latex' /> is aÂ rotationÂ matrixÂ and <img src='http://s.wordpress.com/latex.php?latex=T%5E%7B%28i%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='T^{(i)}' title='T^{(i)}' class='latex' /> the translation vector <img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BOH%5E%7B%28i%29%7D%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{OH^{(i)}}' title='\vec{OH^{(i)}}' class='latex' />. To go back the other way you just need to use:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=K%3DR%5E%7B%5Cprime%28i%29%7Dk%2BT%5E%7B%28i%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='K=R^{\prime(i)}k+T^{(i)}' title='K=R^{\prime(i)}k+T^{(i)}' class='latex' /></p>
<p style="text-align: left;">Where <img src='http://s.wordpress.com/latex.php?latex=R%5E%7B%5Cprime%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='R^{\prime}' title='R^{\prime}' class='latex' /> is the transpose of <img src='http://s.wordpress.com/latex.php?latex=R&#038;bg=T&#038;fg=000000&#038;s=0' alt='R' title='R' class='latex' /> and hence the inverse rotation.</p>
<h3>The head frame of reference</h3>
<p>We assume that the eye and the eye-camera are fixed in the head frame of reference. The position of the eye relative to the head target is fixedÂ in the head coordinate space &#8211; we&#8217;ll call this translation <img src='http://s.wordpress.com/latex.php?latex=o&#038;bg=T&#038;fg=000000&#038;s=0' alt='o' title='o' class='latex' />. Thus</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=E%3DR%5E%7B%5Cprime%20%28i%29%7Do%20%2B%20%5Cvec%7BOH%7D%5E%7B%28i%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='E=R^{\prime (i)}o + \vec{OH}^{(i)}' title='E=R^{\prime (i)}o + \vec{OH}^{(i)}' class='latex' /></p>
<p>We assume that there exists a mapping from the image of the pupil from the eye-camera to the vector <img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EG}' title='\vec{EG}' class='latex' /> (more on this in a future post).</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=p%5E%7B%28i%29%7D%20%3D%20%28p_x%5E%7B%28i%29%7D%2C%20p_y%5E%7B%28i%29%7D%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='p^{(i)} = (p_x^{(i)}, p_y^{(i)})' title='p^{(i)} = (p_x^{(i)}, p_y^{(i)})' class='latex' /> is the location of the centre of the pupil in the eye camera image for the <img src='http://s.wordpress.com/latex.php?latex=i%5E%7Bth%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='i^{th}' title='i^{th}' class='latex' /> training example.</li>
<li><img src='http://s.wordpress.com/latex.php?latex=g%28p%5E%7B%28i%29%7D%2C%20%5Ctheta%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='g(p^{(i)}, \theta)' title='g(p^{(i)}, \theta)' class='latex' /> is the mapping from the pupil position in the eye image to the unit vector <img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EG}' title='\vec{EG}' class='latex' /> relative to the head which is parameterised by the vector <img src='http://s.wordpress.com/latex.php?latex=%5Ctheta&#038;bg=T&#038;fg=000000&#038;s=0' alt='\theta' title='\theta' class='latex' /></li>
<li>to get <img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EG}' title='\vec{EG}' class='latex' /> in the fixed camera coordinates we need to Â transform it as follows:</li>
</ul>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEG%7D%20%3D%20R%5E%7B%5Cprime%20%28i%29%7D%20g%28p%5E%7B%28i%29%7D%2C%20%5Ctheta%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EG} = R^{\prime (i)} g(p^{(i)}, \theta)' title='\vec{EG} = R^{\prime (i)} g(p^{(i)}, \theta)' class='latex' /></p>
<h3>The intercept of the gaze and the target</h3>
<p>Consider a user is looking at a target on a screen. We can consider their gaze as the line defined by the position of their eye  <img src='http://s.wordpress.com/latex.php?latex=E&#038;bg=T&#038;fg=000000&#038;s=0' alt='E' title='E' class='latex' />Â and the direction in which they are looking <img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{EG}' title='\vec{EG}' class='latex' />. We consider the screen as a plane defined by it origin <img src='http://s.wordpress.com/latex.php?latex=S_o&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_o' title='S_o' class='latex' /> and two points on the plane <img src='http://s.wordpress.com/latex.php?latex=S_x&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_x' title='S_x' class='latex' /> and <img src='http://s.wordpress.com/latex.php?latex=S_y&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_y' title='S_y' class='latex' />.</p>
<p>Thus the line of gaze can be expressed parametrically as:</p>
<img src='http://s.wordpress.com/latex.php?latex=P%28s%29%20%3D%20E%20%2B%20s%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='P(s) = E + s\vec{EG}' title='P(s) = E + s\vec{EG}' class='latex' />
<p>The plane can be defined by</p>
<img src='http://s.wordpress.com/latex.php?latex=n%20%5Ccdot%20%28p%20-%20S_o%29%20%3D%200&#038;bg=T&#038;fg=000000&#038;s=0' alt='n \cdot (p - S_o) = 0' title='n \cdot (p - S_o) = 0' class='latex' />
<p>where p is a point on the plane and <img src='http://s.wordpress.com/latex.php?latex=n%20%3D%20S_x%20%5Ctimes%20S_y&#038;bg=T&#038;fg=000000&#038;s=0' alt='n = S_x \times S_y' title='n = S_x \times S_y' class='latex' /> is the normal to the plane. Providing the line of gaze is not parallel to the plane of the screen we can plug P(s) into the definition of the plane.</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=n%20%5Ccdot%20%28E%20%2B%20s%20%5Cvec%7BEG%7D%20-%20S_o%29%20%3D%200%20&#038;bg=T&#038;fg=000000&#038;s=0' alt='n \cdot (E + s \vec{EG} - S_o) = 0 ' title='n \cdot (E + s \vec{EG} - S_o) = 0 ' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=n%20%5Ccdot%28E%20-%20S_o%29%20%2B%20n%20%5Ccdot%28s%20%5Cvec%7BEG%7D%29%20%3D%200&#038;bg=T&#038;fg=000000&#038;s=0' alt='n \cdot(E - S_o) + n \cdot(s \vec{EG}) = 0' title='n \cdot(E - S_o) + n \cdot(s \vec{EG}) = 0' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=s%20%3D%20%5Cfrac%7Bn%20%5Ccdot%20%28%20S_o%20-%20E%29%20%7D%7Bn%20%5Ccdot%20%28%5Cvec%7BEG%7D%29%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='s = \frac{n \cdot ( S_o - E) }{n \cdot (\vec{EG})}' title='s = \frac{n \cdot ( S_o - E) }{n \cdot (\vec{EG})}' class='latex' /></li>
</ul>
<p>Finally we have that</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=Y%5E%7B%28i%29%7D%20%3D%20S_o%20%2B%20t_x%5E%7B%28i%29%7D%20S_x%20%2B%20t_y%5E%7B%28i%29%7DS_y%20%3D%20E%20%2B%5Cfrac%7Bn%20%5Ccdot%20%28S_o%20-%20E%29%7D%7Bn%20%5Ccdot%20%28%5Cvec%7BEG%7D%29%20%7D%20%5Cvec%7BEG%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='Y^{(i)} = S_o + t_x^{(i)} S_x + t_y^{(i)}S_y = E +\frac{n \cdot (S_o - E)}{n \cdot (\vec{EG}) } \vec{EG}' title='Y^{(i)} = S_o + t_x^{(i)} S_x + t_y^{(i)}S_y = E +\frac{n \cdot (S_o - E)}{n \cdot (\vec{EG}) } \vec{EG}' class='latex' /></li>
</ul>
<h3>The unknowns</h3>
<p>In order to fit this model we need some training data. These data are obtained by haivng Â user look at a series of targets on the screen and storing the following for each presentation <em>i</em>:</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=p%5E%7B%28i%29%7D%20%3D%20%28p_x%5E%7B%28i%29%7D%2C%20p_y%5E%7B%28i%29%7D%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='p^{(i)} = (p_x^{(i)}, p_y^{(i)})' title='p^{(i)} = (p_x^{(i)}, p_y^{(i)})' class='latex' /> : the pupil position</li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Cvec%7BOH%7D&#038;bg=T&#038;fg=000000&#038;s=0' alt='\vec{OH}' title='\vec{OH}' class='latex' /> : the translation of the head from the camera</li>
<li><img src='http://s.wordpress.com/latex.php?latex=R&#038;bg=T&#038;fg=000000&#038;s=0' alt='R' title='R' class='latex' /> : the rotation of the head relative to the camera</li>
<li><img src='http://s.wordpress.com/latex.php?latex=%28t_x%5E%7B%28i%29%7D%2C%20t_y%5E%7B%28i%29%7D%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(t_x^{(i)}, t_y^{(i)})' title='(t_x^{(i)}, t_y^{(i)})' class='latex' /> : the screen pixel coordinate of the <em>i</em>th target</li>
</ul>
<p>The remain unknown constants are:</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=o&#038;bg=T&#038;fg=000000&#038;s=0' alt='o' title='o' class='latex' /> : the translation of the eye relative to the head</li>
<li><img src='http://s.wordpress.com/latex.php?latex=S_o&#038;bg=T&#038;fg=000000&#038;s=0' alt='S_o' title='S_o' class='latex' /> : the origin of the screen relative to the camera</li>
<li><img src='http://s.wordpress.com/latex.php?latex=%28S_x%2C%20S_y%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='(S_x, S_y)' title='(S_x, S_y)' class='latex' /> : the unit screen basis vectors</li>
<li><img src='http://s.wordpress.com/latex.php?latex=%5Ctheta&#038;bg=T&#038;fg=000000&#038;s=0' alt='\theta' title='\theta' class='latex' /> : the parameter vector for mapping pupil position to the unit eye vector.</li>
</ul>
<p>I will talk about obtaining these unknowns in a future post.</p>
<h3>Prediction</h3>
<p>Once the unknowns have been determined you are able to predict the screen target postion given the pupil position and the head&#8217;s position and orientation. We can calculate <img src='http://s.wordpress.com/latex.php?latex=t_x&#038;bg=T&#038;fg=000000&#038;s=0' alt='t_x' title='t_x' class='latex' /> and <img src='http://s.wordpress.com/latex.php?latex=t_y&#038;bg=T&#038;fg=000000&#038;s=0' alt='t_y' title='t_y' class='latex' /> independently as follows:</p>
<ul>
<li><img src='http://s.wordpress.com/latex.php?latex=t_x%20%3D%20S_x%20%5Ccdot%20%5Cleft%28E%20-%20S_o%2B%5Cfrac%7Bn%20%5Ccdot%20%28S_o%20-%20E%29%7D%7Bn%20%5Ccdot%20%28%5Cvec%7BEG%7D%29%7D%5Cvec%7BEG%7D%5Cright%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='t_x = S_x \cdot \left(E - S_o+\frac{n \cdot (S_o - E)}{n \cdot (\vec{EG})}\vec{EG}\right)' title='t_x = S_x \cdot \left(E - S_o+\frac{n \cdot (S_o - E)}{n \cdot (\vec{EG})}\vec{EG}\right)' class='latex' /></li>
<li><img src='http://s.wordpress.com/latex.php?latex=t_y%20%3D%20S_y%20%5Ccdot%20%5Cleft%28E%20-%20S_o%2B%5Cfrac%7Bn%20%5Ccdot%20%28S_o%20-%20E%29%7D%7Bn%20%5Ccdot%20%28%5Cvec%7BEG%7D%29%7D%5Cvec%7BEG%7D%5Cright%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='t_y = S_y \cdot \left(E - S_o+\frac{n \cdot (S_o - E)}{n \cdot (\vec{EG})}\vec{EG}\right)' title='t_y = S_y \cdot \left(E - S_o+\frac{n \cdot (S_o - E)}{n \cdot (\vec{EG})}\vec{EG}\right)' class='latex' /></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/10/21/mapping-pupil-position-to-screen-targets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Voice transcript fail</title>
		<link>http://blog.jjhale.com/2010/07/27/google-voice-transcript-fail/</link>
		<comments>http://blog.jjhale.com/2010/07/27/google-voice-transcript-fail/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 01:01:40 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=371</guid>
		<description><![CDATA[Google voice interpreted a bunch of beeps for me.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-376" title="google Voice logo by Tim Malabuyo" src="http://blog.jjhale.com/wp-content/uploads/2010/07/googleVoice.png" alt="" width="100" height="100" /></p>
<p>Google Voice is pretty good at transcribing voicemail but can come unstuck on more unusual messages. Perhaps it is able to read more into it than I can. Here are two messages I got today (flash player required).</p>
<p><span id="more-371"></span>&#8220;Come on&#8221;</p>
<p><object id="scPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="426" height="151" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/jingswfplayer.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="thumb=http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/FirstFrame.jpg&amp;containerwidth=426&amp;containerheight=151&amp;content=http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/00000002.swf&amp;blurover=false" /><param name="allowFullScreen" value="false" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/" /><param name="src" value="http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/jingswfplayer.swf" /><param name="flashvars" value="thumb=http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/FirstFrame.jpg&amp;containerwidth=426&amp;containerheight=151&amp;content=http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/00000002.swf&amp;blurover=false" /><param name="allowfullscreen" value="false" /><embed id="scPlayer" type="application/x-shockwave-flash" width="426" height="151" src="http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/jingswfplayer.swf" base="http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/" allowscriptaccess="always" scale="showall" allowfullscreen="false" flashvars="thumb=http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/FirstFrame.jpg&amp;containerwidth=426&amp;containerheight=151&amp;content=http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/00000002.swf&amp;blurover=false" bgcolor="#FFFFFF" quality="high" data="http://content.screencast.com/users/jjhale/folders/Jing/media/59858bcf-c9a1-4d5e-bc77-24afbf73eefe/jingswfplayer.swf"></embed></object></p>
<p>and the simpler interpretation &#8220;On&#8221;</p>
<p><object id="scPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="428" height="151" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/jingswfplayer.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="thumb=http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/FirstFrame.jpg&amp;containerwidth=428&amp;containerheight=151&amp;content=http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/00000001.swf&amp;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/" /><param name="src" value="http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/jingswfplayer.swf" /><param name="flashvars" value="thumb=http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/FirstFrame.jpg&amp;containerwidth=428&amp;containerheight=151&amp;content=http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/00000001.swf&amp;blurover=false" /><param name="allowfullscreen" value="true" /><embed id="scPlayer" type="application/x-shockwave-flash" width="428" height="151" src="http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/jingswfplayer.swf" base="http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/" allowscriptaccess="always" scale="showall" allowfullscreen="true" flashvars="thumb=http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/FirstFrame.jpg&amp;containerwidth=428&amp;containerheight=151&amp;content=http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/00000001.swf&amp;blurover=false" bgcolor="#FFFFFF" quality="high" data="http://content.screencast.com/users/jjhale/folders/Jing/media/69a32926-2cc8-49eb-9d34-5e9f6c288261/jingswfplayer.swf"></embed></object></p>
<p>Come on Google Voice: wouldn&#8217;t &#8220;beep&#8221; be a better choice of words?</p>
<p><em>Update: Check out </em><a title="Sharing funny Google Voice Transcripts" href="http://www.hellolinko.com/" target="_blank"><em>HelloLinko.com</em></a><em> for more or to share your own.</em></p>
<p>Image by <a href="http://www.flickr.com/people/malabooboo/" target="_blank">Tim Malabuyo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/07/27/google-voice-transcript-fail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Eye Tracking – The Eye Camera</title>
		<link>http://blog.jjhale.com/2010/07/15/eye-tracking-the-eye-camera/</link>
		<comments>http://blog.jjhale.com/2010/07/15/eye-tracking-the-eye-camera/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 23:57:28 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[eye tracking]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=266</guid>
		<description><![CDATA[How I dismantled a Logitech webcam and converted it to be an IR camera with a telephoto lens for use in eye tracking.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.jjhale.com/wp-content/uploads/2010/07/CameraEye_Rachel_Chapman.jpg"><img class="alignleft size-full wp-image-268" title="Eye Camera " src="http://blog.jjhale.com/wp-content/uploads/2010/07/CameraEye_Rachel_Chapman.jpg" alt="Photo of a camera lens in an eye" width="240" height="169" /></a></p>
<p>In this post I&#8217;ll be describing how I made a head mounted IR camera for tracking where a person is looking. I&#8217;ve been working on gettingÂ low-costÂ home brew eye tracking running on my Mac. I want the computer to know where I&#8217;m looking on the screen and to be able to interact with my gaze.Â My first attempt uses a head mounted IR camera to determine the pupil position and a second remote camera to detect the head position relative to the screen.</p>
<p><em>Picture  <a href="http://creativecommons.org/licenses/by/2.0/deed.en"><img class="alignnone size-full wp-image-284" style="margin-top: -2px; margin-bottom: -2px;" title="Creative Commons Attribution" src="http://blog.jjhale.com/wp-content/uploads/2010/07/CC-Attrib.png" alt="" width="13" height="14" /></a> </em><em><a href="http://www.flickr.com/photos/rachelicha/2235381210/">Rachel Chapman</a>.</em><br />
<span id="more-266"></span></p>
<p>I was inspired by the <a title="OpenGaze - open-source open-hardware toolkit for low cost eye tracking" href="http://thirtysixthspan.com/openEyes/" target="_blank">OpenEyes</a> project which provides open-source software and hardware forÂ constructingÂ low cost real-time eye tracking. Their hardware designs are focused on mobile eye tracking &#8211; that is eye tracking whilst a person is freely moving around. They use two head mounted cameras: a scene camera and an eye camera. I&#8217;m only interested in where someone is looking on a fixed screen so I only use one head mounted camera focused on the pupil.</p>
<h1>The eye camera</h1>
<p>I converted a cheap webcam to be used as the head mounted eye camera. The webcam was modified in two major ways: firstly it was converted into an IR web cam by swapping the infrared filter for an visual light filter; secondly I swapped the standard lens for a telephoto lens. As ever the usual <a title="Disclaimer - use common sense" href="http://blog.jjhale.com/disclaimer/">disclaimer</a> applies.</p>
<p>I&#8217;m using &#8220;dark pupil&#8221; tracking which requires an image of the eye under IR light. Under these conditions the pupil is dark andÂ stronglyÂ contrasts with the surrounding iris. I experimented withÂ an old Apple iSight web cam. I had several problems with it Â though. Firstly it was big and heavy so it obscured the user&#8217;s view of the screen and was difficult to fix to the head. The iSight has a nice autofocus glass lens, which gives you lovely crisp images. However, the autofocus mechanism would sometimes get confused and would get into cycles of focusing on the eye then trying to focus further away. Since the camera is going to be fixedÂ relativeÂ to the eye a manual focus camera seems more approprate. Note that the focus of the iSight can be set by software using either comercial products like <a href="http://www.ecamm.com/mac/iglasses/">iGlasses</a> or programmatically though <a href="http://en.wikipedia.org/wiki/IEEE_1394_interface#IIDC">IIDC</a> (see <a href="http://developer.apple.com/legacy/mac/library/documentation/Hardware/Conceptual/iSightProgGuide/iSightProgGuide.pdf">iSight Programming Guide</a>).</p>
<p>I bought a manual focus <a href="http://www.amazon.com/gp/product/B000O9GGLY?ie=UTF8&amp;tag=joehalsblo-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B000O9GGLY">Logitech QuickCam Deluxe</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=joehalsblo-20&amp;l=as2&amp;o=1&amp;a=B000O9GGLY" border="0" alt="" width="1" height="1" />. Here&#8217;s how I removed the casing and got to the lens:</p>
<div id="attachment_270" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_1.jpg"><img class="size-full wp-image-270" title="The Webcam" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_1.jpg" alt="Logitech QuickCam Deluxe" width="500" height="262" /></a><p class="wp-caption-text">Logitech QuickCam Deluxe</p></div>
<p>You just need a Phillips #00 Screwdriver to remove all the screws.</p>
<div id="attachment_271" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_2.jpg"><img class="size-full wp-image-271" title="The Outer Case" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_2.jpg" alt="" width="500" height="312" /></a><p class="wp-caption-text">1) Undo the three screws on the back.</p></div>
<div id="attachment_272" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_3.jpg"><img class="size-full wp-image-272" title="Removing the back case" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_3.jpg" alt="" width="500" height="257" /></a><p class="wp-caption-text">2) Gently pull the back away - note you need to disconnect the usb wire from the circuit board by pulling the white plug towards the top of the webcam.</p></div>
<div id="attachment_273" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-273" title="The back of the board" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_4.jpg" alt="" width="500" height="249" /><p class="wp-caption-text">3) Unscrew the two silver screws at the edges that hold the board onto the front of the case. The two black screws hold the lens mount onto the board - leave them for now.</p></div>
<div id="attachment_274" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-274" title="The front of the board" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_5.jpg" alt="" width="500" height="242" /><p class="wp-caption-text">The exposed web cam board. The microphone funnel in the middle just pulls straight off.</p></div>
<div id="attachment_275" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-275" title="The lens and lens mount" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_6.jpg" alt="" width="500" height="221" /><p class="wp-caption-text">Undo the black screws on the back of the board to release the lens mount - the CCD chip is now very exposed: make sure you don&#39;t touch it or let it get dusty. The lens just unscrews from the mount. Tomake the camera only sensitive to IR light I cut out a piece of unexposed developed print film to act as a visual light filter. This film was placed in the lens mount (between the mount and lens - not between the mount and board).Â </p></div>
<div id="attachment_276" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_7.jpg"><img class="size-full wp-image-276" title="Removing the filter" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_7.jpg" alt="" width="500" height="201" /></a><p class="wp-caption-text">The IR filter is on the back of the lens so you just need to rub it with a finger nail to scrape off the filter - this took a while. You needn&#39;t remove the lens elements if you are not going to use the telephoto lens. If you are going to use another lens you can just pick off the glued in plastic ring at the back and push the front of the lens to remove all the elements.</p></div>
<div id="attachment_277" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-277" title="The back element of the lens" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_8.jpg" alt="" width="500" height="154" /><p class="wp-caption-text">The element of the len after the filter wasÂ scratchedÂ off.</p></div>
<h1>Changing the lens</h1>
<p>To get the image of the eye to fill the frame using the regular lens required the camera to be only a few cm from my eye. The close placementÂ obscuredÂ part of my view of the screen and made lighting the eye with the IR LED very challenging. By swapping the webcam lens for a telephoto lens I could position the camera further from the eye solving these two problems &#8211; and it only cost $3.25!</p>
<div id="attachment_279" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-279" title="Telephoto Conversion" src="http://blog.jjhale.com/wp-content/uploads/2010/07/TelephotoConversion.jpg" alt="" width="500" height="183" /><p class="wp-caption-text">The telephoto lens on the left and the old lens casing on the right.</p></div>
<p>I bought a lens with a 12mm focal length for just $3 on eBay. The telephoto lens mount as M12 x 0.5 &#8211; this means that the diameter of the barrel of the lens in 12mm &#8211; unfortunately the webcam lens had more like an 8mm diameter. The proper lens would have been more expensive so I just spend 25c on some plastic hose with about a 10mm internal diameter. I used a 1cm long piece as a collar to attach the old lens housing (with the elements removed) to the telephoto lens.</p>
<div id="attachment_278" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-278" title="Plastic hose" src="http://blog.jjhale.com/wp-content/uploads/2010/07/TelephotoConversion-2.jpg" alt="" width="500" height="184" /><p class="wp-caption-text">The 25 cent hose I used to connect the new and the old lens cases.</p></div>
<h1>Wrapping up</h1>
<p>With the case off the webcam the CCD detected light that was comingÂ throughÂ the circuit board. To block this light I wrapped it in a layer of plastic wrap, a layer of foil and then another layer of plastic wrap. I then attached two IR LEDs to it and it was ready to be attached to my head mount. I also tried to power the IR LEDs from the webcams &#8220;working&#8221; LED. I removed the blue surface-mount LED and connected an IR LED. The connections were very fiddly and fragile and LED only shone dimly. I&#8217;d not bother if I were to do it again. Instead I&#8217;m powering the LEDs from a separate USB port.</p>
<div id="attachment_281" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-281" title="The eye camera" src="http://blog.jjhale.com/wp-content/uploads/2010/07/Logitech_Webcam_9.jpg" alt="" width="500" height="169" /><p class="wp-caption-text">The completed eye camera in its clamp</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/07/15/eye-tracking-the-eye-camera/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to switch tablet input between multiple monitors on a Mac</title>
		<link>http://blog.jjhale.com/2010/05/18/how-to-switch-tablet-input-between-multiple-monitors-on-a-mac/</link>
		<comments>http://blog.jjhale.com/2010/05/18/how-to-switch-tablet-input-between-multiple-monitors-on-a-mac/#comments</comments>
		<pubDate>Tue, 18 May 2010 00:18:09 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Duel]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Monitor]]></category>
		<category><![CDATA[Multi]]></category>
		<category><![CDATA[Tablet]]></category>
		<category><![CDATA[Wacom]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=246</guid>
		<description><![CDATA[How to quickly switch your Wacom tablet input between multiple monitors on a Mac using some simple Applescript.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.jjhale.com/wp-content/uploads/2010/05/WacomTablet_Jens-Michael_Cramer.jpg"><img class="alignleft size-full wp-image-247" title="Wacom Tablet - Photo by Jens-Michael Cramer" src="http://blog.jjhale.com/wp-content/uploads/2010/05/WacomTablet_Jens-Michael_Cramer.jpg" alt="A Wacom Bamboo tablet" width="240" height="159" /></a>Quickly switch your tablet input between multiple monitors using some simple Applescript &#8211; no programming required. All you need to do is download the free app bundle below and then assign them to the hardware keys on your tablet. This quick switching allows you to use your full tablet for each of your monitors rather than dividing your tablet space between displays.</p>
<p>Read on to make the most of your tablet in a multi-monitor set up.</p>
<p><span id="more-246"></span></p>
<p><em>Photo by </em><a title="Jens-Michael Cramer's blog" href="http://blog.jmc.bz/"><em>Jens-Michael Cramer</em></a></p>
<p>This post applies to Wacom tablets running on Mac systems. It has beenÂ tested on Mac OS X 10.6.3 with a Wacom Bamboo tablet under driver version 5.2.1-3. It will probably work with other Wacom tablets on the Mac &#8211; let me know whether or not it worked on your set up by posting a comment.</p>
<p>The default setting for the Wacom Bamboo tablet is for the tablet to be mapped to your entire screen. Â If you have two screens, it splits the tablet between them and so you loose half of your precision. I wanted to be able to use the hardware &#8220;ExpressKey&#8221; buttons on the tablet to switch between using the full tablet on each screen in a multi-monitor setup.</p>
<h2>How to do it</h2>
<p>I&#8217;ve written three scripts to which switch the mapping of the tablet to either monitor 1, monitor 2 or both. To use them do the following:</p>
<ol>
<li>Download the latest <a title="Wacom Tablet Drivers" href="http://www.wacom.com/downloads/drivers.php" target="_blank">Wacom tablet driverÂ here</a> and install it.</li>
<li>Download my tablet screen switching applications here: <a href="http://blog.jjhale.com/wp-content/uploads/2010/05/Wacom_Switch.zip">Wacom_Switch.zip</a>.</li>
<li>Unzip them and place the three app files in your Applications folder.</li>
<li>Go to System Preferences -&gt; Pen Tablet</li>
<li>Select the tablet tab</li>
<li>Set the ExpressKeys to Open/Run&#8230; to each application.</li>
</ol>
<p>Alternatively you could set up keyboard short cuts to run the switcher applications.</p>
<p>Then just hit the buttons you&#8217;ve programmed to switch from screen to screen &#8211; easy.</p>
<h2>How its done</h2>
<p>You can set the tablet to map to just one of your monitors in the preference pane. Obviously this switching method is too slow. I found one <a href="http://www.macosxhints.com/article.php?story=2008062306574422">hack</a> which used Applescript to move copies of Wacom preference files around. I could not get it to work well on my machine but it inspired me to come up with this solution.</p>
<p>It turns out that you can set the mapping between the monitor and the tablet directly with Applescript. The <a href="http://www.wacomeng.com/mac/index.html">Wacom Applescript documentation</a> wasÂ relatively cryptic but was enough to figure out how to access the map display property. I wrote an Applescript which set the map display property on the first transducer of the first tablet on the system. Each app contains the same code except for the value set to map display. A value of 0 map the tablet to all displays and a value greater than zero maps it to just the displayÂ correspondingÂ to that number.</p>
<p>Here&#8217;s the code to set the mapping to screen 1:</p>
<pre>
<div id="_mcePaste">tell application "TabletDriver"</div>
<div id="_mcePaste">  set tabletNumber to 1</div>
<div id="_mcePaste">  set transducerNumber to 1</div>
<div id="_mcePaste">  set screenNumber to 1</div>
<div id="_mcePaste">  set map display of transducer transducerNumber Â¬</div>
<div id="_mcePaste">     of tablet tabletNumber to screenNumber</div>
<div id="_mcePaste">end tell</div>
</pre>
<p>You can open the apps in Applescript Editor to check them out (you can also make sure that they only do what they say they do too!) If you had more than two displays you can just re-save one of the apps as WacomScreen_3.app and change the value set to screenNumber to 3.</p>
<p>- Joe</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/05/18/how-to-switch-tablet-input-between-multiple-monitors-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to join loc-line modular adjustable hose without a special tool</title>
		<link>http://blog.jjhale.com/2010/03/20/how-to-join-loc-line-modular-adjustable-hose-without-a-special-tool/</link>
		<comments>http://blog.jjhale.com/2010/03/20/how-to-join-loc-line-modular-adjustable-hose-without-a-special-tool/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 22:45:28 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[eye tracking]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=218</guid>
		<description><![CDATA[Join loc-line modular adjustable hose using just a bit of wire and leverage - no need for any special tools. ]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<div id="attachment_230" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-230  " title="Loc-line segmented adjustable hose" src="http://blog.jjhale.com/wp-content/uploads/2010/03/join-loc-line-00.jpg" alt="" width="500" height="140" /><p class="wp-caption-text">Loc-line segmented adjustable hose</p></div>
<p>In this post I describe a simple way to join sections of loc-line hose with just a bit of  wire. Loc-line make an amazing product. It is a hose composed of short sections connecting with ball and socket joints. The hose can be bent into the shape you need and it will stay there. It is great for making your own <a href="http://www.instructables.com/id/Make-your-own-Gorilla-Pod/">gorillapod</a> for example. Connecting the sections with your bare hands is very hard so Loc-line sell a special tool for joining the sections. But you don&#8217;t need to buy that &#8211; read on and use my easy wire method instead.</p>
<p><span id="more-218"></span></p>
<p>I bought a couple of sections of 1/4 inch loc-line for my eye tracking project. Google suggested that I could get away with just using brute force to connect the sections. Firstly I tried just pushing one section into another. It was impossible. Next I broke out two pairs of needle nose pliers. After about 10 minutes of trying I was able to get the sections to join. It took a lot of effort and the pliers cut into the plastic sections making the join really stiff (and maybe risking leaks if I were using the tube for a fluid).Â  In my earlier attempts I had managed to split one of my two sections in half &#8211; exactly the opposite of what I was trying to do &#8211; so I had to make another join. By now I had worn myself out so I tried to come up with an easier way. After a several attempts I hit on using wire.</p>
<div id="attachment_221" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-221 " title="Damaged loc-line from using metal pliers" src="http://blog.jjhale.com/wp-content/uploads/2010/03/join-loc-line-02.jpg" alt="A damaged segment of loc-line" width="500" height="185" /><p class="wp-caption-text">The damage from metal pliers can be avoided by using wire</p></div>
<h2>you will need&#8230;</h2>
<ul>
<li>loc-line</li>
<li>20cm strong metal wire (I used 1mm thick copper wire I had hanging around).</li>
<li>safety gear &#8211; goggle, gloves, etc (the wire could snap and take your eye out!)</li>
</ul>
<p>(I had no trouble using this method, but there is the risk of injury with any sort of d.i.y. Be careful and don&#8217;t sue me).</p>
<h2>Step 1</h2>
<p>Fold the middle of the wire around the neck of the socket piece of loc-line. Twist the ends together to tightly hold the neck. Keep twisting the wires round until the twisted part reaches the mouth of the socket.</p>
<div id="attachment_223" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-223 " title="Attaching the wire to the socket piece" src="http://blog.jjhale.com/wp-content/uploads/2010/03/join-loc-line-04.jpg" alt="Wire attached to the neck of the loc-line" width="500" height="151" /><p class="wp-caption-text">Step 1: Wire attached to the neck of the socket piece of loc-line.</p></div>
<h2>Step 2</h2>
<p>Spread the wires apart and wrap them around the neck of the piece of loc-line you want to attach to the socket. Twist the remaining wire together to tightly hold the second piece. Make sure that there is only just enough wire between the two pieces for the &#8216;ball&#8217; end to touch the rim of the socket.</p>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-224 " title="Attaching the wire to the second piece of loc-line" src="http://blog.jjhale.com/wp-content/uploads/2010/03/join-loc-line-05.jpg" alt="Two pieces of loc-line held together by wire." width="500" height="147" /><p class="wp-caption-text">Step 2: The second piece of loc-line attached to the wire</p></div>
<h2>Step 3</h2>
<p>Hold the free ends of the two sections of loc-line and separate them, folding them away from the wire and moving the ball into the socket.</p>
<div id="attachment_225" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-225 " title="Bringing the ball into the socket" src="http://blog.jjhale.com/wp-content/uploads/2010/03/join-loc-line-06.jpg" alt="" width="500" height="199" /><p class="wp-caption-text">Step 3: The ball in position over the socket.</p></div>
<h2>Step 4</h2>
<p>Keep folding the sections away from the wire join. Use the free loc-line as two levers pushing the ball into the socket. You will hear a satisfying pop as the pieces connect. Then you just need to remove the wire and you are done.</p>
<div id="attachment_227" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-227 " title="The connected sections" src="http://blog.jjhale.com/wp-content/uploads/2010/03/join-loc-line-08.jpg" alt="two sections of loc-line joined using wire" width="500" height="180" /><p class="wp-caption-text">Step 4: The connected joint.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/03/20/how-to-join-loc-line-modular-adjustable-hose-without-a-special-tool/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>irSight: Converting iSight webcam to IR webcam</title>
		<link>http://blog.jjhale.com/2010/03/10/irsight-converting-isight-webcam-to-ir-webcam/</link>
		<comments>http://blog.jjhale.com/2010/03/10/irsight-converting-isight-webcam-to-ir-webcam/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 01:34:32 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[eye tracking]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=187</guid>
		<description><![CDATA[How to convert an Apple iSight firewire camera into a nightvision IR camera.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started working on a project to perform low cost eye tracking. As part of this project I need to have an infra-red (IR) camera. So I&#8217;ve converted an old Apple iSight firewire webcam in a camera sensitive to IR light. In this post I describe how to convert the iSight camera to work with IR light.</p>
<p><span id="more-187"></span></p>
<p>It is very easy to do.  An IR camera is also useful for for night visions application or even to see through clothing (some proud husband shows off his <a href="http://www.youtube.com/watch?v=BzHCDknFbDU">wife&#8217;s breasts</a> on youtube). In this post I&#8217;ll describe how I converted the iSight. I was inspired by <a href="http://www.hoagieshouse.com/IR/">HoagiesHouse.com</a> but it seems that there are lots of sites covering this topic (I found <a href="http://www.tuaw.com/2009/12/08/diy-isight-night-vision-camera/">this one</a> after I&#8217;d finished mine).</p>
<p>It turns out that a regular CCD is sensitive to IR light and so most webcams and digital cameras place a filter in front of the CCD which blocks incoming IR light. It does a pretty good job, although you can still see your TV remote flashing if you point it at the camera usually. To convert a camera you just need to remove the IR filter and put in a visual spectrum filter to block other light.</p>
<h2>What you need:</h2>
<ul>
<li>An iSight camera</li>
<li>A phillips cross head screw driver size 00</li>
<li>fine tweezers</li>
<li>A small piece of unexposed, processed print film (for the visible light filter)</li>
</ul>
<h2>Step 1: Open the iSight</h2>
<div id="attachment_191" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-11.jpg"><img class="size-medium wp-image-191 " title="The iSight" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-11-300x235.jpg" alt="Apple iSight webcam" width="300" height="235" /></a><p class="wp-caption-text">1) remove the two screws on the bottom and unclip the white plastic surround.</p></div>
<div id="attachment_193" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-3.jpg"><img class="size-medium wp-image-193" title="irSight-3" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-3-300x254.jpg" alt="" width="300" height="254" /></a><p class="wp-caption-text">2) Slide off the outer metal casing by pulling it away from he lens end.</p></div>
<div id="attachment_194" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-4.jpg"><img class="size-medium wp-image-194" title="irSight-4" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-4-300x189.jpg" alt="" width="300" height="189" /></a><p class="wp-caption-text">3) Peel off the fabric and use your tweezers to unclip the black plastic lock so you can release the &quot;J2&quot; wire </p></div>
<div id="attachment_195" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-5.jpg"><img class="size-medium wp-image-195" title="irSight-5" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-5-300x176.jpg" alt="" width="300" height="176" /></a><p class="wp-caption-text">4) Unscrew the three screws holding the plastic case to the lens assembly (two on top one below)  </p></div>
<div id="attachment_196" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-6.jpg"><img class="size-medium wp-image-196  " title="irSight-6" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-6-300x265.jpg" alt="" width="300" height="265" /></a><p class="wp-caption-text">5) Undo the 6 plastic clips holding the two pieces of the plastic case together. Then use tweezers to undo the lock holding the wide ribbon cable to the main circuit board and lift off the CCD and lens assembly.  </p></div>
<div id="attachment_199" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-9.jpg"><img class="size-medium wp-image-199" title="irSight-9" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-9-300x204.jpg" alt="" width="300" height="204" /></a><p class="wp-caption-text">6) Release the ribbon cable from the CCD board and undo the three screws holding it to the lens assembly.</p></div>
<p>You should now have access to the IR filter. It is a small piece of glass with a red tint to it. The red tint is what filters out the IR light. If you just removed the glass the camera becomes short sighted, instead you need to remove the film from the glass. I managed this by scraping it with my thumb nail for a while with some hot water and dish soap. Nothing seemed to happen for a while, but then it came off in little bits. You should be able to completely remove the red tint from the glass. It is probably best not to use anything hard which could scratch the glass. One person suggested that you use a <a href="http://www.tuaw.com/2009/12/08/diy-isight-night-vision-camera/">bath of sulfuric acid</a> but I think that is overkill -Â  just use a bit of vinegar if you have any trouble.</p>
<div id="attachment_198" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-8.jpg"><img class="size-medium wp-image-198 " title="irSight-8" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-8-300x67.jpg" alt="7) The IR filter before and after cleaning and two pieces of processed photographic film cut to the same size. " width="300" height="67" /></a><p class="wp-caption-text">7) The IR filter before and after cleaning, and the print film negative cut to the same size.</p></div>
<p>Cut out two pieces of the photographic film to the same dimensions of the glass which the IR filter was on. Note that you want processed print film negative which is completely black. It will stop visible light but let IR light through. Mine was pretty much black (it had a brown tint to it). I decided to use two layers a I could still see some light through just one and adding the second layer did not seem to reduce the amount of IR getting through.</p>
<div id="attachment_197" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-7.jpg"><img class="size-full wp-image-197 " title="irSight-7" src="http://blog.jjhale.com/wp-content/uploads/2010/03/irSight-7.jpg" alt="" width="500" height="117" /></a><p class="wp-caption-text">8) Remove the IR filter, clean off the IR filtering film, insert the print film and place the cleaned IR filter back on top. You may find that the glass sticks up a bit, don&#39;t worry the foam around the CCD will push it down.</p></div>
<p>Now you just have to reassemble the camera and you are done.</p>
<p>I bought a couple of IR LEDs to use as a light source below are a couple of examples from the irSight camera. Leave a comment if you have a go at this conversion or have any questions.</p>
<div id="attachment_200" class="wp-caption alignleft" style="width: 160px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/colorEyeEg.jpg"><img class="size-thumbnail wp-image-200  " title="colorEyeEg" src="http://blog.jjhale.com/wp-content/uploads/2010/03/colorEyeEg-150x150.jpg" alt="Eye seen in visible spectrum" width="150" height="150" /></a><p class="wp-caption-text">My eye as seen by the iSight before conversion. Note the screen reflection.</p></div>
<div id="attachment_202" class="wp-caption alignleft" style="width: 160px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/IReyeEg.jpg"><img class="size-thumbnail wp-image-202 " title="IReyeEg" src="http://blog.jjhale.com/wp-content/uploads/2010/03/IReyeEg-150x150.jpg" alt="Eye seen in IR spectrum" width="150" height="150" /></a><p class="wp-caption-text">My eye using the iSight after conversion lit by one IR LED. Note how sharp the edge of the pupil is. </p></div>
<div id="attachment_201" class="wp-caption alignleft" style="width: 160px"><a href="http://blog.jjhale.com/wp-content/uploads/2010/03/IR20USD.jpg"><img class="size-thumbnail wp-image-201  " title="IR20USD" src="http://blog.jjhale.com/wp-content/uploads/2010/03/IR20USD-150x150.jpg" alt="20 dollar bill in IR spectrum" width="150" height="150" /></a><p class="wp-caption-text">A security feature on a $20 bill. Under normal light the white stripe is not visible.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2010/03/10/irsight-converting-isight-webcam-to-ir-webcam/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Linking a domain to a website – Part 2 Finding the DNS</title>
		<link>http://blog.jjhale.com/2009/10/04/linking-a-domain-to-a-website-part-2-finding-the-dns/</link>
		<comments>http://blog.jjhale.com/2009/10/04/linking-a-domain-to-a-website-part-2-finding-the-dns/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 18:21:40 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Webmaster]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=123</guid>
		<description><![CDATA[Tips for ensuring a smooth change in name servers for your site.]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://blog.jjhale.com/2009/10/03/linking-a-domain-to-a-website-part-1-setting-up-the-dns/">part 1</a> of this guide I described what a DNS was and how to set it up for GoDaddy hosting. In this part, I&#8217;ll show you how to check that you have the right DNS names and how to set them with your domain registrar.</p>
<h2>Finding and checking the names of the name servers</h2>
<p>Getting the name of the name server right is important. If you choose the wrong name servers no-one will be able to see your site. Changing name servers takes some time to process, during which time your site may be inaccessible.Â  If you are transferring a live site you probably want to minimise down time and can&#8217;t afford to make a mistake or find the right name servers by trial and error.</p>
<p><span id="more-123"></span></p>
<p>You may find that your hosting provider does not clearly indicate the name servers that you should use. GoDaddy for example provides a cryptic date based list (more on that later).</p>
<p>If you have a list of several possible name servers, the easiest way I found to make sure that I chose the right one was just to ask each where it thought my site was. The default name servers will be the ones which get it right. You can do this testing using the linux &#8220;dig&#8221; command called. There is a <a title="Web interface for the dig command" href="http://www.digwebinterface.com/">web interface for dig</a> which makes it very easy. Here is what you need to do:</p>
<ol>
<li>Get the list of possible name servers used by your host. (I&#8217;ve listed the GoDaddy ones at the end of this post).</li>
<li>Go to <a title="Web interface for dig command" href="http://www.digwebinterface.com/" target="_blank">http://www.digwebinterface.com/</a></li>
<li>Enter the domain name that you have just set up in the &#8220;<strong><span style="text-decoration: underline;">H</span>ostnames or IP addresses:&#8221;</strong> box.</li>
<li>In the <strong><span title="Select the type of record you want to lookup"><span style="text-decoration: underline;">T</span>ype:</span></strong> drop down list choose &#8220;NS&#8221; (for name server)</li>
<li>In the <strong>Nameservers:</strong> section choose <strong><span title="Specify yourself which nameservers to ask"><label for="self">Specify <span style="text-decoration: underline;">m</span>yself:</label></span></strong> and in the box below paste the list of your hosting provider&#8217;s potential name servers.</li>
<li>Click the &#8220;<strong>dig</strong>&#8221; button (not the &#8220;reset form&#8221; button which is annoyingly just below the box you jut pasted into!)</li>
</ol>
<p>You should then see a growing list of the name servers that are being queried. For each name server you get a line something like this:</p>
<blockquote><p><strong>yournewdomain.com@n74.somenameserver.com:</strong></p></blockquote>
<p>If there is no information about domain on this server you&#8217;ll see a couple of blank line and then the next name server information. If your authoritative name servers are in the list of possible name servers they will have information after them, looking like:</p>
<blockquote><p><strong>yournewdomain.com@ns20.somenameserver.com:</strong></p>
<pre>yournewdomain.com.	<span title="1h">3600</span>	IN	<span>NS</span>	ns20.somenameserver.com.
yournewdomain.com.	<span>3600</span>	IN	<span>NS</span>	ns21.somenameserver.com.</pre>
</blockquote>
<p>And these are your name servers (eg ns20.somenameserver.com and ns21.somenameserver.com).</p>
<h3>GoDaddy details</h3>
<p>GoDaddy&#8217;s documentation for finding the name of your name server was not as clear as it could be. After a bit of searching on the support section I found the &#8220;<a title="GoDaddy getting started with Linux hosting guide" href="http://help.godaddy.com/article/1361" target="_blank">Getting Started with Linux SharedÂ Hosting</a>&#8221; pdf (version 2.4 (12.03.07) ).</p>
<p>The document has a section on name servers and states:</p>
<blockquote><p>The default nameservers for your hosting account depend on the date you set up your<br />
hosting. Use this list to determine your default nameservers:</p></blockquote>
<p>There then follows a list of date ranges and corresponding name servers. The above statement suggested to me that the relevant date was the one that I &#8220;set up your hosting&#8221; &#8211; i.e. the date I first got the hosting account and put my first website on it. However, I think that they actually mean the date that you set up the name server for the domain.</p>
<p>DNS list for GoDaddy as of October 2009:</p>
<pre>ns25.domaincontrol.com
ns26.domaincontrol.com
ns51.domaincontrol.com
ns52.domaincontrol.com
ns43.domaincontrol.com
ns44.domaincontrol.com
ns5.secureserver.net
ns6.secureserver.net
ns3.secureserver.net
ns4.secureserver.net
ns1.secureserver.net
ns2.secureserver.net
wsc1.jomax.net
wsc2.jomax.net</pre>
<h2>Setting the name servers with your domain registrar</h2>
<p>Now we have set up the name servers and know their names we can change them at your domain registrar&#8217;s end. In my case I was changing the name server for a domain registered with UK Reg. You basically go to the web site of the domain registrar that you registered with, then go to the control panel and find the DNS management.</p>
<p>Before you change the name servers make a note of the old ones (in case something goes a bit wrong). You should also be aware that the name servers will be handling everything related to the domain you are planning to change. If you have email being handled by you domain registrar you&#8217;ll need to set up emails with your hosting DNS.</p>
<p>Enter the name servers that you found out when you set up the hosting side and save your changes.</p>
<p>As we mentioned before, name servers use caching. This caching means that when you change your authoritative name sever addresses in your domain registrar control panel it will take a while for name servers all over the world to update their caches.</p>
<p>You can track the progress of your change around the world by entering your domain intoÂ  <a title="Global DNS propergation checker" href="http://www.whatsmydns.net/">http://www.whatsmydns.net/</a>. It will query a random sample ofÂ  name servers around the world so you can see the change getting picked up around the world.</p>
<h2>A short note on email</h2>
<p>If you had email set up with your registrar you may need to change something called the MX records for your new DNS servers (you&#8217;d make these changes through your hosting control panel under DNS settings). Alternatively your hosting package may include some email facilities which you could use instead.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2009/10/04/linking-a-domain-to-a-website-part-2-finding-the-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linking a domain to a website – Part 1 Setting up the DNS</title>
		<link>http://blog.jjhale.com/2009/10/03/linking-a-domain-to-a-website-part-1-setting-up-the-dns/</link>
		<comments>http://blog.jjhale.com/2009/10/03/linking-a-domain-to-a-website-part-1-setting-up-the-dns/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 22:56:39 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[fasthosts]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[name server]]></category>
		<category><![CDATA[UKReg]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=156</guid>
		<description><![CDATA[An overview of DNS and setting up GoDaddy hosting for a domain registered by a third party.]]></description>
			<content:encoded><![CDATA[<p>Linking a domain registered with one company to a website hosted by a <em>different</em> company can seem complicated. There are several options to consider &#8211; frame forwarding, transferring the domain and changing the DNS servers. I think that changing the DNS is often the best option, but it can seem complicated.</p>
<p>In this post I introduce the domain name server (DNS) and what you need to set up. In the <a href="http://blog.jjhale.com/2009/10/04/linking-a-domain-to-a-website-part-2-finding-the-dns/">next part</a> I&#8217;ll describe how to check that you know the address for the right DNS before you make the switch.</p>
<p><span id="more-156"></span></p>
<p>The easiest method to link the website and domain may be to use frame forwarding. Frame forwarding is where your domain registrar hosts a page containing a single frame at your domain name (eg http://mysite.com). This frame then loads content from a different web address (e.g. http://mybroadbandprovider.com/~user123/web). I don&#8217;t like frame forwarding as the address bar in the browser will always show http://mysite.com, no matter where they go within the framed site until a link isÂ  opened in a new window or tab. Then the long ugly address gets displayed in the address bar. External sites trying to link to specific pages have to use the long ugly address rather than the nice short domain name you&#8217;ve paid for and registered. Some search engine take a dim view of frame forwarding and so it can affect where you get listed.</p>
<p>Transferring the domain to the company you host at will cost you money, but can help keep everything simple in the medium term.</p>
<p>Changing the DNS setting is the &#8220;propper&#8221; way to link the hosting and the domain name. It can seem like a black art at first but it is actually quite straight forward. All you have to do is tell the people with whom you registered to use the &#8220;domain name server&#8221; (DNS) of the company that you host with. I&#8217;ve recently changed the DNS setting for a site hosted on GoDaddy with a domain registered with a different company (UKReg / FastHosts). Here I&#8217;m posting a couple of tip that I found helpful. This post introduces DNS and the next one covers tools for making sure the transition goes smoothly.</p>
<h2>What is a domain name server?</h2>
<p>It helps to have an idea of what an authoritative name server is and what it does. The authoritative name server for a domain name will tell your computer the address of the server hosting the site corresponding to that name &#8211; its like a phone book for the internet. For example taking the domain name www.yahoo.com and giving back the IP address 69.147.114.224 of the server. Theoretically domain name servers (DNS) work together in a hierarchy, decoding a domain name from right to left, where the dots in a domain name separate each level. The DNS for a level will direct you to the DNS to ask about the next level until you reach the authoritative name server.</p>
<p>For example when looking up &#8220;blog.jjhale.com&#8221;, the computer asks the &#8220;com&#8221; DNS for the address. This name server tells the computer to ask the name server which knows about to&#8221;jjhale&#8221;, which in turn will tell the computer the address corresponding to &#8220;blog&#8221; in &#8220;blog.jjhale.com&#8221;. This final domain name server, the one which actually knows the address corresponding to the domain, is called the authoritative name server.</p>
<p>In practice name servers use caching to reduce the load on the top level name servers (.com, .org, .net, etc). When some DNS has been told the address corresponding to a domain name by an authoritative name server it can store it for some period. If asked about same domain name again it can just use the cached address without needing to find and ask the authoritative name server again.</p>
<p>To get a domain name to point to a website hosted on your server (or GoDaddy&#8217;s or whoever&#8217;s) the authoritative name server has to point to your server. This condition has two parts:</p>
<ol>
<li>You need a name server pointing to your hosting server and;</li>
<li>you need your registered domain name to call that name server its authoritative name server.</li>
</ol>
<p>When you buy your hosting from the same company that you register you domain from this link up is usually all done automatically for you. If you have a domain registered at one place and hosting somewhere else you need to link these up yourself by changing settings in the two different places.</p>
<h2>Setting up the name server</h2>
<p>The setting up of the name server needs to be done on the hosting side. In my case the website was hosted on GoDaddy space. I went into the hosting control panel (Hosting -&gt; My Hosting Account, then Manage Account) and clicked on &#8220;Domain Management&#8221; in the &#8220;Settings&#8221; section.</p>
<p>Next click &#8220;add domain&#8221;. Here you enter the domain name (eg jjhale.com) and browse to the folder in your hosting account that you want to be the root of for that domain (i.e. the folder containing the corresponding website). You can also create a new folder to put the site into.</p>
<p>Hit OK and you&#8217;ll see the new domain name listed in the table of domains associated with your hosting account. In the status column it will probably say &#8220;pending&#8221;. In my case it only took a few minutes for the status to change to &#8220;Setup&#8221;.</p>
<p>The name server is now set up and ready to go. Next you need to make sure that you know the addresses of your DNS. This topic is covered in part two.</p>
<p>Note: When you switch name servers for the domain you&#8217;ll have to update setting for any email addresses associated with the domain too (cf. MX records). This is not covered here, but you should be aware of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2009/10/03/linking-a-domain-to-a-website-part-1-setting-up-the-dns/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Kiva Wedding Gifts</title>
		<link>http://blog.jjhale.com/2009/09/03/kiva-wedding-gifts/</link>
		<comments>http://blog.jjhale.com/2009/09/03/kiva-wedding-gifts/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 00:01:43 +0000</pubDate>
		<dc:creator>Joe Hale</dc:creator>
				<category><![CDATA[Websites]]></category>
		<category><![CDATA[Kiva]]></category>
		<category><![CDATA[wedding]]></category>

		<guid isPermaLink="false">http://blog.jjhale.com/?p=116</guid>
		<description><![CDATA[Use Kiva to ensure a lack of post wedding clutter by getting people to help out entrepreneurs in the developing world rather than giving toasters at a wedding.]]></description>
			<content:encoded><![CDATA[<p>I am not a big fan of having too much stuff. So when I got married earlier this year we decided that we did not want to ask our friends and family for gifts. However, it turned out that people felt very strongly that they wanted to give us stuff. My wife found a great compromise which allowed us to help entrepreneurs in the developing world grow their businesses and achieve economic stability by providing micro-loans.</p>
<p><span id="more-116"></span></p>
<div id="attachment_119" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-119" title="Titilayo Ajado" src="http://blog.jjhale.com/wp-content/uploads/2009/09/KivaImg-300x225.jpg" alt="Titilayo sells drinks and is requesting the loan to purchase drinks to sell, so as to be able to meet the demands of her customers." width="300" height="225" /><p class="wp-caption-text">Titilayo is requesting a loan to purchase drinks to sell, so as to be able to meet the demands of her customers.</p></div>
<p>Instead of setting up a regular gift registry we asked that people gave us gift certificates for an organisation called <a title="Kiva - Loans that change lives - micro-lending" href="http://www.kiva.org/">Kiva</a>.</p>
<p>Kiva facilitates person to person micro-lending. Entrepreneurs in developing countries are able to solicit funding for their business through the kiva.org site. Potential lenders search through these listings and provide some of the cash required. As the money is repaid it can be reinvested or withdrawn by the lender.</p>
<p>We support Kiva&#8217;s mission of facilitating economic growth in the developing world. Also we&#8217;ve since discovered that their headquarters is a block away from our house after their wireless signal showed up on our laptops.</p>
<p>Liz and I chose to focus our lending in Africa because we have personal connections there. We have made 19 loans so far which you can track on our <a title="Joe Hale's Kiva Lender Page" href="http://www.kiva.org/lender/JoeHale">Kiva lender page</a>.</p>
<p>Having <a title="Kiva gifts" href="http://www.kiva.org/app.php?page=gift&amp;action=home">Kiva gift certificates</a> as wedding gifts worked out pretty well. The process of giving a gift certificates could be made easier though. People had to create their own Kiva account before being able to give the certificate &#8211; which provided a barrier for some people.Â  Wedding guest who were not so internet savvy, who were wary of using their credit cards on-line or not sure about paying in US dollars just gave us cheques to buy the Kiva credit ourselves.</p>
<p>This kind of micro-lending is fairly new and so some people were not 100% clear about what we were asking for. I think a few mistook it for just giving money to charity in our name. Since there is the option of cashing out however it is also a very useful gift to a couple starting out.</p>
<p>Liz and I would like to thank everyone who contributed to our Kiva lending. We&#8217;ll be posting updates of our lending experiences here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjhale.com/2009/09/03/kiva-wedding-gifts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 1.612 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-13 04:40:10 --><!-- Compression = gzip -->

