<?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>More Than Technical &#187; work</title>
	<atom:link href="http://www.morethantechnical.com/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.morethantechnical.com</link>
	<description>On software, code, the internet and more.</description>
	<lastBuildDate>Mon, 06 Feb 2012 23:48:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Getting all the links from a MediaWiki format using PyParsing</title>
		<link>http://www.morethantechnical.com/2011/06/16/getting-all-the-links-from-a-mediawiki-format-using-pyparsing/</link>
		<comments>http://www.morethantechnical.com/2011/06/16/getting-all-the-links-from-a-mediawiki-format-using-pyparsing/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 15:14:04 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[pyparsing]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=882</guid>
		<description><![CDATA[Hi, Just sharing a snippet of code. Part of a project I&#8217;m doing, I need to analyse the links in the Wikipedia corpus. While using the API is one solution, it doesn&#8217;t retain the order of where links appear in the page. It also returns links that are not part of the main text, which [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
Just sharing a snippet of code. Part of a project I&#8217;m doing, I need to analyse the links in the Wikipedia corpus. While using the <a href="http://www.mediawiki.org/wiki/API:Properties#links_.2F_pl">API</a> is one solution, it doesn&#8217;t retain the order of where links appear in the page. It also returns links that are not part of the main text, which makes the linkage DB very cluttered.<br />
So, I set out to parse the raw <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a> format all Wikipedia articles are written in, to get only the relevant links and in order. I call them contextual because they live inside the text and have context.<br />
Initially I used string matching, and other complex string scraping parsing methods. It was a bust. There are too many end-cases to deal with. That is when I discovered <a href="http://pyparsing.wikispaces.com/HowToUsePyparsing">PyParsing</a>, the excellent parsing library. It did the job, and here are the results.<br />
<span id="more-882"></span></p>
<h2>The grammer</h2>
<p>This is the grammer I have so far:</p>
<pre class="brush: plain; title: ; notranslate">

	textNoStop = Regex('[^\s\{\}\[\]\(\)]+')
	myHtmlComment = QuotedString(&quot;&lt;!--&quot;,endQuoteChar=&quot;--&gt;&quot;,multiline=True)
	regularText = (textNoStop ^ Literal(&quot;[&quot;) ^ Literal(&quot;]&quot;) ) 

	regularBrackets = Forward()
	regularBrackets &lt;&lt; Combine(Literal(&quot;(&quot;) + ZeroOrMore(Regex('[^\(\)]+') ^ regularBrackets) + Literal(&quot;)&quot;))

	link = Forward()
	link &lt;&lt; Combine( Literal(&quot;[[&quot;).suppress() + ZeroOrMore(Regex('[^\[\]]+') ^ link) + Literal(&quot;]]&quot;).suppress()) 

	curlyShit = Forward()
	curlyShit &lt;&lt; Combine( Literal(&quot;{{&quot;) + ZeroOrMore( Regex('[^\{\}]+') ^ curlyShit ) + Literal(&quot;}}&quot;) , joinString=&quot; &quot;) 

	curlyCurlyBar = QuotedString(&quot;{|&quot;,endQuoteChar=&quot;|}&quot;,multiline=True)+Optional(QuotedString(&quot;}&quot;,endQuoteChar=&quot;|}&quot;,multiline=True))
	strangeCurlyBar = QuotedString(&quot;|&quot;,endQuoteChar=&quot;|}&quot;,multiline=True) #+NotAny(Literal(&quot;}&quot;)) # strangely it may also appear like this...
	curlyBar = curlyCurlyBar ^ strangeCurlyBar

	strangeBeginRemark = Combine(Literal(&quot;:&quot;) + QuotedString(&quot;''&quot;) , joinString=&quot; &quot;)

	if debug:
		wikiMarkup = OneOrMore(regularText ^ strangeBeginRemark ^ curlyBar ^ curlyShit ^ myHtmlComment ^ link ^ regularBrackets)
	else:
		wikiMarkup = Optional(OneOrMore(regularText.suppress() ^ strangeBeginRemark.suppress() ^ curlyBar.suppress() ^ curlyShit.suppress() ^ myHtmlComment.suppress() ^ link ^ regularBrackets.suppress()))
</pre>
<p>If you&#8217;re not familiar with PyParsing, these are simply rules for each element in the format that I considered relevant.<br />
So first I had to get rid of any &#8220;double curly&#8221; things in the MediaWiki format (MWf), and they can be nested which stikes out using the simple QuotedString method. I had to build a recursive grammer:</p>
<pre class="brush: plain; title: ; notranslate">
	curlyShit = Forward()
	curlyShit &lt;&lt; Combine( Literal(&quot;{{&quot;) + ZeroOrMore( Regex('[^\{\}]+') ^ curlyShit ) + Literal(&quot;}}&quot;) , joinString=&quot; &quot;)
