<?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>Tommy Chheng &#187; computer vision</title>
	<atom:link href="http://tommy.chheng.com/index.php/tag/computer-vision/feed/" rel="self" type="application/rss+xml" />
	<link>http://tommy.chheng.com</link>
	<description>All Things Programming!</description>
	<lastBuildDate>Sat, 24 Jul 2010 17:34:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Developing OpenCV Applications with Eclipse on Windows</title>
		<link>http://tommy.chheng.com/index.php/2009/05/opencv-with-eclipse-on-windows/</link>
		<comments>http://tommy.chheng.com/index.php/2009/05/opencv-with-eclipse-on-windows/#comments</comments>
		<pubDate>Tue, 12 May 2009 00:32:40 +0000</pubDate>
		<dc:creator>tommy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[computer vision]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=28</guid>
		<description><![CDATA[Here&#8217;s a guide to start hacking computer vision and image processing applications using OpenCV/Eclipse on Windows machines. While you can use Microsoft Visual Studio to program OpenCV apps, I find Eclipse a much easier to use IDE. C++ Development Tools MinGW: A collection of freely available and freely distributable Windows specific header files and import [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a guide to start hacking computer vision and image processing applications using OpenCV/Eclipse on Windows machines.  While you can use Microsoft Visual Studio to program OpenCV apps, I find Eclipse a much easier to use IDE.</p>
<h3>C++ Development Tools</h3>
<ul>
<li><a href="http://www.mingw.org/">MinGW</a>: A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MinGW is different from Cygwin because it uses the Windows C runtime libraries(mscvrt) rather than GNU&#8217;s libc.</li>
<li><a href="http://www.mingw.org/">Msys</a>: A Minimal SYStem to provide POSIX/Bourne configure scripts the ability to execute and create a Makefile used by make.</li>
<li><a href="http://www.eclipse.org/cdt/">Eclipse CDT</a>: A IDE originally made for Java but includes an extensive plugin library. Now supports C/C++ and many other languages.</li>
</ul>
<p>The latest version can be checked on the respective website. I used <a href="http://downloads.sourceforge.net/mingw/MinGW-5.1.3.exe">MinGW 5.1.3</a> and <a href="http://downloads.sourceforge.net/mingw/MSYS-1.0.10.exe">Msys 1.0.10</a>. When installing MinGW, select the G++ and other compilers. Do NOT install the make in the MinGW setup. Msys will provide it.</p>
<p>MinGW does not include the GDB debugger so download <a href="http://downloads.sourceforge.net/mingw/gdb-6.6.tar.bz2">gdb-6.6.tar.bz2</a> and install it to your MinGW directory. To uncompress it, open up the msys window and type in <strong>bunzip2 gdb-6.6.tar.bz2</strong> and then <strong>tar -xvf gdb-6.6.tar</strong>. Copy all the contents to your MinGw folder.</p>
<h3>OpenCV</h3>
<p>The two big open source computer Vision/Image processing libraries in C/C++ are <a href="http://sourceforge.net/projects/opencvlibrary/">OpenCV</a> and the <a href="http://ti.arc.nasa.gov/visionworkbench/">Nasa Vision WorkBench</a>.</p>
<p>OpenCV is the old-school C/C++ computer vision/image processing library. It is robust and contains many functions described in computer vision textbooks.  I haven&#8217;t played with the newer NASA tool but it looks like it has a decent API as well.</p>
<p>Download and install <a href="http://downloads.sourceforge.net/opencvlibrary/OpenCV_1.0.exe?modtime=1161287502&amp;big_mirror=1">OpenCV</a>.</p>
<h3>Linking OpenCV in Eclipse</h3>
<p>You can setup Eclipse CDT to work with the OpenCV libraries. Create a new C++ project in Eclipse CDT. Select MinGw as the toolchain.</p>
<p>In the project properties, go to the C/C++ Build-&gt;Settings-&gt;GCC C++ Compiler, set the directories to:</p>
<ul>
<li> OpenCv\cv\include</li>
<li> OpenCv\cxcore\include</li>
<li> OpenCv\otherlibs\highgui</li>
<li> OpenCv\otherlibs\cvcam\include</li>
<li> OpenCv\cvaux\include</li>
</ul>
<p>In the C++ Linker-&gt;Libraries, set:</p>
<ul>
<li> cv</li>
<li> highgui</li>
<li> cxcore</li>
</ul>
<p>In Library search path, set:</p>
<ul>
<li> OpenCV\lib</li>
</ul>
<p>Here&#8217;s a sample file to get you started. You should be able to compile this program and see an inverted image when you run it.</p>
<p><code><br />
////////////////////////////////////////////////////////////////////////<br />
//<br />
// hello-world.cpp<br />
//<br />
// This is a simple, introductory OpenCV program. The program reads an<br />
// image from a file, inverts it, and displays the result.<br />
//<br />
////////////////////////////////////////////////////////////////////////<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;math.h&gt;<br />
#include &lt;cv.h&gt;<br />
#include &lt;highgui.h&gt;<br />
int main(int argc, char *argv[])<br />
{<br />
IplImage* img = 0;<br />
int height,width,step,channels;<br />
uchar *data;<br />
int i,j,k;<br />
if(argc&lt;2){<br />
printf("Usage: main \n\7");<br />
exit(0);<br />
}<br />
// load an image<br />
img=cvLoadImage(argv[1]);<br />
if(!img){<br />
printf("Could not load image file: %s\n",argv[1]);<br />
exit(0);<br />
}<br />
// get the image data<br />
height    = img-&gt;height;<br />
width     = img-&gt;width;<br />
step      = img-&gt;widthStep;<br />
channels  = img-&gt;nChannels;<br />
data      = (uchar *)img-&gt;imageData;<br />
printf("Processing a %dx%d image with %d channels\n",height,width,channels);<br />
// create a window<br />
cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);<br />
cvMoveWindow("mainWin", 100, 100);<br />
// invert the image<br />
for(i=0;i     data[i*step+j*channels+k]=255-data[i*step+j*channels+k];<br />
// show the image<br />
cvShowImage("mainWin", img );<br />
// wait for a key<br />
cvWaitKey(0);<br />
// release the image<br />
cvReleaseImage(&amp;img );<br />
return 0;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/index.php/2009/05/opencv-with-eclipse-on-windows/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Very Large Screen Displays Driven by Hand Tracking</title>
		<link>http://tommy.chheng.com/index.php/2009/05/very-large-screen-displays-driven-by-hand-tracking/</link>
		<comments>http://tommy.chheng.com/index.php/2009/05/very-large-screen-displays-driven-by-hand-tracking/#comments</comments>
		<pubDate>Tue, 05 May 2009 19:07:57 +0000</pubDate>
		<dc:creator>tommy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[hci]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=22</guid>
		<description><![CDATA[Got a really large screen display? It would be pretty hard to use a mouse, eh? Our senior engineering project at UC San Diego was to design a system where we would track a person&#8217;s hands to drive a large screen display. The technology in this project was used in a SIGGRAPH Art project Hand [...]]]></description>
			<content:encoded><![CDATA[<p>Got a really large screen display? It would be pretty hard to use a mouse, eh? Our senior engineering project at UC San Diego was to design a system where we would track a person&#8217;s hands to drive a large screen display.<br />
The technology in this project was used in a <a href="http://siggraph.org/s2007/attendees/art/installations.html">SIGGRAPH Art project</a>
</p>
<p>
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4496876&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4496876&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
</p>
<p>
<a style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;" title="View Hand Tracking as Pointing Device UCSD ECE191 Poster on Scribd" href="http://www.scribd.com/doc/14989763/Hand-Tracking-as-Pointing-Device-UCSD-ECE191-Poster">Hand Tracking as Pointing Device UCSD ECE191 Poster</a> <object id="doc_733294219537240" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="500" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="doc_733294219537240" /><param name="align" value="middle" /><param name="quality" value="high" /><param name="play" value="true" /><param name="loop" value="true" /><param name="scale" value="showall" /><param name="wmode" value="opaque" /><param name="devicefont" value="false" /><param name="bgcolor" value="#ffffff" /><param name="menu" value="true" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://d.scribd.com/ScribdViewer.swf?document_id=14989763&amp;access_key=key-2ab3ehspywvmmf6800g3&amp;page=1&amp;version=1&amp;viewMode=" /><param name="allowfullscreen" value="true" /><embed id="doc_733294219537240" type="application/x-shockwave-flash" width="100%" height="500" src="http://d.scribd.com/ScribdViewer.swf?document_id=14989763&amp;access_key=key-2ab3ehspywvmmf6800g3&amp;page=1&amp;version=1&amp;viewMode=" allowscriptaccess="always" allowfullscreen="true" menu="true" bgcolor="#ffffff" devicefont="false" wmode="opaque" scale="showall" loop="true" play="true" quality="high" align="middle" name="doc_733294219537240"></embed></object></p>
<p>Check out the <a href="http://www.scribd.com/doc/14989770/UCSD-ECE191-Report-Hand-Tracking-Pointing-Device">full report here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/index.php/2009/05/very-large-screen-displays-driven-by-hand-tracking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vision Based Traffic Light Triggering for Motorbikes</title>
		<link>http://tommy.chheng.com/index.php/2009/05/vision-based-traffic-light-triggering-for-motorbikes/</link>
		<comments>http://tommy.chheng.com/index.php/2009/05/vision-based-traffic-light-triggering-for-motorbikes/#comments</comments>
		<pubDate>Tue, 05 May 2009 18:52:44 +0000</pubDate>
		<dc:creator>tommy</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[computer vision]]></category>

		<guid isPermaLink="false">http://tommy.chheng.com/?p=14</guid>
		<description><![CDATA[Back in my college days at UC San Diego, I worked on a project using computer vision to solve the traffic light triggering problem. The general gist of problem is that a lot of traffic light sensors have a hard time detecting the presence of a motorcycle. This is a safety hazard as a motorcyclist [...]]]></description>
			<content:encoded><![CDATA[<p>Back in my college days at UC San Diego, I worked on a project using computer vision to solve the traffic light triggering problem. The general gist of problem is that a lot of traffic light sensors have a hard time detecting the presence of a motorcycle. This is a safety hazard as a motorcyclist may have to run a red light simply because the traffic light is not triggered. My idea was to detect and predict the trajectory of an object in video capture targeted at a traffic light. </p>
<h3>Abstract</h3>
<p>Current traffic light triggering is based on inductive loop sensors. Unfortunately, motorbikes (scooters, motorcycles, etc) have a difficult time triggering these sensors. In this paper, we propose an image processing algorithm to detect motorbikes at a traffic stop using a fixed camera. The algorithm tracks the trajectory of the objects in the footage by motion segmentation and connected component labeling. Classification can be created to categorize these objects as incoming traffic based on the object&#8217;s trajectory. To handle different lighting conditions in the motion segmentation, we take a dual approach by selecting RGB or Opponent colorspace. RANSAC is utilized to help trajectory creation. Experimental tests using real video footage exhibit robust results under varying conditions.</p>
<h3>Video</h3>
<p><embed id=VideoPlayback src=http://video.google.com/googleplayer.swf?docid=-3161234715440360689&#038;hl=en&#038;fs=true style=width:400px;height:326px allowFullScreen=true allowScriptAccess=always type=application/x-shockwave-flash></embed><p>
In this video, you see the detection of all the light sources. Then we track the bike(note how it bike stays labeled #1) using RANSAC to differentiate the bike from the intersecting traffic.
</p>
<h3>Presentation</h3>
<p><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_497058818104857" name="doc_497058818104857" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle"	height="500" width="100%" ><param name="movie"	value="http://d.scribd.com/ScribdViewer.swf?document_id=14989551&#038;access_key=key-7s6jsrs2b110ajnyer3&#038;page=1&#038;version=1&#038;viewMode="><param name="quality" value="high"><param name="play" value="true"><param name="loop" value="true"><param name="scale" value="showall"><param name="wmode" value="opaque"><param name="devicefont" value="false"><param name="bgcolor" value="#ffffff"><param name="menu" value="true"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="salign" value=""><embed src="http://d.scribd.com/ScribdViewer.swf?document_id=14989551&#038;access_key=key-7s6jsrs2b110ajnyer3&#038;page=1&#038;version=1&#038;viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_497058818104857_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle"  height="500" width="100%"></embed></object>
<div style="margin: 6px auto 3px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;"> </div>
<p>
For more details about this idea, check out the project blog at <a href="http://motorbikevision.blogspot.com/">Vision Based Traffic Light Triggering for Motorbikes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tommy.chheng.com/index.php/2009/05/vision-based-traffic-light-triggering-for-motorbikes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
