<?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>Shawn Lankton Online &#187; Vision</title>
	<atom:link href="http://www.shawnlankton.com/category/vision/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shawnlankton.com</link>
	<description>life, business, consulting, and computer vision</description>
	<lastBuildDate>Mon, 26 Dec 2011 23:04:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Making Active Contours Fast</title>
		<link>http://www.shawnlankton.com/2009/07/fast-active-contours/</link>
		<comments>http://www.shawnlankton.com/2009/07/fast-active-contours/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:35:59 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[active contours]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[level sets]]></category>
		<category><![CDATA[segmentation]]></category>
		<category><![CDATA[tr]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/?p=449</guid>
		<description><![CDATA[Active contours are a method of image segmentation. They are well-loved for their accuracy, ease of implementation, and nice mathematical underpinnings. However, a full level-set implementation can be quite slow, especially when dealing with large data! Here are some tips to speed things up. By combining these ideas and solid programming techniques I&#8217;ve been able [...]]]></description>
			<content:encoded><![CDATA[<p>Active contours are a method of image segmentation.  They are well-loved for their accuracy, ease of implementation, and nice mathematical underpinnings.  However, a full level-set implementation can be quite slow, especially when dealing with large data!  Here are some tips to speed things up.  By combining these ideas and solid programming techniques I&#8217;ve been able to get active contour trackers running at hundreds of frames per second!</p>
<ol>
<h3>
<li>Use Fast Level-Sets</h3>
<p style="margin-left:.5in;">Start by using a <a href="http://www.shawnlankton.com/2009/04/sfm-and-active-contours/">fast level-sets implementation</a> that minimizes the number of required computations [<a href="http://www.shawnlankton.com/wp-content/uploads/files/sfm_chanvese_demo.zip">code</a>].  This will already save a huge number of computations per iteration and speed things up quite a bit!
</p>
</li>
<h3>
<li>Create better initializations.</h3>
<p style="margin-left:.5in;">
The farther the initial contour is from its final position, the more computations must be done for the contour to converge.  Hence, if you can start the contour in <em>almost</em> the right place, you&#8217;ll drastically reduce the time needed for segmentation.  You can use prior knowledge, <a href="http://www.shawnlankton.com/2007/07/ellipse-selection-in-matlab/">user input</a>, or other segmentation techniques to create a rough guess that is close to the right answer.  Another initialization that can leads to quick initialization is &#8216;bubbles&#8217; on an evenly-spaced grid.
</p>
</li>
<h3>
<li>Use a multi-scale approach.</h3>
<p style="margin-left:.5in;">
This is a way to quickly get good initializations using active contours.  Say your data is MxN. Instead of segmenting the full data set, downsample the data so that you are dealing with an (M/8)x(N/8) volume.  The segmentation should run much quicker on the smaller volume. Next, upsample the result back to MxN and use this as an initialization for the full data.  The idea is that the time saved on the full segmentation by having a good estimate based on downsampled data will make up for the time needed to downsample, segment on the small data, and upsample.</p>
</li>
<h3>
<li>Use approximate active contours.</h3>
<p style="margin-left:.5in;">
Using an approximate solution for all or part of your segmentation can be helpful.  As in 2 and 3, you can use an approximate active contour technique to quickly get close to the right answer.  Then you can use an <a href="http://www.shawnlankton.com/2009/04/sfm-and-active-contours/">accurate level sets implementation</a> to get the <em>right</em> answer quickly.  Alternatively, the discrete methods can work quite well alone!  <a href="http://www.jgmalcolm.com">James Malcolm</a> proposed a nice method in “<a href="http://www.jgmalcolm.com/pubs/malcolm_lsdm.pdf">Fast Approximate Surface Evolution in Arbitrary Dimension</a>” [<a href="http://www.jgmalcolm.com/code/ls_discrete.zip">code</a>].</p>
</li>
<h3>
<li>Use another technique entirely.</h3>
<p style="margin-left:.5in;">
Active contours are &#8220;variational,&#8221; so they give nice, principled solutions with analytic geometry, etc.  However, if you just want fast segmentations, other techniques such as thresholding/morphology, graph cuts, <a href="http://www.shawnlankton.com/2008/03/growcut-segmentation-in-matlab/">region growing</a>, etc. can all be viable solutions.</p>
</li>
</ol>
<p>Any other tips or links to good implementations?  Leave them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2009/07/fast-active-contours/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sparse Field Active Contours</title>
		<link>http://www.shawnlankton.com/2009/04/sfm-and-active-contours/</link>
		<comments>http://www.shawnlankton.com/2009/04/sfm-and-active-contours/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 15:04:15 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[active contours]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[level sets]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[segmentation]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/?p=390</guid>
		<description><![CDATA[Active contour methods for image segmentation allow a contour to deform iteratively to partition an image into regions. Active contours are often implemented with level sets. The primary drawback, however, is that they are slow to compute. This post presents a technical report describing, in detail, the sparse field method (SFM) proposed by Ross Whitaker [...]]]></description>
			<content:encoded><![CDATA[<p>Active contour methods for image segmentation allow a contour to deform iteratively to partition an image into regions. Active contours are often implemented with level sets. The primary drawback, however, is that they are slow to compute.  This post presents a technical report describing, in detail, the sparse field method (SFM) proposed by Ross Whitaker [<a href="http://scholar.google.com/scholar?cluster=13533791363488741942&#038;hl=en&#038;as_sdt=20000000000">pdf</a>], which allows one to implement level set active contours very efficiently.  The algorithm is described in detail, specific notes are given about implementation, and source code is provided.</p>
<h3>Fast Level Sets Demo</h3>
<p>The links below point to the technical report and a demo written in C++/MEX that can be run directly in MATLAB.  The demo implements the Chan-Vese segmentation energy, but many energies can be minimized using the provided framework.</p>
<blockquote><p>
<a href="http://www.shawnlankton.com/wp-content/uploads/articles/lankton-sfm-TR-2009.pdf">Sparse Field Method &#8211; Technical Report [pdf]</a><br />
<a href="http://www.shawnlankton.com/wp-content/uploads/files/sfm_chanvese_demo.zip">Sparse Field Method &#8211; Matlab Demo [zip]</a>
</p></blockquote>
<p>To run the MATLAB demo, simply unzip the file and run:<br />
<code>>>sfm_chanvese_demo</code><br />
at the command line.  On the first run, this will compile the MEX code on your machine and then run the demo.  If the MEX compile fails, please check your MEX setup.  The demo is for a 2D image, but the codes work for 3D images as well.</p>
<p>My hope is that other researchers wishing to quickly implement Whitaker&#8217;s method can use this information to easily understand the intricacies of the algorithm which, in my opinion, were not presented clearly in Whitaker&#8217;s original paper.  Personally, these codes have SUBSTANTIALLY sped up my segmentations, and are allowing me to make much faster progress towards completing my PhD!</p>
<p>Thanks to Ernst Schwartz and Andy for helping to find small bugs in the codes and documentation. (they&#8217;re fixed now!)</p>
<p>For more information regarding active contour, segmentation, and computer vision, check here: <a href="http://www.shawnlankton.com/category/vision/">Computer Vision Posts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2009/04/sfm-and-active-contours/feed/</wfw:commentRss>
		<slash:comments>73</slash:comments>
		</item>
		<item>
		<title>CVPR 2008 Wrap-Up and Selected Papers</title>
		<link>http://www.shawnlankton.com/2008/06/cvpr-2008-wrap-up-and-selected-papers/</link>
		<comments>http://www.shawnlankton.com/2008/06/cvpr-2008-wrap-up-and-selected-papers/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 00:01:26 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[paper]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/06/cvpr-2008-wrap-up-and-selected-papers/</guid>
		<description><![CDATA[I return today from a week-long trip to Anchorage, Alaska. I spent the week enjoying the beautiful mountains, and the exciting science being presentented at the Conference for Computer Vision and Pattern Recognition (CVPR 2008) [here are some links to lots of papers from the conference]. This was my first trip to this conference, and [...]]]></description>
			<content:encoded><![CDATA[<p>I return today from a week-long trip to Anchorage, Alaska.  I spent the week enjoying the beautiful mountains, and the exciting science being presentented at the Conference for Computer Vision and Pattern Recognition (CVPR 2008) [here are some <a href="http://gmazars.info/conf/cvpr2008.html">links to lots of papers</a> from the conference]. This was my first trip to this conference, and I must say that I was impressed with the quality of the work presented.  Below, I list some of my favorite papers and give a (very) brief overview:</p>
<p><span id="more-350"></span></p>
<h2>Edge Finding</h2>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Using Contours to Detect and Localize Junctions in Natural<br />
Images.</strong> Michael Maire, Pablo ArbelÃ¡ez, Charless Fowlkes and Jitendra Malik. CVPR, 2008. [<a href="http://www.cs.berkeley.edu/~arbelaez/publications/Maire_Arbelaez_Fowlkes_Malik_CVPR2008.pdf">paper</a>]</p>
<p>Maire <em>et al.</em> Make significant progress in edge detection and junction detection by using very clever insights into the way humans perceive and draw images. They also demonstrate using convincing metrics that their methods are the state of the art and rapidly approaching human-level of accuracy.</p>
<h2>Stereo and 3D</h2>
<p>I was impressed with the amount of focus on 3D reconstruction from either stereo cameras or monocular video cameras.  This is something that I have been interested in for some time.  Due to the apparent focus on this I may pursue this further in the coming months and try to add myself to this list!</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/06/3dvideo.png' title='3d video'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/06/3dvideo.thumbnail.png' alt='3d video' /></a><br />
</center></p>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Recovering Consistent Video Depth Maps via Bundle Optimization.</strong> Guofeng Zhang, Jiaya Jia, Tien-Tsin Wong and Hujun Bao. CVPR, 2008. [<a href="http://www.cad.zju.edu.cn/home/gfzhang/projects/videodepth/">project website</a>]</p>
<p>This was one of the first talks I saw and I was floored by the results.  The authors use a single video stream to compute beautiful 3D models of the scene.  The algorithm makes use of the temporal consistency of video as well as visual similarities between subsequent frames.</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/06/inpainting.png' title='inpainting'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/06/inpainting.thumbnail.png' alt='inpainting' /></a><br />
</center></p>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Stereoscopic Inpainting: Joint Color and Depth Completion from Stereo Images.</strong> Liang Wang, Hailin Jin, Ruigang Yang and Minglun Gong. CVPR, 2008.</p>
<p>Here, authors combine the ideas of in-painting (filling missing areas in an image automatically) and stereo depth estimation to dramatically improve both disciplines.  By using in-painting methods, occlusions in stereo pairs can be accurately completed, and by supplementing visual in-painting with depth estimates, better results can be obtained.</p>
<h2>3D Point Clouds</h2>
<p>The analysis of shapes and 3D objects often relies on the use of a <em>cloud</em> of points on the surface of an object.  Although this wasn&#8217;t as popular as stereo at CVPR, it was still a noteworthy discipline&#8230; and one that is likely to grow.</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/06/shape.png' title='shape analysis'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/06/shape.thumbnail.png' alt='shape analysis' /></a><br />
</center></p>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Three-Dimensional Point Cloud Recognition via Distributions of Geometric Distances.</strong> Mona Mahmoudi and Guillermo Sapiro. CVPR, 2008. [<a href="http://64.233.179.104/scholar?hl=en&#038;lr=&#038;q=cache:wpcpN8rNFVcJ:https://www.ima.umn.edu/preprints/may2008/2209.pdf+Three-Dimensional+Point+Cloud+Recognition+via+Distributions+of+Geometric+Distances">google cache of paper</a>]</p>
<p>Shape recognition is a very complicated problem.  Here, Mahmoudi and Sapiro take a very refreshing new approach.  By computing histograms of features such as pair-wise distances, and curvature they create a system capable of matching shapes very well to ones in large databases.  Their method simplifies this hard task and yields excellent results.</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/06/registration.png' title='registration'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/06/registration.thumbnail.png' alt='registration' /></a><br />
</center></p>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Particle Filtering for Registration of 2D and 3D Point Sets with Stochastic Dynamics.</strong> Romeil Sandhu, Samuel Dambreville and Allen Tannenbaum. CVPR, 2008.</p>
<p>Cry nepotism if you like, but this is excellent paper from my colleague Rome Sandhu.  Lining up point clouds is a task that crops up all over.  This technique allows registration of small bits of data onto known models and even bits of data onto other bits of data.  The results are simply incredible considering it would be a challenge to do this even for a human!</p>
<h2>Visual Summary</h2>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/06/summary.png' title='image summary'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/06/summary.thumbnail.png' alt='image summary' /></a><br />
</center></p>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Summarizing Visual Data Using Bidirectional Similarity.</strong> Denis Simakov, Yaron Caspi. Eli Shechtman and Michal Irani. CVPR, 2008. [<a href="http://www.wisdom.weizmann.ac.il/~vision/VisualSummary.html">project website</a>]</p>
<p>I was amazed last year by a technique called <a href="http://www.shawnlankton.com/2007/10/vision-research-report/">Seam Carving</a> used to re-size images without losing or shrinking important information.  This technique accomplishes the same goal, and sometimes does a far better job.  The approach is two-fold: 1) make sure the smaller image has as much data as possible from the original, 2) make sure the smaller image doesn&#8217;t have any *new* data.  The second constraint ensures that no artifacts develop.</p>
<h2>Skeletonization</h2>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Geometric Modeling of Tubular Structure.</strong> Huseyin Tek and M. Akif Gulsun. MMBIA(CVPR), 2008.</p>
<p>I am currently working on vessel analysis myself, and have been reviewing different methods of construction a &#8220;skeleton&#8221; or stick-like model of a vessel structure.  Tek and Gulsun of Siemens Corporate Research have a very clever solution wherein they find the best line through a structure by measuring the &#8220;roundness&#8221; of the surrounding data.</p>
<h2>My Work</h2>
<p style="margin-left:.35in;text-indent:-.25in"><strong>Localized Statistics for DW-MRI Fiber Bundle Segmentation.</strong> Shawn Lankton, John Melonakos, James Malcolm, Samuel Dambreville and Allen Tannenbaum. MMBIA(CVPR), 2008. [<a href="http://www.shawnlankton.com/wp-content/uploads/articles/lankton-lsfb-MMBIA-2008.pdf">pdf paper</a>]</p>
<p>Just in case you were wondering, this is the paper that brought me to Alaska to take part in this conference.  I use a method that looks locally at image differences in brain scans to find the shape of neuron bundles that run through the brain.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/06/cvpr-2008-wrap-up-and-selected-papers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tracking Through Changes in Scale</title>
		<link>http://www.shawnlankton.com/2008/05/paper-accepted-to-icip-2008/</link>
		<comments>http://www.shawnlankton.com/2008/05/paper-accepted-to-icip-2008/#comments</comments>
		<pubDate>Mon, 05 May 2008 22:00:29 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[tracking]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/05/paper-accepted-to-icip-2008/</guid>
		<description><![CDATA[I will be presenting &#8220;Tracking Through Changes in Scale&#8221; at the International Conference on Image Processing (ICIP) in San Diego in October, 2008. This tracker uses a two-phase template matching algorithm in conjunction with a novel template update scheme to keep track of objects as their appearance and size changes drastically over the course of [...]]]></description>
			<content:encoded><![CDATA[<p>I will be presenting &#8220;Tracking Through Changes in Scale&#8221; at the International Conference on Image Processing (ICIP) in San Diego in October, 2008.  This tracker uses a two-phase template matching algorithm in conjunction with a novel template update scheme to keep track of objects as their appearance and size changes drastically over the course of a video sequence.</p>
<p>The pdf, presentation material, and citation information will be available on <a href="http://www.shawnlankton.com/publications/">the publications page</a> after the conference.  Below are videos of the  experiments shown in the paper:</p>
<p>&nbsp;<br />
LEAVES Sequence (<a href="http://zoe.bme.gatech.edu/~gte403z/leaves.avi">High Resolution Download &#8211; 11.2Mb</a>)<br />
<center><object width="350" height="292"><param name="movie" value="http://www.youtube.com/v/UzehkK6dmes&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/UzehkK6dmes&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="350" height="292"></embed></object></center></p>
<p>&nbsp;<br />
VEHICLE Sequence (<a href="http://zoe.bme.gatech.edu/~gte403z/tank.avi">High Resolution Download &#8211; 34.8Mb</a>)<br />
<center><object width="350" height="292"><param name="movie" value="http://www.youtube.com/v/Wi9ZUEQrTqA&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Wi9ZUEQrTqA&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="350" height="292"></embed></object></center></p>
<p>&nbsp;<br />
BOAT Sequence (<a href="http://zoe.bme.gatech.edu/~gte403z/boat.avi">Hi Resolution Download &#8211; 2.34Mb<a>)<br />
<center><object width="350" height="292"><param name="movie" value="http://www.youtube.com/v/hcTWndgWVjA&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/hcTWndgWVjA&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="350" height="292"></embed></object></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/05/paper-accepted-to-icip-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://zoe.bme.gatech.edu/~gte403z/leaves.avi" length="11764660" type="video/x-msvideo" />
<enclosure url="http://zoe.bme.gatech.edu/~gte403z/tank.avi" length="36477262" type="video/x-msvideo" />
<enclosure url="http://zoe.bme.gatech.edu/~gte403z/boat.avi" length="2455636" type="video/x-msvideo" />
		</item>
		<item>
		<title>Tracking and Surveillance Projects</title>
		<link>http://www.shawnlankton.com/2008/05/tracking-and-surveillance-projects/</link>
		<comments>http://www.shawnlankton.com/2008/05/tracking-and-surveillance-projects/#comments</comments>
		<pubDate>Sat, 03 May 2008 22:00:02 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/05/tracking-and-surveillance-projects/</guid>
		<description><![CDATA[I took a special topics course in Spring 2008 at Georgia Tech, ECE 8893: Embedded Video Surveillance Systems. The course included three projects, each shown below. Detailed information about the algorithm is in the source code comments. (All the source is in Python) Project 1: Activity Density Estimation Use background subtraction to find moving foreground [...]]]></description>
			<content:encoded><![CDATA[<p>I took a special topics course in Spring 2008 at Georgia Tech, <a href="http://users.ece.gatech.edu/~scotty/8893/index.html">ECE 8893: Embedded Video Surveillance Systems</a>.  The course included three projects, each shown below.  Detailed information about the algorithm is in the source code comments.  (All the source is in Python)</p>
<p><strong>Project 1: Activity Density Estimation</strong></p>
<p>Use background subtraction to find moving foreground objects in a video sequence.  Then, color-code regions with the most activity.  Here is the result:</p>
<p><center><object width="400" height="334"><param name="movie" value="http://www.youtube.com/v/V5A9xH9s-78&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/V5A9xH9s-78&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="400" height="334"></embed></object></center></p>
<blockquote><p>
Source: <a href="http://www.shawnlankton.com/wp-content/uploads/files/ece8893/p1.py">p1.py</a>
</p></blockquote>
<p><strong>Project 2: Styrofoam Airplane Tracking</strong></p>
<p>Find all white styrofoam planes in the scene and track them throughout the scene.  We used color thresholding and simple dynamics to do the tracking.</p>
<p><center><object width="400" height="334"><param name="movie" value="http://www.youtube.com/v/HUGljVCspnM&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/HUGljVCspnM&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="400" height="334"></embed></object></center></p>
<blockquote><p>
Source: <a href="http://www.shawnlankton.com/wp-content/uploads/files/ece8893/p2.py">p2.py</a>
</p></blockquote>
<p><strong>Project 3: Pedestrian Tracking</strong></p>
<p>Count and track the pedestrians that cross on a busy sidewalk.  We use a combination of motion estimation via background subtraction and feature matching using the Bhattacharyya measure.</p>
<p><center><object width="400" height="334"><param name="movie" value="http://www.youtube.com/v/SBmdl8iXM9k&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/SBmdl8iXM9k&#038;hl=en&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00" type="application/x-shockwave-flash" wmode="transparent" width="400" height="334"></embed></object></center></p>
<blockquote><p>
Source: <a href="http://www.shawnlankton.com/wp-content/uploads/files/ece8893/p3.py">p3.py</a><br />
Final Report: <a href="http://www.shawnlankton.com/wp-content/uploads/files/ece8893/p3.pdf">p3.pdf</a>
</p></blockquote>
<p>Most of this code is very hack-y because it was done quickly.  However, it was<br />
fun to learn Python, and the class was enjoyable overall.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/05/tracking-and-surveillance-projects/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Median Filter and Morphological Dilation in Python</title>
		<link>http://www.shawnlankton.com/2008/05/median-filter-and-morphological-dilation-in-python/</link>
		<comments>http://www.shawnlankton.com/2008/05/median-filter-and-morphological-dilation-in-python/#comments</comments>
		<pubDate>Thu, 01 May 2008 14:48:16 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/05/median-filter-and-morphological-dilation-in-python/</guid>
		<description><![CDATA[Python is a very nice programming language. Fast. Simple. Free. I recently spent some time learning it for a class on computer vision. I was using the PIL and numpy packages to make Python feel more like my old friend Matlab. The two functions that I couldn&#8217;t find, and missed the most (especially when writing [...]]]></description>
			<content:encoded><![CDATA[<p>Python is a very nice programming language.  Fast. Simple. Free.  I recently spent some time learning it for a class on computer vision.  I was using the PIL and numpy packages to make Python feel more like my old friend Matlab.  </p>
<p>The two functions that I couldn&#8217;t find, and missed the most (especially when writing hack-y code for class projects) were median filtering and morphological dilation.  So, in hopes of sparing other the pain of writing them&#8230; here they are!  The function medfilt_dilate.py has both functions.</p>
<blockquote><p>
<a href="http://www.shawnlankton.com/wp-content/uploads/files/medfilt_dilate.py">medfilt_dilate.py</a>
</p></blockquote>
<p>The medfilt() function uses the PIL filtering code.  The dilate() function was written from scratch with NumPy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/05/median-filter-and-morphological-dilation-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast 3D Stereo Vision</title>
		<link>http://www.shawnlankton.com/2008/04/stereo-vision-update-with-new-code/</link>
		<comments>http://www.shawnlankton.com/2008/04/stereo-vision-update-with-new-code/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 22:00:11 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[stereo vision]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/04/stereo-vision-update-with-new-code/</guid>
		<description><![CDATA[Recently, I started looking at faster ways to perform dense stereo matching for some work with 3D video. After some experimentation, I found out that by using a selective mode filter paired with naive correspondence matching, I was able to get satisfactory results very quickly. Check out the slide show below for some results! [red [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I started looking at faster ways to perform dense stereo matching for some work with 3D video.  After some experimentation, I found out that by using a <a href="http://www.shawnlankton.com/2008/04/selective-mode-filter-in-matlab/">selective mode filter</a> paired with naive correspondence matching, I was able to get satisfactory results very quickly.  Check out the slide show below for some results!</p>
<p><center><br />
<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&#038;RGB=0x000000&#038;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fshawn.lankton%2Falbumid%2F5188210756103456801%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DxyPWYtqp8GM" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><br />
[red indicates close, blue indicates far away]<br />
</center></p>
<p>&nbsp;</p>
<p>Here is a download-able Matlab demo, which should work on any pre-aligned stereo image pairs:</p>
<blockquote><p>
<a href="http://www.shawnlankton.com/wp-content/uploads/files/stereo_modefilt.zip">stereo_modefilt.zip</a>
</p></blockquote>
<p>The entire code is written in Matlab/C++/MEX.  The stereo matching is all in Matlab, and the selective mode filter is coded in C++ and callable from Matlab (meaning it must be compiled before it can run).  Currently, the correspondence is the major bottleneck, so anyone who can improve this, please let me know!  Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/04/stereo-vision-update-with-new-code/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>Selective Mode filter in Matlab</title>
		<link>http://www.shawnlankton.com/2008/04/selective-mode-filter-in-matlab/</link>
		<comments>http://www.shawnlankton.com/2008/04/selective-mode-filter-in-matlab/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 04:15:01 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[image processing]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/04/selective-mode-filter-in-matlab/</guid>
		<description><![CDATA[The median filter is a well-known image processing filter. It provides a very nice way to smooth an image while preserving edges. The median filter replaces each pixel in the image with the median value of its neighboring pixels. A similar non-linear filter with slightly different properties is the mode filter which replaces each pixel [...]]]></description>
			<content:encoded><![CDATA[<p>The median filter is a well-known image processing filter.  It provides a very nice way to smooth an image while preserving edges.  The median filter replaces each pixel in the image with the <em>median</em> value of its neighboring pixels.  A similar non-linear filter with slightly different properties is the mode filter which replaces each pixel with the <em>mode</em> of its neighboring pixels.  I additionally make a slight modification so that &#8220;bad&#8221; pixels are ignored entirely in the computation of the mode.</p>
<p>This idea arose when I was trying to de-noise some images as well as do some in-painting of &#8220;bad&#8221; pixels (that have no value).  Consider the image below. The darkest-blue areas are bad pixels.  We have no information for those pixels.  The other pixels are colored to show how far that pixel is from the camera.  (<a href="http://www.shawnlankton.com/2007/12/3d-vision-with-stereo-disparity/">see the post on Stereo Vision</a>)  However, some of the good pixels still have the wrong value.  These are the noise pixels.</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/04/p_orig.png' title='original data'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/04/p_orig.thumbnail.png' alt='original data' /></a><br />
[Initial Image]<br />
</center></p>
<p>In the rest this post I talk about how we use a selective mode filter to convert the above image into the one below.  (There&#8217;s also download-able Matlab/C++ code)</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/04/selective_modefilt1.png' title='selective modefilt'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/04/selective_modefilt1.thumbnail.png' alt='selective modefilt' /></a><br />
[Final Result of Selective Mode Filter]<br />
</center></p>
<p><span id="more-323"></span></p>
<h2>First Try</h2>
<p>First, we compare a standard median filter along-side a standard mode filter. We see that the two results are very similar.  I deem the mode filter to be slightly better, but this is pretty subjective.  As you can see, both methods do a good job of eliminating noise although neither filter removes the bad pixels.</p>
<p><center><br />
<a href='http://www.shawnlankton.com/wp-content/uploads/2008/04/medfilt.png' title='median filter'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/04/medfilt.thumbnail.png' alt='median filter' height=120 width=160/></a>&nbsp;&nbsp;<a href='http://www.shawnlankton.com/wp-content/uploads/2008/04/modefilt.png' title='mode filter'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/04/modefilt.thumbnail.png' alt='mode filter' height=120 width=160/></a><br />
[Standard Median Filter, Standard Mode Filter]<br />
</center></p>
<h2>Being Selective</h2>
<p>The solution is to ignore bad pixels so that they can not contribute to the computation of the median or mode (depending on which filter you use).  In my example, bad pixels are value &#8217;0&#8242; while all the other pixels are positive and non-zero.  Therefore, I re-wrote the mode filter to ignore pixels under a threshold when computing the local mode around each pixel.  The result is very nice.  Some of the fine-scale features are lost, but overall, the number of noise pixels <em>and</em> bad pixels are greatly reduced.</p>
<h2>Conclusion &#038; Download</h2>
<p>This is a simple idea, but it had very nice results.  A good next step would be to create a selective median filter.  I implemented this in mex so the operation is very quick.  In the demo below I include binaries for most platforms, but if doesn&#8217;t work on your computer you may need to re-compile.</p>
<blockquote><p>
<a href="http://www.shawnlankton.com/wp-content/uploads/files/modefilt.zip">modefilt.zip</a>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/04/selective-mode-filter-in-matlab/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Active Contour Matlab Code Demo</title>
		<link>http://www.shawnlankton.com/2008/04/active-contour-matlab-code-demo/</link>
		<comments>http://www.shawnlankton.com/2008/04/active-contour-matlab-code-demo/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 22:00:38 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Academic]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[active contours]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[segmentation]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/04/active-contour-matlab-code-demo/</guid>
		<description><![CDATA[UPDATE: My new post: Sparse Field Active Contours implements quicker, more accurate active contours. Today, I added demo code for the Hybrid Segmentation project. This segmentation algorithm (in the publications section) can be used to find the boundary of objects in images. This approach uses localized statistics and sometimes gets better results than classic methods. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
<strong>UPDATE:</strong> <br/>My new post: <a href="http://www.shawnlankton.com/2009/04/sfm-and-active-contours/">Sparse Field Active Contours</a><br/> implements quicker, more accurate active contours.
</p></blockquote>
<p>Today, I added demo code for the <a href="http://www.shawnlankton.com/2007/02/cool-hybrid-segmentation/">Hybrid Segmentation</a> project. This segmentation algorithm (in the <a href="http://www.shawnlankton.com/publications/">publications section</a>) can be used to find the boundary of objects in images.  This approach uses localized statistics and sometimes gets better results than classic methods.  For an example, see the video below:  The contour begins as a rectangle, but deforms over time so that it finally forms the outline of the monkey.</p>
<p><center><object width="252" height="200"><param name="movie" value="http://www.youtube.com/v/9Kx4Wsylryw&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/9Kx4Wsylryw&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="252" height="200"></embed></object></center></p>
<p>This can be used to segment many different classes of image.  To try it out, download the demo below and run &gt;&gt;localized_seg_demo</p>
<blockquote><p><a href="http://www.shawnlankton.com/wp-content/uploads/files/hybridseg/localized_seg.zip">localized_seg.zip</a></p></blockquote>
<p><center><object width="252" height="200"><param name="movie" value="http://www.youtube.com/v/H3P5N7ZfvEo&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/H3P5N7ZfvEo&#038;rel=0&#038;color1=0x234900&#038;color2=0x4e9e00&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="252" height="200"></embed></object></center></p>
<p>This code is based on a standard level set segmentation; it just optimizes a different energy.  I&#8217;ve also made a demo which implements the well-known Chan-Vese segmentation algorithm.  This technique is similar to the one above, but it looks at global statistics.  This makes it more robust to initialization, but it also means that more constraints are placed on the image.  Download it and see what you think!  Again, unzip the file and run &gt;&gt;region_seg_demo</p>
<blockquote><p><a href="http://www.shawnlankton.com/wp-content/uploads/files/sfm_chanvese_demo.zip">sfm_chanvese_demo.zip</a> (New! <a href="http://www.shawnlankton.com/2009/04/sfm-and-active-contours/">Described Here</a>)<br/><br />
<del datetime="2009-07-02T18:20:17+00:00"><a href="http://www.shawnlankton.com/wp-content/uploads/files/regionbased_seg.zip">regionbased_seg.zip</a></del> (old and slow)</p></blockquote>
<p>For another Matlab implementation of Active Contours check out: <a href="http://www.jgmalcolm.com">James Malcolm&#8217;s Webpage</a>.  He has some codes for very fast approximate implementations as well as a full numerical implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/04/active-contour-matlab-code-demo/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>GrowCut Segmentation In Matlab</title>
		<link>http://www.shawnlankton.com/2008/03/growcut-segmentation-in-matlab/</link>
		<comments>http://www.shawnlankton.com/2008/03/growcut-segmentation-in-matlab/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 15:01:57 +0000</pubDate>
		<dc:creator>Shawn Lankton</dc:creator>
				<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Vision]]></category>
		<category><![CDATA[computer vision]]></category>
		<category><![CDATA[segmentation]]></category>

		<guid isPermaLink="false">http://www.shawnlankton.com/2008/03/growcut-segmentation-in-matlab/</guid>
		<description><![CDATA[I came across a cute segmentation idea called &#8220;Grow Cut&#8221; [pdf]. This paper by Vladimir Vezhnevets and Vadim Konouchine presents a very simple idea that has very nice results. I always feel that the simplest ideas are the best! Below I give a brief description of the algorithm and link to the Matlab/C/mex code. GrowCut [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a cute segmentation idea called &#8220;Grow Cut&#8221; [<a href="http://graphics.cs.msu.su/en/publications/text/gc2005vk.pdf">pdf</a>]. This paper by Vladimir Vezhnevets and Vadim Konouchine presents a very simple idea that has very nice results.  I always feel that the simplest ideas are the best!  Below I give a brief description of the algorithm and link to the Matlab/C/mex code.</p>
<h2>GrowCut Region Growing Algorithm</h2>
<p>This algorithm is presented as an alternative to <a href="http://en.wikipedia.org/wiki/Graph_cuts_in_computer_vision">graph-cuts</a>.  The operation is very simple, and can be thought of with a biological metaphor: Imagine each image pixel is a &#8220;cell&#8221; of a certain type.  These cells can be foreground, background, undefined, or others.  As the algorithm proceeds, these cells compete to dominate the image domain.  The ability of the cells to spread is related to the image pixel intensity.</p>
<p>The authors give some pseudocode that very concisely describes the algorithm.</p>
<p><code><br />
//for every cell p<br />
for all p in image<br />
&nbsp;&nbsp;//copy previous state<br />
&nbsp;&nbsp;labels_new = labels;<br />
&nbsp;&nbsp;strength_new = strength;<br />
&nbsp;&nbsp;// all neighbors q of p attack<br />
&nbsp;&nbsp;for all q neighbors<br />
&nbsp;&nbsp;&nbsp;&nbsp;if(attack_force*strength(q)>strength_new(p))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;labels_new(p) = labels(q)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strength(p) = strength_new(q)<br />
&nbsp;&nbsp;&nbsp;&nbsp;end if<br />
&nbsp;&nbsp;end for<br />
end for<br />
</code></p>
<h2>Segmentation Results</h2>
<p>Once implemented, this is a nice way to get segmentations.  It is quite fast, and the initialization is very intuitive.  Consider this picture of a lotus flower:</p>
<p><center><a href='http://www.shawnlankton.com/wp-content/uploads/2008/03/image.png' title='growcut image'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/03/image.thumbnail.png' alt='growcut image' /></a></center></p>
<p>I made an initialization by clicking 20 points in the flower and 30 points outside.  I then made a &#8220;label map&#8221; where unlabeled pixels are 0 (gray), foreground pixels are 1 (white) and background pixels are -1 (black).</p>
<p><center><a href='http://www.shawnlankton.com/wp-content/uploads/2008/03/seeds.png' title='growcut seeds'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/03/seeds.thumbnail.png' alt='growcut seeds' /></a></center></p>
<p>Based on this simple initialization, we obtain a very decent segmentation:</p>
<p><center><a href='http://www.shawnlankton.com/wp-content/uploads/2008/03/output.png' title='growcut output'><img src='http://www.shawnlankton.com/wp-content/uploads/2008/03/output.thumbnail.png' alt='growcut output' /></a></center></p>
<p>As you can see, it isn&#8217;t perfect, but it is quite good.  Its possible to interactively refine the seed points to improve the segmentation, but I didn&#8217;t do that here.</p>
<h2>Matlab Code Downloads</h2>
<p>I implemented this code in Matlab (using mex files due to the extensive use of for loops).  You can download this below with compiled binaries for mac, linux, and windows.  Unzip the file and run >>growcut_test for a demo.</p>
<p><strong>UPDATE:</strong> I&#8217;ve fixed some bugs thanks to reader, Lin.  The code works much better now!</p>
<blockquote><p>
<a href="http://www.shawnlankton.com/wp-content/uploads/files/growcut/growcut.zip">Source &#038; Compiled Binaries (96k) [zip]</a><br />
<a href="http://graphics.cs.msu.su/en/publications/text/gc2005vk.pdf">&#8220;GrowCut&#8221; Paper [pdf]</a>
</p></blockquote>
<p>Please let me know if you find this useful, and if you make improvements!   Also, check out these related segmentation posts: </p>
<h2>Related Segmentation Posts</h2>
<ul>
<li><a href="http://www.shawnlankton.com/2007/11/mean-shift-segmentation-in-matlab/">Mean-Shift Image Segmentation</a></li>
<li><a href="http://www.shawnlankton.com/2008/04/active-contour-matlab-code-demo/">Localized Active Contours</a></li>
<li><a href="http://www.shawnlankton.com/2009/04/sfm-and-active-contours/">Fast Level Sets for Segmentation</a></li>
]]></content:encoded>
			<wfw:commentRss>http://www.shawnlankton.com/2008/03/growcut-segmentation-in-matlab/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>