</pre>
<p>As you can see I wasn&#8217;t so happy with it&#8230;<br />
Anyway, first I have to make an empty declaration of the double-curly, so I can use it recursively, and then work it into the grammer. It basically looking for an opening &#8216;{{&#8216; and won&#8217;t stop looking inside it until it hits a &#8216;{&#8216; (or a &#8216;}&#8217;), then allows for another possible double-curly, and just keeps going until the end. It works.</p>
<p>The rules for the other nested things in the MWf are implemented the same way.</p>
<h2>All done?</h2>
<p>Alright, everything seems fine and dandy. Well they are not, because Wikipedia is a cesspool of errors in the format, such as this value: http://en.wikipedia.org/wiki/Fianna_Fail (keep in mind it might be updated and fixed by the time you read this)<br />
Which has an un-balanced parenthesis:</p>
<pre class="brush: plain; title: ; notranslate">
'''Fianna Fáil – The Republican Party''' ({{lang-ga|Fianna Fáil – An Páirtí Poblachtánach}}), more commonly known as '''Fianna Fáil''' ({{IPA-ga|ˌfʲiənə ˈfɔːlʲ}} is a [[political party]] in the [[Republic of Ireland]],
</pre>
<p>It&#8217;s right after the IPA double-curly.</p>
<p>And, since my grammer works well for balanced and correctly formatted documents &#8211; it fails on this document.</p>
<p>There are more anomalis in the format like this (from http://en.wikipedia.org/wiki/Fredrich_Wilhelm_I_of_Prussia):</p>
<pre class="brush: plain; title: ; notranslate">
{{Refimprove|date=December 2009}}
{|align=right
|{{Infobox royalty|monarch
| name           = Frederick William I
| title          =King in Russia; Elector of Brandenburg
| image          =Friedrich Wilhelm I 1713.jpg
....

| death_place =[[Berlin]], [[Kingdom of Prussia|Prussia]]
| place of burial=[[Sanssouci]], [[Potsdam]]
| religion         =[[Calvinism]]
|}}
|-
|{{House of Hohenzollern (Prussia)|frederickwilliam1}}
|}
</pre>
<p>While it may seem OK, it&#8217;s really parser&#8217;s hell&#8230; See that opening &#8220;{|&#8221;? that&#8217;s cool but then comes the closing &#8220;|}}&#8221;, which also matches for the real closer &#8220;|}&#8221;, that only appears later&#8230;</p>
<p>There are more anomalis like that, it&#8217;s a whole mess.</p>
<h2>Results</h2>
<p>Anyway, looking at the big picture I was able to parse ~99.9% of the articles, which is fine by me. Only Wikipedia is ~10,000,000 articles (incl. redirects and disambigs), so I know I&#8217;m missing a lot.</p>
<p>So, here&#8217;s a result:<br />
<strong>Original: <a href="http://en.wikipedia.org/wiki/Machine">Machine</a></strong></p>
<pre class="brush: plain; title: ; notranslate">
{{About|devices that perform tasks|other uses|Machine (disambiguation)}}
A '''machine''' manages power to accomplish a task, examples include, a [[mechanical system]], a [[computer|computing system]], an [[electronic system]], a [[molecular machine]] and a [[biological machine]]. In common usage, the meaning is that of a device having parts that perform or assist in performing any type of [[Work (physics)|work]]. A [[simple machine]] is a device that transforms the direction or magnitude of a [[force]].
</pre>
<p><strong>Links found after parsing</strong></p>
<pre class="brush: plain; title: ; notranslate">
['mechanical system', 'computer|computing system', 'electronic system', 'molecular machine', 'biological machine', 'Work (physics)|work', 'simple machine', 'force']
</pre>
<p>Another one:<br />
Original: <a href="http://en.wikipedia.org/wiki/Agrippina_the_elder">Agrippina the elder</a></p>
<pre class="brush: plain; title: ; notranslate">
{{Infobox royalty
| name        = Agrippina the Elder
| image       = Agripina Maior (M.A.N. Madrid) 01.jpg
| caption     = Agrippina, wife of Germanicus
| imgw        = 200px
| spouse      = [[Germanicus]]
| issue       = [[Nero (son of Germanicus)|Nero Caesar]]&lt;br&gt;[[Drusus Caesar]]&lt;br&gt;[[Caligula]], Roman Emperor&lt;br&gt;[[Agrippina the Younger]], Roman Empress&lt;br&gt;[[Drusilla (sister of Caligula)|Julia Drusilla]]&lt;br&gt;[[Julia Livilla]]
| father      = [[Marcus Vipsanius Agrippa]]
| mother      = [[Julia the Elder]]
| birth_date   = 14 BC
| birth_place  = [[Athens]], [[Greece]]
| death_date   = 18 October 33 (aged 47)
| death_place  = [[Ventotene|Pandataria]]
| place of burial = [[Ventotene|Pandataria]], later the &lt;br&gt;[[Mausoleum of Augustus]]
}}

'''Vipsania Agrippina''' or most commonly known as '''Agrippina Major''' or '''Agrippina the Elder''' (''Major'' Latin for ''the elder'', [[Classical Latin]]: &lt;small&gt;AGRIPPINAGERMANICI&lt;/small&gt;,&lt;ref&gt;{{Aut|E. Groag, A. Stein, L. Petersen - e.a.}} (edd.), ''Prosopographia Imperii Romani saeculi I, II et III'' ('''[[PIR]]'''), Berlin, 1933 - V 463&lt;/ref&gt; 14 BC  [[18 October]] [[33]]) was a distinguished and prominent granddaughter of the Emperor Augustus. Agrippina was the wife of the general, statesman [[Germanicus]] and a relative to the first [[Roman Emperors]]. She was the second granddaughter of the Emperor [[Augustus]], sister-in-law, stepdaughter and daughter-in-law of the Emperor [[Tiberius]], mother of the Emperor [[Caligula]], maternal second cousin and sister-in-law of the Emperor [[Claudius]] and the maternal grandmother of the Emperor [[Nero]].
</pre>
<p>Links found:</p>
<pre class="brush: plain; title: ; notranslate">
['Germanicus', 'Roman Emperors', 'Augustus', 'Tiberius', 'Caligula', 'Claudius', 'Nero']
</pre>
<p>See it handled all the curlys with grace.</p>
<p>So, code is up:</p>
<pre class="brush: plain; title: ; notranslate">
svn checkout http://morethantechnical.googlecode.com/svn/trunk/simpleWikiParser/simpleWiki.py
</pre>
<p>Enjoy,<br />
Roy.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2011%2F06%2F16%2Fgetting-all-the-links-from-a-mediawiki-format-using-pyparsing%2F&amp;title=Getting%20all%20the%20links%20from%20a%20MediaWiki%20format%20using%20PyParsing" id="wpa2a_2"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2011/06/16/getting-all-the-links-from-a-mediawiki-format-using-pyparsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UnderGet – Download blocked content</title>
		<link>http://www.morethantechnical.com/2011/06/08/underget-%e2%80%93-download-blocked-content/</link>
		<comments>http://www.morethantechnical.com/2011/06/08/underget-%e2%80%93-download-blocked-content/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 14:39:33 +0000</pubDate>
		<dc:creator>Arnon</dc:creator>
				<category><![CDATA[Recommended]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[blocked content]]></category>
		<category><![CDATA[corporate]]></category>
		<category><![CDATA[file extension]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=876</guid>
		<description><![CDATA[Ever wanted to try and download an mp3 file at your workplace, but couldn&#8217;t because corporate firewall policy was to block every url ending with the .mp3 prefix? I had. Until recently, I&#8217;d accept this as it was from above, but that was until I discovered this website called UnderGet. The trick is pretty simple. [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to try and download an mp3 file at your workplace, but couldn&#8217;t because corporate firewall policy was to block every url ending with the .mp3 prefix?<br />
<span id="more-876"></span></p>
<p>I had. Until recently, I&#8217;d accept this as it was from above, but that was until I discovered this website called <a href="http://www.underget.com">UnderGet</a>.</p>
<p>The trick is pretty simple. The engine behind this site works by renaming the file or encoding its content so the blocking software cannot detect it.</p>
<p>I am now able to download my favorite podcast mp3 files when I&#8217;m at my workplace</p>
<p style="text-align: center;"><img src="http://www.morethantechnical.com/wp-content/uploads/2011/06/060811_1439_UnderGetDow1.png" alt="" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2011%2F06%2F08%2Funderget-%25e2%2580%2593-download-blocked-content%2F&amp;title=UnderGet%20%E2%80%93%20Download%20blocked%20content" id="wpa2a_4"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2011/06/08/underget-%e2%80%93-download-blocked-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hand gesture recognition via model fitting in energy minimization w/OpenCV</title>
		<link>http://www.morethantechnical.com/2010/12/28/hand-gesture-recognition-via-model-fitting-in-energy-minimization-wopencv/</link>
		<comments>http://www.morethantechnical.com/2010/12/28/hand-gesture-recognition-via-model-fitting-in-energy-minimization-wopencv/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 22:11:12 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Recommended]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[vision]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[computer vision]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=762</guid>
		<description><![CDATA[Hi Just wanted to share a thing I made &#8211; a simple 2D hand pose estimator, using a skeleton model fitting. Basically there has been a crap load of work on hand pose estimation, but I was inspired by this ancient work. The problem is setting out to find a good solution, and everything is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.morethantechnical.com/wp-content/uploads/2010/12/hands.png" rel="lightbox[762]"><img src="http://www.morethantechnical.com/wp-content/uploads/2010/12/hands-300x248.png" alt="hands with model fitted" title="hands with model fitted" width="300" height="248" class="aligncenter size-medium wp-image-796" /></a>Hi</p>
<p>Just wanted to share a thing I made &#8211; a simple 2D hand pose estimator, using a skeleton model fitting. Basically there has been a crap load of work on hand pose estimation, but I was inspired by <a href="http://scholar.google.com/scholar?cluster=136383770354228708&#038;hl=en&#038;as_sdt=40000000">this ancient work</a>. The problem is setting out to find a good solution, and everything is very hard to understand and implement. In such cases I like to be inspired by a method, and just set out with my own implementation. This way, I understand whats going on, simplify it, and share it with you!</p>
<p>Anyway, let&#8217;s get down to business.<br />
<span id="more-762"></span></p>
<h1>A bit about energy minimization problems</h1>
<p>A dear friend revealed before me the wonders of energy minimization problems a while back, and ever since I have trying to find uses for that method. Basically, it is trying to find a global minimum for a complicated energy function (usually with many parameters), by following the function&#8217;s gradient. Such methods are often called <a href="http://en.wikipedia.org/wiki/Gradient_descent">Gradient Descent</a>, and used mostly for non-linear systems that can&#8217;t be solved easily using a least-squares variant. </p>
<p>A lot of work in computer vision was done using energy functions (I believe the most seminal was <a href="http://scholar.google.com/scholar?cluster=10809837120977085662&#038;hl=en&#038;as_sdt=40000000">Snakes</a>, over 10,000 citations), usually having two terms: Internal energy and External energy. The equilibrium between the two terms should result in a low-energy system &#8211; our optimal result. So we would like to formulate the terms in our system such that when they are 0 &#8211; they describe the system as we want it.</p>
<p>Following the works with active contours, I believe the external energy function should have to do with how the hand model fits to the hand blob, and the internal energy will have to do with how &#8220;comfortable&#8221; the hand is with this configuration.</p>
<h1>The hand model</h1>
<p>Let&#8217;s see how a 2D model of a hand might look like<br />
<a href="http://www.morethantechnical.com/wp-content/uploads/2010/12/Screen-shot-2010-12-25-at-10.50.41-AM.png" rel="lightbox[762]"><img src="http://www.morethantechnical.com/wp-content/uploads/2010/12/Screen-shot-2010-12-25-at-10.50.41-AM.png" alt="" title="Screen shot 2010-12-25 at 10.50.41 AM" width="232" height="231" class="aligncenter size-full wp-image-790" /></a><br />
Kinda looks like a rake&#8230; huh?</p>
<p>There are some parts that practically can&#8217;t change much, i.e the palm (orange), and some that might change drastically, i.e the fingers (red). Each finger has joints (blue circle), and a tip (bigger blue circle).</p>
<pre class="brush: plain; title: ; notranslate">
typedef struct finger_data {
	Point2d origin_offset;		//base or finger relative to center hand
	double a;					//angle
	vector&lt;double&gt; joints_a;	//angles of joints
	vector&lt;double&gt; joints_d;	//bone length
} FINGER_DATA;

typedef struct hand_data {
	FINGER_DATA fingers[5];		//fingers
	double a;					//angle of whole hand
	Point2d origin;				//center of palm
	Point2d origin_offset;		//offset from center for optimization
	double size;				//relative size of hand = length of a finger
} HAND_DATA;
</pre>
<p>At first I thought, since I&#8217;m only interested in the tips of the fingers, to use Inverse Kinematics to guide the tips to a certain point and let the joints find their own minimal energy position, following <a href="http://freespace.virgin.net/hugo.elias/models/m_ik2.htm">this</a> article. But I abandoned this method because of complications. </p>
<p>I also had to simplify this model, for real-time estimation and also better results. So in the end I ended up with a very rigid model, that allows only on joint per finger and no angular movement.</p>
<h1>Using tnc.c</h1>
<p>tnc.c is a &#8220;library&#8221;, essentially one c file, that implements a line search algorithm that is able to find the minimum point of a multi-variate function. I&#8217;m not certain of the algorithm details, and it&#8217;s not so important as it can be replaced with any other similar library. But, tnc.c has a great advantage &#8211; it is dead simple. One function will start the gradient decent, calling-back a function to calculate the gradients.</p>
<p>So basically I had to write just one very short function:</p>
<pre class="brush: plain; title: ; notranslate">
static int my_f(double x[], double *f, double g[], void *state) {
	DATA_FOR_TNC* d_ptr = (DATA_FOR_TNC*)state;
	DATA_FOR_TNC new_data = *d_ptr;

	mapVecToData(x,new_data.hand);

	*f = calc_Energy(new_data,*d_ptr);

	//calc gradients
	{
		double _x[SIZE_OF_HAND_DATA];

		for(int i=0;i&lt;SIZE_OF_HAND_DATA;i++) {
			memcpy(_x, x, sizeof(double)*SIZE_OF_HAND_DATA); //reset variables
			_x[i] = _x[i] + EPSILON; //change only one variable
			mapVecToData(_x, new_data.hand);
			double E_epsilon = calc_Energy(new_data,*d_ptr);
			g[i] = ((E_epsilon - *f) / EPSILON); //calc the gradient for this variable change
		}
	}

	return 0;
}
</pre>
<p>This function is called by tnc.c on every iteration of the search, the <code>double x[]</code> is the state of variables the search is now examining, <code>double* f</code> is the energy for this state, <code>double g[]</code> are the gradients (same size as x[]), and <code>voide* state</code> is a user-defined variable that can be carried along the process.</p>
<p>So what I did is simply changed the value of each parameter in turn, to test how it effects the energy in the system. I get a measure of the energy, then I subtract it from the &#8220;natural&#8221; setup (without any changes to parameters) energy measure, and I get the gradient for this parameter.</p>
<p>The energy function came out a bit different in the end:</p>
<pre class="brush: plain; title: ; notranslate">

static double calc_Energy(DATA_FOR_TNC&amp; d, DATA_FOR_TNC&amp; orig_d) {
	double _sum = 0.0;

	//external energy: how close are the joints to the hand blob? (how well do they fit to it)
	vector&lt;Point2d&gt; joints;
	Mat tips(5,1,CV_64FC2);

	for (int j=0; j&lt;5; j++) {
		joints.clear();
		FINGER_DATA f = d.hand.fingers[j];
		Point2d _newTip = newTip(f,d.hand,joints); //get joints for this finger

		for (int i=0; i&lt;tmp.size(); i++) { //for each joint find how far it is from the blob
			double ds = pointPolygonTest(d.contour, tmp[i]+getHandOrigin(d.hand), true);
			ds += 5;
			ds = 1 * ((ds &lt; 0) ? -1 : 1) * (ds*ds) ;
			_sum -= (ds &gt; 0) ? 0 : 100*ds;
		}

		tips.at&lt;Point2d&gt;(j,0) = _newTip;
	}

	//lazyness of fingers - joints should strive to be as they were in the natural pose
	vector&lt;double&gt; _angles;
//	for (int j=0; j&lt;5; j++) {
//		FINGER_DATA f = d.hand.fingers[j];
//		FINGER_DATA of = orig_d.hand.fingers[j];
////		_angles.push_back(f.a - of.a);
//		for (int i=0; i&lt;f.joints_d.size(); i++) {
////			_angles.push_back(f.joints_a[i] - of.joints_a[i]);
//			_angles.push_back(f.joints_d[i] - of.joints_d[i]);
//		}
//	}
	_angles.push_back(d.hand.a-orig_d.hand.a); //the angle of the hand should be as it was before
	_sum  += 10000*norm(Mat(_angles));

	if(_sum &lt; 0) return 0;
	return _sum;
}
</pre>
<p>You&#8217;ll notice the commented out section. The &#8220;laziness of fingers&#8221; turned out not to give good results&#8230; A different metric is needed! I have not found it yet, maybe you have a good idea?</p>
<p>Starting tnc.c is very simple: Allocating the vectors for X and gradients, initializing the model from the blob, and calling the <code>simple_tnc</code> convenience method. <code>simple_tnc</code> starts <code>tnc</code> with some default parameters that don&#8217;t affect the outcome (at least in my tries).</p>
<pre class="brush: plain; title: ; notranslate">
void estimateHand(Mat&amp; mymask) {
	double _x[SIZE_OF_HAND_DATA] = {0};
	Mat X(1,SIZE_OF_HAND_DATA,CV_64FC1,_x);
	double f;
	Mat gradients(Size(SIZE_OF_HAND_DATA,1),CV_64FC1,Scalar(0));

	namedWindow(&quot;state&quot;);

	initialize_hand_data(d, mymask);

	mapDataToVec((double*)X.data, d.hand);

	simple_tnc(SIZE_OF_HAND_DATA, (double*)X.data, &amp;f, (double*)gradients.data, my_f, (void*)&amp;d, 1, 0);

	mapVecToData((double*)X.data, d.hand);
	showstate(d,1);

	d.hand.origin = getHandOrigin(d.hand); //move to new position
}
</pre>
<h1>Results and Discussion</h1>
<p>Here are my results so far:<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/uETHJQhK144?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/uETHJQhK144?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>It&#8217;s not perfect, but it&#8217;s a start. Tracking and estimating open hand is pretty good, with some orientation change as well. But when the fingers are closed&#8230; that&#8217;s where problems start. </p>
<p>Sometimes the joints &#8220;hover&#8221; over the black area to &#8220;land&#8221; in a white area so they &#8220;fit&#8221;, but they should not do that. One easy thing to do to counter this is to measure the distance of the whole bone, and not just the joint.</p>
<p>The model right now doesn&#8217;t use all the joints possible, because it is too heavy computationally. Plus the energy does not depend (or change) the angle of the fingers. So this is a very very simple model of a hand&#8230;</p>
<p>But, it is a good start! All the <a href="http://www.youtube.com/watch?v=mLT4CFLIi8A&#038;feature=related">other</a> <a href="http://www.youtube.com/watch?v=6Uw_8Y1RuQQ&#038;feature=related">stuff</a> I <a href="http://www.youtube.com/watch?v=B_UYmQJT-F0&#038;feature=related">have</a> <a href="http://www.youtube.com/watch?v=F8GVeV0dYLM&#038;feature=related">seen</a> <a href="http://www.youtube.com/watch?v=Rmh-mZFxWns&#038;feature=related">online</a> is just basic high-curvature points counting and color-based or feature-based segmentation and tracking&#8230; My model actually tries to fit an articulate and precise model of a hand to the image.</p>
<h1>How did you get such nice blobs?!</h1>
<p>You ask. They are beautiful aren&#8217;t they&#8230; nice and clean, easy for tracking and model fitting. It&#8217;s no magic though&#8230;<br />
Well, I took part of a <a href="http://depthjs.media.mit.edu/">project in the Media Lab, called DepthJS</a>, that uses the MS Kinect to control web pages. I wrote the computer-vision part. So all the <a href="https://github.com/doug/depthjs">code is there</a>, you can grab it, I just plugged it into this little project. Basing off <a href="http://openkinect.org/wiki/C%2B%2BOpenCvExample">this very simple example of using OpenCV2.X and libfreenect</a>.</p>
<p>Wow, this was a longie.. I hope you learned something and got inspired. I got to do a second overview of the project, and I&#8217;m inspired. Inspiration all around!</p>
<p>Code is obviously yours for the taking:<br />
<a href="https://github.com/royshil/OpenHPE">https://github.com/royshil/OpenHPE</a></p>
<p>Please contribute your own views, thoughts, code, rants in the comments and github page.</p>
<p>Enjoy<br />
Roy.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2010%2F12%2F28%2Fhand-gesture-recognition-via-model-fitting-in-energy-minimization-wopencv%2F&amp;title=Hand%20gesture%20recognition%20via%20model%20fitting%20in%20energy%20minimization%20w%2FOpenCV" id="wpa2a_6"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2010/12/28/hand-gesture-recognition-via-model-fitting-in-energy-minimization-wopencv/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Stream your favorite radio station to your workplace</title>
		<link>http://www.morethantechnical.com/2010/01/29/stream-your-favorite-radio-station-to-your-workplace/</link>
		<comments>http://www.morethantechnical.com/2010/01/29/stream-your-favorite-radio-station-to-your-workplace/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 14:53:00 +0000</pubDate>
		<dc:creator>Arnon</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Stream]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[bypass]]></category>
		<category><![CDATA[corporate]]></category>
		<category><![CDATA[re-stream]]></category>
		<category><![CDATA[vlc]]></category>
		<category><![CDATA[worksplace]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=567</guid>
		<description><![CDATA[I want to suggest a trick that worked for me. My work place blocks most of the popular radio stations stream sites in my country. I can understand why they&#8217;re doing that, but hey – if you want to save bandwidth I suggest you block YouTube (not that I complain…) Well, I thought of a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I want to suggest a trick that worked for me. My work place blocks most of the popular radio stations stream sites in my country.<br />
I can understand why they&#8217;re doing that, but hey – if you want to save bandwidth I suggest you block YouTube (not that I complain…)<br />
Well, I thought of a way to listen to my favorite radio station from work, by re-streaming it from my home. And it worked!</p>
<p style="text-align: left;">It can also work for you, in case your IT does not block by protocol, only by address.</p>
<p style="text-align: left;">So here&#8217;s how to do it:</p>
<p style="text-align: left;"><span id="more-567"></span></p>
<h2 style="text-align: left;">STEP 1 – Retrieve the actual link for your radio station</h2>
<p style="text-align: left;">Go to the station&#8217;s website and try to get a link that you can play in Windows Media Center.<br />
Some stations will let you find it, others won&#8217;t.<br />
If this is the case, here&#8217;s what you need to do (At home!)</p>
<ol style="text-align: left;">
<li>
<div style="text-align: justify;">Download <a href="http://www.wireshark.org/">wireshark</a> and install it</div>
</li>
<li>
<div style="text-align: justify;">Start capturing using this filter: <strong>rtsp.request</strong></div>
</li>
<li>
<div style="text-align: justify;">Try to listen to the station</div>
</li>
<li>
<div style="text-align: justify;">You should see such an output in wireshark:</div>
<p style="text-align: right;"><img class="alignleft" src="http://www.morethantechnical.com/wp-content/uploads/2010/01/012910_1452_Streamyourf1.png" alt="" /></p>
<p style="text-align: left;">As you can see, there is a url here that looks like this:<br />
<strong>rtsp://someurl/somefile RTSP/1.0</strong></p>
</li>
<li>Take this URL, and replace <strong>RTSP</strong> with <strong>MMS</strong> and omit the <strong>RTSP/1.0</strong> ending.<br />
Your URL should look like this: <a href="mms://someurl.somefile">mms://someurl.somefile</a></li>
<li>
<div style="text-align: justify;">Try to play this URK in windows media player. If it works – you&#8217;re half way through</div>
</li>
</ol>
<p style="text-align: left;">If you can get the link in any other way, it&#8217;s fine… This is only a suggestion</p>
<p style="text-align: left;"> </p>
<h2 style="text-align: left;">STEP 2 – Set up VLC as a stream server at your home</h2>
<p style="text-align: left;">I will start with an apology. I didn&#8217;t find a proper way to do it with the GUI of version 1.0+.<br />
On the past versions it was relatively clear, so that&#8217;s where I managed to find the command line you need to run in order for it to work<br />
So, at this point, you need to run <a href="http://www.videolan.org/">VLC</a> on your PC with these parameters:</p>
<p style="text-align: left;"><span style="font-family: Courier New;">vlc mms://yourserver/yourlink :sout=#transcode{acodec=mp3,ab=64,channels=2}:duplicate{dst=std{access=mmsh,mux=asfh,dst=:8080}}<br />
</span></p>
<p style="text-align: left;">This will stream the web-radio station to port 8080.<br />
You can test this using Windows Media Player, just open it up, and open the url <a href="mms://localhost:8080">mms://localhost:8080</a></p>
<p style="text-align: left;">Another thing you need to keep in mind, is that you should establish port forwarding if you are behind NAT.</p>
<p style="text-align: left;"> That&#8217;s the whole deal… Of course you can improve it by creating a script that will run it, or add the http interface of VLC to remote control it on another port, but I don&#8217;t want to overload this guide…</p>
<p style="text-align: left;">keep it simple!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2010%2F01%2F29%2Fstream-your-favorite-radio-station-to-your-workplace%2F&amp;title=Stream%20your%20favorite%20radio%20station%20to%20your%20workplace" id="wpa2a_8"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2010/01/29/stream-your-favorite-radio-station-to-your-workplace/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extending Justin Talbot&#8217;s GrabCut Impl [w/ code]</title>
		<link>http://www.morethantechnical.com/2009/12/14/extending-justin-talbots-grabcut-impl-w-code/</link>
		<comments>http://www.morethantechnical.com/2009/12/14/extending-justin-talbots-grabcut-impl-w-code/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:27:25 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[grabcut]]></category>
		<category><![CDATA[iplimage]]></category>
		<category><![CDATA[opencv]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=550</guid>
		<description><![CDATA[Justin Talbot has done a tremendous job implementing the GrabCut algorithm in C [link to paper, link to code]. I was missing though, the option to load ANY kind of file, not just PPMs and PGMs. So I tweaked the code a bit to receive a filename and determine how to load it: use the [...]]]></description>
			<content:encoded><![CDATA[<p>Justin Talbot has done a tremendous job implementing the GrabCut algorithm in C [<a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAcQFjAA&amp;url=http%3A%2F%2Fresearch.justintalbot.org%2Fpapers%2FGrabcut.pdf&amp;ei=lvklS9j5L8j_4AbH24DiCQ&amp;usg=AFQjCNHHiSn3xg8XkvDRZK0G6HIn0doO8Q" target="_blank">link to paper</a>, <a href="http://research.justintalbot.org/papers/GrabCut.zip" target="_blank">link to code</a>]. I was missing though, the option to load ANY kind of file, not just PPMs and PGMs.<br />
So I tweaked the code a bit to receive a filename and determine how to load it: use the internal P[P|G]M loaders, or offload the work to the OpenCV image loaders that take in many more type. If the OpenCV method is used, the IplImage is converted to the internal GrabCut code representation.</p>
<pre class="brush: plain; title: ; notranslate">

Image&lt;Color&gt;* load( std::string file_name )
{
 if( file_name.find( &quot;.pgm&quot; ) != std::string::npos )
 {
 return loadFromPGM( file_name );
 }

 else if( file_name.find( &quot;.ppm&quot; ) != std::string::npos )
 {
 return loadFromPPM( file_name );
 }

 else
 {
 return loadOpenCV(file_name);
 }
}

void fromImageMaskToIplImage(const Image&lt;Real&gt;* image, IplImage* ipli) {
 for(int x=0;x&lt;image-&gt;width();x++) {
 for(int y=0;y&lt;image-&gt;height();y++) {
 //Color c = (*image)(x,y);
 Real r = (*image)(x,y);
 CvScalar s = cvScalarAll(0);
 if(r == 0.0) {
 s.val[0] = 255.0;
 }
 cvSet2D(ipli,ipli-&gt;height - y - 1,x,s);
 }
 }
}

Image&lt;Color&gt;* loadIplImage(IplImage* im) {
 Image&lt;Color&gt;* image = new Image&lt;Color&gt;(im-&gt;width, im-&gt;height);
 for(int x=0;x&lt;im-&gt;width;x++) {
 for(int y=0;y&lt;im-&gt;height;y++) {
 CvScalar v = cvGet2D(im,im-&gt;height-y-1,x);
 Real R, G, B;
 R = (Real)((unsigned char)v.val[2])/255.0f;
 G = (Real)((unsigned char)v.val[1])/255.0f;
 B = (Real)((unsigned char)v.val[0])/255.0f;
 (*image)(x,y) = Color(R,G,B);
 }
 }
 return image;
}

Image&lt;Color&gt;* loadOpenCV(std::string file_name) {
 IplImage* im = cvLoadImage(file_name.c_str(),1);
 Image&lt;Color&gt;* i = loadIplImage(im);
 cvReleaseImage(&amp;im);
 return i;
}
</pre>
<p>Well, there&#8217;s nothing fancy here, but it does give you a fully working GrabCut implementation on top of OpenCV&#8230; so there&#8217;s the contribution.</p>
<pre class="brush: plain; title: ; notranslate">

GrabCutNS::Image&lt;GrabCutNS::Color&gt;* imageGC = GrabCutNS::loadIplImage(orig);
 GrabCutNS::Image&lt;GrabCutNS::Color&gt;* maskGC = GrabCutNS::loadIplImage(mask);

 GrabCutNS::GrabCut *grabCut = new GrabCutNS::GrabCut( imageGC );
 grabCut-&gt;initializeWithMask(maskGC);
 grabCut-&gt;fitGMMs();
 //grabCut-&gt;refineOnce();
 grabCut-&gt;refine();

 IplImage* __GCtmp = cvCreateImage(cvSize(orig-&gt;width,orig-&gt;height),8,1);
 GrabCutNS::fromImageMaskToIplImage(grabCut-&gt;getAlphaImage(),__GCtmp);
 //cvShowImage(&quot;result&quot;,image);
 cvShowImage(&quot;tmp&quot;,__GCtmp);
 cvWaitKey(30);
</pre>
<p>I also added the GrabCutNS namespace, to differentiate the Image class from the rest of the code (that probably has an Image already).</p>
<p>Code is as usual available online in the <a href="http://code.google.com/p/morethantechnical/source/browse/#svn/trunk/GrabCut" target="_blank">SVN repo</a>.</p>
<p>Enjoy!</p>
<p>Roy.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2009%2F12%2F14%2Fextending-justin-talbots-grabcut-impl-w-code%2F&amp;title=Extending%20Justin%20Talbot%26%238217%3Bs%20GrabCut%20Impl%20%5Bw%2F%20code%5D" id="wpa2a_10"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2009/12/14/extending-justin-talbots-grabcut-impl-w-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First steps in Android programming</title>
		<link>http://www.morethantechnical.com/2009/07/30/first-steps-in-android-programming/</link>
		<comments>http://www.morethantechnical.com/2009/07/30/first-steps-in-android-programming/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 18:03:48 +0000</pubDate>
		<dc:creator>Arnon</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mobile phones]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[comlete action using]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[intent]]></category>
		<category><![CDATA[landscape]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[notification area]]></category>
		<category><![CDATA[orientation]]></category>
		<category><![CDATA[portrait]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=383</guid>
		<description><![CDATA[Last week I finished my first Android application. All through the development stage I had to Google a lot for examples which some were really hard to find (even though you can find reference for everything in the SDK, for me, it&#8217;s easier to understand from a code sample). My mobile company allows you to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.morethantechnical.com/wp-content/uploads/2009/07/073009_1803_Firststepsi1.jpg" alt="" align="left" />Last week I finished my first Android application. All through the development stage I had to Google a lot for examples which some were really hard to find (even though you can find reference for everything in the SDK, for me, it&#8217;s easier to understand from a code sample).</p>
<p>My mobile company allows you to send 10 free daily SMS through their website, and after that each text message is still half priced, so I decided to take a challenge and create a UI that allows me to send my messages from the phone through the website automatically.</p>
<p>The core of my software was pure java, so even though it wasn&#8217;t straight forward to accomplish, I kinda know the material.</p>
<p>The main issues were after – when I got to the android implementation and UI</p>
<p>Here are the issues I needed, and will supply examples for in this post:<br />
(Of course – for you that are more experienced than me with Android development, please forgive if I&#8217;m not doing everything &#8216;by the book&#8217;, it&#8217;s simply what I could find. So if you have any suggestions or improvement please send them to me or post a comment <span style="font-family:Wingdings">J</span> )</p>
<ul>
<li>How to find out if there is an active network on the device</li>
<li>How to create options menu</li>
<li>How to create and clear notification in the notification area</li>
<li>How to declare your program as &#8220;SMS Sender&#8221; (&#8216;Complete action using…&#8217;)</li>
<li>Taking care of orientation (Landscape and Portrait mode for UI)</li>
</ul>
<p>Here is the code I ended up using. Hope you find it helpful<br />
<span id="more-383"></span><br />
This sample method returns a Boolean that states if there is an <strong>active network</strong></p>
<pre class="brush: java; title: ; notranslate">
private boolean anyNetworkActive() {
         TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
         WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
         WifiInfo wi = wm.getConnectionInfo();
         return !((wi == null || WifiInfo.getDetailedStateOf(wi.getSupplicantState()) == DetailedState.IDLE) &amp;&amp;
tm.getDataState() != TelephonyManager.DATA_CONNECTED);
}
</pre>
<p>These events <strong>populate the menu</strong> with text-only options, and do the proper action when pressed</p>
<pre class="brush: java; title: ; notranslate">
@Override
public boolean onCreateOptionsMenu(Menu menu) {
      menu.add(getString(R.string.menuconfig));
      menu.add(getString(R.string.menuclear));
      menu.add(getString(R.string.menucontact));
      return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
      if (item.getTitle().equals(getString(R.string.menuconfig)))
      // Show config screen
      startActivity(new Intent(this, Prefs.class));
      if (item.getTitle().equals(getString(R.string.menuclear))) {
      // Clear all fields on screen
           messageBody.setText(&quot;&quot;);
           smsTarget.setText(&quot;&quot;);
      }
      if (item.getTitle().equals(getString(R.string.menucontact))) {
            getcontact = true; // for sync issues
           // Delete the contactnum variable
           prefs.edit().putString(&quot;contactnum&quot;, &quot;&quot;).commit();
           // Show contact selection screen
           startActivity(new Intent(this, ContactList.class));
       }
       return (true);
}
</pre>
<p>The first method will<strong> create a notification</strong> for your user (an icon must be present in the drawable folder)<br />
The second one will <strong>clear the notification</strong></p>
<pre class="brush: java; title: ; notranslate">
public void notifyString(String sTickerText, String sContentTitle, String sContentText) {
          String ns = Context.NOTIFICATION_SERVICE;
          NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
          int icon = R.drawable.notification_icon;
          CharSequence tickerText = sTickerText;
          long when = System.currentTimeMillis();

          Notification notification = new Notification(icon, tickerText, when);
          Context context = getApplicationContext();
          CharSequence contentTitle = sContentTitle;
          CharSequence contentText = sContentText;
          Intent notificationIntent = new Intent(this, PeleSms.class);
          PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

          notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
          final int HELLO_ID = 1;

          mNotificationManager.notify(HELLO_ID, notification);
}

public void clearNotification() {
          String ns = Context.NOTIFICATION_SERVICE;
          NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
          mNotificationManager.cancel(1);
}
</pre>
<p>These methods and <strong>AndroidManifest.xml</strong> changes will declare your program as an SMS Sender, and the user will be asked if he/she wants to use it instead of the built in messaging client when trying to send a text message (with the &#8220;Complete action using&#8230;&#8221; menu, screenshot above)</p>
<p><strong>AndroidManifest.xml</strong>:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;intent-filter&gt;
     &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
     &lt;action android:name=&quot;android.intent.action.SENDTO&quot; /&gt;
     &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
     &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
     &lt;data android:scheme=&quot;sms&quot; /&gt;
     &lt;data android:scheme=&quot;smsto&quot; /&gt;
&lt;/intent-filter&gt;
</pre>
<p><strong>Catching the intent</strong> in the beginning of activity:</p>
<pre class="brush: java; title: ; notranslate">
@Override
public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         String param = getIntent().getDataString();
          ....
</pre>
<p><strong>Orientation:</strong></p>
<p>The grand finale. This is as simple as can be… no code needed. All you need to do, is create two folders under the root of your project: <strong>layout-port</strong> and <strong>layout-land<br />
</strong>Then, move your UI XML to the layout-port folder, and create a copy of it with the same name in layout-land folder. That&#8217;s about it. Of course, you need to adjust the layout for each. Android will know when to use which</p>
<p>Well, I hope I got you through rough times if you found this post useful. I know I wish I bumped into one like it <span style="font-family:Wingdings">J</span></p>
<p>Last thing: This is a ListActivity I created using some examples I found&#8230; It displays a list of your contacts and by clicking one, saves his phone number in a Shared Preference. Note that you must grant permission for reading contact in your AndroidManifest.xml</p>
<pre class="brush: java; title: ; notranslate">
public class ContactList extends ListActivity{
private ListAdapter mAdapter;
SharedPreferences prefs;

/** Called when the activity is first created. */
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        prefs = PreferenceManager.getDefaultSharedPreferences(this);
        Cursor contactsCursor = this.managedQuery(People.CONTENT_URI,
                     null, null, null, &quot;People.NAME ASC&quot;);
        startManagingCursor(contactsCursor);

        String[] columnsToMap = new String[] {People.NAME};
        int[] mapTo = new int[] {android.R.id.text1};

        mAdapter = new SimpleCursorAdapter(this,
                     android.R.layout.simple_list_item_1,
                     contactsCursor, columnsToMap, mapTo);
        this.setListAdapter(mAdapter);
}

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
Cursor C = (Cursor) mAdapter.getItem(position);
String phoneNumber;
int phoneColumn = C.getColumnIndex(People.NUMBER);
phoneNumber = C.getString(phoneColumn);

//SharedPreferences.Editor editor =
prefs.edit().putString(&quot;contactnum&quot;, phoneNumber).commit();

finish();
}
}
</pre>
<p>That&#8217;s about it&#8230; If you need more info on anything I&#8217;ve posted here just contact me or leave a comment</p>
<p><strong>UPDATE:</strong> I have added some code to our project repository SVN.<br />
It does not contain the actual backend SMS sending, since this is pure java thing, and I don&#8217;t want to piss off my cellular company (making them stop giving away 10 free per day maybe? ). The project name is AndroidFirstSteps<br />
<a href="http://morethantechnical.googlecode.com/svn/trunk/">http://morethantechnical.googlecode.com/svn/trunk/</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2009%2F07%2F30%2Ffirst-steps-in-android-programming%2F&amp;title=First%20steps%20in%20Android%20programming" id="wpa2a_12"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2009/07/30/first-steps-in-android-programming/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Combining Java&#8217;s BufferedImage and OpenCV&#8217;s IplImage</title>
		<link>http://www.morethantechnical.com/2009/05/14/combining-javas-bufferedimage-and-opencvs-iplimage/</link>
		<comments>http://www.morethantechnical.com/2009/05/14/combining-javas-bufferedimage-and-opencvs-iplimage/#comments</comments>
		<pubDate>Thu, 14 May 2009 10:51:44 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[bufferedimage]]></category>
		<category><![CDATA[iplimage]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[opencv]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=263</guid>
		<description><![CDATA[Hi I recently did a small project combining a Java web service with a OpenCV processing. I tried to transfer the picture from Java environment (as BufferedImage) to OpenCV (IplImage) as seamlessly as possible. This proved a but tricky, especially the Java part where you need to create your own buffer for the image, but [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-270" title="java_opencv_img" src="http://www.morethantechnical.com/wp-content/uploads/2009/05/java_opencv_img-300x112.png" alt="java_opencv_img" width="300" height="112" />Hi</p>
<p>I recently did a small project combining a Java web service with a OpenCV processing. I tried to transfer the picture from Java environment (as BufferedImage) to OpenCV (IplImage) as seamlessly as possible. This proved a but tricky, especially the Java part where you need to create your own buffer for the image, but it worked out nicely.</p>
<p>Let me show you how I did it</p>
<p><span id="more-263"></span>First up was creating a 3-component RGB BufferedImage in Java, with a custom memory buffer that will fit nicely with IplImages:</p>
<pre class="brush: plain; title: ; notranslate">

private BufferedImage createOpenCVCompatibleBufferedImage(int w, int h)
{
ComponentColorModel cm = new ComponentColorModel(
ColorSpace.getInstance(ColorSpace.CS_sRGB),
false,  //no alpha channel
false,  //not premultiplied
ColorModel.OPAQUE,
DataBuffer.TYPE_BYTE); //important - data in the buffer is saved by the byte

SampleModel sm = cm.createCompatibleSampleModel(w, h);
DataBufferByte db = new DataBufferByte(w*h*3); //3 channels buffer
WritableRaster r = WritableRaster.createWritableRaster(sm, db, new Point(0,0));
BufferedImage bm = new BufferedImage(cm,r,false,null);
return bm;
}
</pre>
<p>This took some trial and error, but I ended up with a working thing.</p>
<p>Now, the C++/OpenCV side of things &#8211; a JNI function to read the buffer and do some OpenCV stuff:</p>
<pre class="brush: plain; title: ; notranslate">

JNIEXPORT jint JNICALL Java_test_OpenCVShowImage
(JNIEnv *env, jobject jo, jbyteArray pic, jint w, jint h, jint bpp, jint bpr) {
IplImage* img;
jint len;
unsigned char* result;
int n1;

img = cvCreateImageHeader(cvSize(w,h),8,bpp/8); //create the &quot;shell&quot;

len = (*env)-&gt;GetArrayLength(env, pic);
result = (unsigned char *)malloc(len + 1);
if (result == 0) {
fatal_error(&quot;out of memory&quot;);
(*env)-&gt;DeleteLocalRef(env, pic);
return 0;
}
(*env)-&gt;GetByteArrayRegion(env, pic, 0, len,(jbyte *)result);

cvSetData(img,result,bpr);    //set the buffer

cvNamedWindow(&quot;window&quot;);
cvShowImage(&quot;window&quot;,img);
cvWaitKey(0);
cvDestroyWindow(&quot;window&quot;);

free(result);
cvReleaseImage(&amp;img);
return 1;
}
</pre>
<p>One last thing -the Java call to the JNI function:</p>
<pre class="brush: plain; title: ; notranslate">
BufferedImage tmp = ImageIO.read(new File(&quot;bird.png&quot;));

BufferedImage bi1 = createOpenCVCompatibleBufferedImage(tmp.getWidth(), tmp.getHeight());

//paint the image with a little transform...
Graphics2D biDestG2D = bi1.createGraphics();
biDestG2D.setColor(Color.white);
biDestG2D.fillRect(0, 0, w, h);
AffineTransform transform = AffineTransform.getShearInstance(0.2, 0.1);
transform.scale(0.5, 0.5);
biDestG2D.drawImage(tmp,transform,null);
biDestG2D.dispose();

byte[] bytes = ((DataBufferByte)bi1.getRaster().getDataBuffer()).getData();

OpenCVShowImage(bytes, w, h, 24, w*3);
</pre>
<p>That&#8217;s all folks!<br />
<img class="alignnone size-full wp-image-269" title="java_opencv" src="http://www.morethantechnical.com/wp-content/uploads/2009/05/java_opencv.png" alt="java_opencv" width="642" height="418" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2009%2F05%2F14%2Fcombining-javas-bufferedimage-and-opencvs-iplimage%2F&amp;title=Combining%20Java%26%238217%3Bs%20BufferedImage%20and%20OpenCV%26%238217%3Bs%20IplImage" id="wpa2a_14"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2009/05/14/combining-javas-bufferedimage-and-opencvs-iplimage/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone camera frame grabbing and a real-time MeanShift tracker</title>
		<link>http://www.morethantechnical.com/2009/05/06/iphone-camera-frame-grabbing-and-a-real-time-meanshift-tracker/</link>
		<comments>http://www.morethantechnical.com/2009/05/06/iphone-camera-frame-grabbing-and-a-real-time-meanshift-tracker/#comments</comments>
		<pubDate>Wed, 06 May 2009 15:19:50 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[frame grabbing]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[meanshift]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=257</guid>
		<description><![CDATA[Hi Just wanted to report on a breakthrough in my iPhone-CV digging. I found a true realtime frame grabber for the iPhone preview frame (15fps of ~400&#215;300 video), and successfully integrated this video feed with a pure C++ implementation of the MeanShift tracking algorithm. The whole setup runs at realtime, under a few constraints of [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-259" title="i_can_has_meanshift" src="http://www.morethantechnical.com/wp-content/uploads/2009/05/i_can_has_meanshift.png" alt="i_can_has_meanshift" width="250" height="311" />Hi</p>
<p>Just wanted to report on a breakthrough in my iPhone-CV digging. I found a true realtime frame grabber for the iPhone preview frame (15fps of ~400&#215;300 video), and successfully integrated this video feed with a pure C++ implementation of the MeanShift tracking algorithm. The whole setup runs at realtime, under a few constraints of course, and gives nice results.</p>
<p><strong>Update</strong>: Apple officially supports camera video pixel buffers in iOS 4.x using AVFoundation, <a href="http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html#TNTAG1">here&#8217;s</a> sample code from Apple developer.</p>
<p>So lets dig in&#8230;</p>
<p><span id="more-257"></span>First up is the frame grabber.</p>
<p>I was truly amazed by how far people went with getting the video stream of the iPhone camera. NDAs were tossed out the window, Private Frameworks are hardly private anymore, and people went further on. The impl I found hooks up onto the private callback function of the camera to PLCameraController, mind you this was probably hidden deep down in PhotoLibrary.</p>
<p>The gifted hacker, <a title="Norio Nomura" href="http://github.com/norio-nomura" target="_blank">Norio Nomura</a>, published his code for doing this <a title="iphoe camera hack" href="http://github.com/norio-nomura/iphonetest/tree/9713242dda6c6bc897da4bd639a1fdadc29b6fd7/CameraTest" target="_blank">here</a>. I found on a long thread of rants about how the only way to grab frames off the camera preview was using UIGraphics&#8217;s UIGetScreenImage(). He sure showed them&#8230;</p>
<p>Anyway, his code led me to a few tweaks needed to process the frame data in real-time. What he does is update his static buffer pointer, readpixels, to the CoreSurface Surface object&#8217;s buffer, so you always have a pointer to the pixel data. Sweet. But now we need to process this data somehow, and moreover, we need to know the width, height, bytes per pixel and bytes per row.</p>
<p>So I created a few more static variables, and added a few functions in CameraTestAppDelegate to return these values. Now I can access the pixels correctly.</p>
<p>On to the <a title="Meanshift" href="http://www.wisdom.weizmann.ac.il/~deniss/vision_spring04/files/mean_shift/mean_shift.ppt" target="_blank">MeanShift</a>.</p>
<p>The algorithm is very simple:</p>
<ol>
<li>Calculate the histogram of the object (you assume the user had marked it in the first frame)</li>
<li>In the next frame, for which you don&#8217;t know where the object is, calculate the average point of all the pixels that &#8220;conform best&#8221; with your histogram, in a certain area around the known center.</li>
<li>Move iteratively towards your average point, until convergence.</li>
</ol>
<p>I found a pure c++ <a title="meanshift c++ implementation" href="http://www.cs.bilkent.edu.tr/~ismaila/MUSCLE/MSTracker.htm" target="_blank">implementation</a> of a version of MeanShift from a turkish student in Bilkent University, Halil Cuce. It works perfectly for my needs, and compiles out-of-the-box as it has no external libraries dependencies.</p>
<p>It has room for a few fixes though:</p>
<ul>
<li><span>CObjectTracker</span>::CheckEdgeExistance needs to use &#8220;GetBValue&#8221; instead of &#8220;GetGValue&#8221; in the last additives.</li>
<li><span>CObjectTracker</span>::GetPixelValues should not use m_nImageWidth as the &#8220;number of bytes in a row&#8221;, a new member should be introduced which represents the row-stepping.</li>
<li>Many optimizations can be done, for example in the <span>CObjectTracker</span>::FindHistogram function, the for loops can be optimized by pre-calculating the start and end values of Y and X iterators.</li>
</ul>
<p>But all-in-all it gives nice results. The main problem is high CPU rates whne tracking large objects. I found that 40&#215;40 objects can be tracked in ~15fps, but anything larger than that will severely damage fps rates.</p>
<p>OK, time for a video:</p>
<p><object width="425" height="350" data="http://www.youtube.com/v/GM8VNNaW1QY" type="application/x-shockwave-flash"><param name="src" value="http://www.youtube.com/v/GM8VNNaW1QY" /></object></p>
<p>As usual&#8230; I cannot release my portions of the code as-is in here as it is protected by my company, I can only refer you to the online sources available. Contact me by commenting or mail if you want code.</p>
<p>Enjoy,</p>
<p>Roy.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2009%2F05%2F06%2Fiphone-camera-frame-grabbing-and-a-real-time-meanshift-tracker%2F&amp;title=iPhone%20camera%20frame%20grabbing%20and%20a%20real-time%20MeanShift%20tracker" id="wpa2a_16"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2009/05/06/iphone-camera-frame-grabbing-and-a-real-time-meanshift-tracker/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Beef up your presentations with word clouds</title>
		<link>http://www.morethantechnical.com/2009/04/07/beef-up-your-presentations-with-word-clouds/</link>
		<comments>http://www.morethantechnical.com/2009/04/07/beef-up-your-presentations-with-word-clouds/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 08:40:22 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[Recommended]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[word cloud]]></category>
		<category><![CDATA[wordle]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=226</guid>
		<description><![CDATA[There&#8217;s nothing like a good visualization to deliver your ideas over a presentation. Concise points and breakdowns can only go a certain distance before they become weary, and finally confuse your audience. It&#8217;s better to keep them on their toes by spicing up the boring slides every 5 or so page turns. I found that [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-229" title="friendship" src="http://www.morethantechnical.com/wp-content/uploads/2009/04/friendship-300x114.png" alt="friendship" width="300" height="114" />There&#8217;s nothing like a good visualization to deliver your ideas over a presentation. Concise points and breakdowns can only go a certain distance before they become weary, and finally confuse your audience. It&#8217;s better to keep them on their toes by spicing up the boring slides every 5 or so page turns.</p>
<p>I found that <a title="Tag Cloud" href="http://en.wikipedia.org/wiki/Tag_cloud" target="_blank">Word Clouds</a>, a kind-of new visualization concept, have a good trait of focusing the attention over a single word&#8217;s associative space. You bold your main word, center it, and scatter the associative words around it. This creates a powerful effect.</p>
<p>I found a nice tool to create these word coulds on-the-fly: <a title="Wordle" href="http://www.wordle.net/" target="_blank">Wordle</a>.</p>
<p>The way I did was, get the Wikipedia value of my word, for example &#8220;<a href="http://en.wikipedia.org/wiki/Friendship" target="_blank">Friendship</a>&#8220;, and go to the <a href="http://en.wikipedia.org/w/index.php?title=Friendship&amp;action=edit" target="_blank">Edit </a>tab. Copy all the textarea&#8217;s contents, and paste it into Wordle&#8217;s word cloud <a title="Wordle's creator" href="http://www.wordle.net/create" target="_blank">creator</a>. Press &#8220;GO&#8221; and the results are immediate.</p>
<p>You can eliminate the &#8220;outliers&#8221; &#8211; those unrelated words that appear too many times, and layout the cloud as you like to fit your slide.</p>
<p>The down-side with Wordle is that it has no export ability, so I had to take an Alt-PrintScreen screenshot to get my cloud as a picture.</p>
<p>Enjoy!</p>
<p>Roy.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2009%2F04%2F07%2Fbeef-up-your-presentations-with-word-clouds%2F&amp;title=Beef%20up%20your%20presentations%20with%20word%20clouds" id="wpa2a_18"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2009/04/07/beef-up-your-presentations-with-word-clouds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Life changing traffic tips</title>
		<link>http://www.morethantechnical.com/2009/02/08/life-changing-traffic-tips/</link>
		<comments>http://www.morethantechnical.com/2009/02/08/life-changing-traffic-tips/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 09:28:52 +0000</pubDate>
		<dc:creator>Roy</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[jams]]></category>
		<category><![CDATA[lights]]></category>
		<category><![CDATA[morning]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://www.morethantechnical.com/?p=156</guid>
		<description><![CDATA[Hi Morning traffic jams can really bum you out on some days, and most people try to avoid them. But actually doing it takes a bit of practice and a lot of time, so it took me just 3 years to perfect my morning route to work. I think I am now able to shave [...]]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>Morning traffic jams can really bum you out on some days, and most people try to avoid them. But actually doing it takes a bit of practice and a lot of time, so it took me <strong>just 3 years </strong>to perfect my morning route to work. I think I am now able to <strong>shave off between 5 and 20 minutes of traffic every day</strong>, depends on how crowded the roads are that day.</p>
<p>On a &#8220;light&#8221; day these tips aren&#8217;t worth much, but on a crowded day (like today) it can really save time and gas. Also, since this is my route to work, and I live in Israel and work in Ramat Ha&#8217;hayal Tel-Aviv, the example images are in Hebrew and they help people who need to get to Habarzel street. But the tips are genuine, and can help anyone optimize thier morning route.</p>
<p>OK, so on to the point.</p>
<p><span id="more-156"></span>My route is about 9-10 km, very short, but some days it can take up to 40 mins to get into work. Most of the problem is caused by traffic lights, which are terribly unbalanced for some directions. So tip #1 is: <strong>shift the lights balance to your favour</strong>. Change the route to take the better, longer green lights.</p>
<p>Here&#8217;s an example:</p>
<p><a rel="lightbox" href="http://www.morethantechnical.com/wp-content/uploads/2009/02/traffic1.png"><img class="alignnone size-medium wp-image-157" title="Take the better light" src="http://www.morethantechnical.com/wp-content/uploads/2009/02/traffic1-300x212.png" alt="Take the better light" width="300" height="212" /></a></p>
<p>This is an actual traffic light which is unbalanced towards the people on &#8220;Keren Kayemet&#8221; (the yellow road). Every morning there&#8217;s a congestion on the side of the people coming from the highway.</p>
<p>My trick is to skip the direct left turn, which is unbalanced (can be 3 min for a green of 15 sec), and after a short round trip in the neighbourhood I take the same light but in the more favourable direction. On a heavy day this can save over 10 min of just sitting in the car waiting for the short green.</p>
<p>Next tip, #2: <strong>Take the lighter road, even if its longer.</strong></p>
<p>Another example:</p>
<p><a rel="lightbox" href="http://www.morethantechnical.com/wp-content/uploads/2009/02/traffic2.png"><img class="alignnone size-medium wp-image-159" title="Take the lighter route, sometimes its longer" src="http://www.morethantechnical.com/wp-content/uploads/2009/02/traffic2-300x217.png" alt="Take the lighter route, sometimes its longer" width="300" height="217" /></a></p>
<p>So when I come up to this intersection there are 2 choices: either go with the crowd and turn left, or go straight ahead and into the neighbourhood.</p>
<p>Going into the neighbourhood seems like a foolish idea, since there are speed bumps, pedestrian crossings and more turns. But as it turns out, taking the neighbourhood in this case is better in a few ways:</p>
<ul>
<li>Note the destination road (&#8220;Raul Valenberg&#8221;). Since most people come from the purple route, the traffic lights there are really crowded. On some days you can wait for 3-4 lights untill you take your turn. The opposite direction of that street is not always light on cars &#8211; <strong>but you don&#8217;t have a light to make the right turn</strong>. So taking this direction is preferable, but in order to get to take the street in the opposite direction you have zigzag around the neighbourhood a little. But trust me &#8211; it pays off.</li>
<li>Its clear to see that the purple road is shorter, broader and more direct, but these things also make it more crowded. Sometimes the longer, narrower and less direct road is actually the faster one!</li>
</ul>
<p>There are shortcomings to going through the neighbourhoods like: pedestrians, driving school cars (and trucks!) that go about slowely, speedbumps and the occasional police car. But in some cases its worth it if in the end you take the better direction.</p>
<p>Last tip, #3: <strong>explore your route</strong>. Every few weeks explore the streets around your usual route, even if it takes a few more minutes, you might just hit that secret path no one ever takes!</p>
<p>Have a safe morning trip!</p>
<p>Roy.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.morethantechnical.com%2F2009%2F02%2F08%2Flife-changing-traffic-tips%2F&amp;title=Life%20changing%20traffic%20tips" id="wpa2a_20"><img src="http://www.morethantechnical.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.morethantechnical.com/2009/02/08/life-changing-traffic-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

