<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Technical Experience Page</title>
	<atom:link href="http://makarandtapaswi.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://makarandtapaswi.wordpress.com</link>
	<description>Signal Processing, Matlab, Software, Utils, Tips and Tricks</description>
	<lastBuildDate>Tue, 03 Jan 2012 22:21:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='makarandtapaswi.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Technical Experience Page</title>
		<link>http://makarandtapaswi.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://makarandtapaswi.wordpress.com/osd.xml" title="The Technical Experience Page" />
	<atom:link rel='hub' href='http://makarandtapaswi.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Manifold Learning</title>
		<link>http://makarandtapaswi.wordpress.com/2011/10/12/manifold-learning/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/10/12/manifold-learning/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 18:04:41 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Models & Pattern Recognition]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=722</guid>
		<description><![CDATA[Machine learning has faced a strange curse of dimensionality, where it becomes difficult to compare data points when they are really long vectors. This arises from the fact that most distances are normally computed in the Euclidean space and this gets quite complicated (see explanation of hypersphere/hypercube). There are many dimensionality reduction techniques, the most [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=722&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">Machine learning has faced a strange <a href="http://en.wikipedia.org/wiki/Curse_of_dimensionality" title="Curse of Dimensionality Wiki" target="_blank">curse of dimensionality</a>, where it becomes difficult to compare data points when they are really long vectors. This arises from the fact that most distances are normally computed in the Euclidean space and this gets quite complicated (see explanation of hypersphere/hypercube). </p>
<p>There are many dimensionality reduction techniques, the most famous being <a href="http://en.wikipedia.org/wiki/Principal_component_analysis" title="PCA Wiki" target="_blank">Principal Component Analysis</a> which in fact works quite well when the data points are somewhat linearly distributed. However it produces disastrous results in case of non-linear distributions.</p>
<p>What is a manifold? The underlying idea is that in very large dimensional spaces, data points of physical processes usually tend to occur in restricted regions, and are almost never uniformly distributed through the entire space. A manifold is an imaginary surface on which these data-points are assumed to lie. Furthermore the key concept is that this manifold has very few degrees of freedom, and hence can be represented in a low-dimensional space.</p>
<p>The distance between the data points is now computed as the shortest distance while tracing along the manifold. For example, consider our Earth. To go from Delhi to New York you could drill through the ground and obtain the shortest distance in 3-D Euclidean space. However this is infeasible and the true shortest distance is actually the geodesic distance, the one when traveling on the surface of Earth. Here our Earth&#8217;s surface is our manifold in the large universe!</p>
<p>Given the data points, the objective is to find this manifold so that data-points close to each other on the manifold surface can be classified as belonging together instead of the ones which are close in Euclidean space. However finding this exact geometric shape is truly a Herculean task in most cases. Hence, the objective is transformed to find a function which can map the data from the high dimensional space to a simpler low dimensional space, such that the distance between the points in the low dimension corresponds to the geodesic distance as computed on the manifold.</p>
<p>Techniques such as <a href="http://isomap.stanford.edu/" title="Tenenbaum ISOMAP" target="_blank">ISOMAP</a> and <a href="http://cs.nyu.edu/~roweis/lle/" title="Roweis LLE" target="_blank">LLE</a> developed in 2000 created quite a stir and were published in Science!! <a href="http://videolectures.net/mlss09us_niyogi_belkin_gmml/" title="Video Lecture Geometrical Methods and Manifold Learning" target="_blank">Here</a> is a pretty interesting tutorial on manifolds, from which the above gist appears.
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/722/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=722&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/10/12/manifold-learning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>Liquid Rescale</title>
		<link>http://makarandtapaswi.wordpress.com/2011/08/07/liquid_rescale/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/08/07/liquid_rescale/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 10:36:26 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Image Processing]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=702</guid>
		<description><![CDATA[Image resizing for most cases today works directly on pixel level irrespective of the content. A first step to not distort the information is to keep the aspect ratio the same. However this too is not very good, specially if the content of focus in the image was small to begin with, thus making it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=702&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">Image resizing for most cases today works directly on pixel level irrespective of the content. A first step to not distort the information is to keep the aspect ratio the same. However this too is not very good, specially if the content of focus in the image was small to begin with, thus making it even smaller. Liquid rescale is an awesome technique for content-aware image resizing and the publication can be found <a href="http://portal.acm.org/citation.cfm?id=1276390" title="Seam carving for content-aware image resizing" target="_blank">here</a>. The video below demonstrates its applications, and also quickly explains the main concept.</p>
<p>The idea behind this is astonishingly simple. Instead of removing a straight column (row) of pixels to reduce the width (height), a so-called vertical (horizontal) seam is removed. The seam is a connected path of low energy pixels in the image. Thus, removing a seam does not alter the high energy content, which is usually semantically useful.</p>
<p>An image is analyzed and seams are ordered from low to high energy. The seams with lowest energy are removed first for reducing the size of the image, and subsequent seams are removed to reach the desired image size. The image can also be expanded by adding in extra pixels in these seam locations with values as the average of the neighbours. The video below throws light on how these seams look and shows nice applications.</p>
<span style="text-align:center; display: block;"><a href="http://makarandtapaswi.wordpress.com/2011/08/07/liquid_rescale/"><img src="http://img.youtube.com/vi/6NcIJXTlugc/2.jpg" alt="" /></a></span>
<p>A Gimp plugin can be found <a href="http://liquidrescale.wikidot.com/" title="Gimp Plugin - Liquid Rescale" target="_blank">here</a> and imagemagick incorporates it in <a href="http://www.imagemagick.org/Usage/resize/#liquid-rescale" title="Imagemagick liquid rescale" target="_blank">here</a>.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/702/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=702&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/08/07/liquid_rescale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>Cholesky decomposition for Matrix Inversion</title>
		<link>http://makarandtapaswi.wordpress.com/2011/07/08/cholesky-decomposition-for-matrix-inversion/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/07/08/cholesky-decomposition-for-matrix-inversion/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 17:17:55 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Mathematics]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=681</guid>
		<description><![CDATA[Matrix inversion is a classical problem, and can be very complicated for large matrices. There are many ways to simplify this for special types of matrices. Among them, one is to transform the matrix into a set of upper or lower triangular matrices. Consider our target matrix which is Hermitian and positive-definite. Such matrices are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=681&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">Matrix inversion is a classical problem, and can be very complicated for large matrices. There are many ways to simplify this for special types of matrices. Among them, one is to transform the matrix into a set of upper or lower triangular matrices. Consider our target matrix <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7BA%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathbf{A}' title='&#92;mathbf{A}' class='latex' /> which is <a href="http://en.wikipedia.org/wiki/Hermitian_matrix" title="Hermitian matrix - Wiki" target="_blank">Hermitian</a> and <a href="http://en.wikipedia.org/wiki/Positive-definite_matrix" title="Positive definite matrix - Wiki" target="_blank">positive-definite</a>. Such matrices are quite famous and an example is the covariance matrix in statistics. It&#8217;s inverse is seen in the Gaussian probability density function for vectors. Then, <a href="http://en.wikipedia.org/wiki/Cholesky_decomposition" title="Cholesky Decomposition - Wiki" target="_blank">Cholesky decomposition</a> breaks</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7BA%7D+%3D+%5Cmathbf%7BL%7D%5Cmathbf%7BL%7D%5ET+%3D+%5Cmathbf%7BU%7D%5ET%5Cmathbf%7BU%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathbf{A} = &#92;mathbf{L}&#92;mathbf{L}^T = &#92;mathbf{U}^T&#92;mathbf{U}' title='&#92;mathbf{A} = &#92;mathbf{L}&#92;mathbf{L}^T = &#92;mathbf{U}^T&#92;mathbf{U}' class='latex' /></p>
<p>where <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7BL%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathbf{L}' title='&#92;mathbf{L}' class='latex' /> is a lower triangular matrix, while <img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7BU%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathbf{U}' title='&#92;mathbf{U}' class='latex' /> is an upper triangular matrix.</p>
<p>It is much easier to compute the <a href="http://www.mcs.csueastbay.edu/~malek/TeX/Triangle.pdf" title="Inverse of triangular matrix, a numerical solution" target="_blank">inverse of a triangular matrix</a> and there exist numerical solutions. Then the original matrix inverse is computed simply by multiplying the two inverses as</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Cmathbf%7BA%7D%5E%7B-1%7D+%3D+%28%5Cmathbf%7BL%7D%5E%7B-1%7D%29%5ET%28%5Cmathbf%7BL%7D%5E%7B-1%7D%29+%3D+%28%5Cmathbf%7BU%7D%5E%7B-1%7D%29%28%5Cmathbf%7BU%7D%5E%7B-1%7D%29%5ET+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;mathbf{A}^{-1} = (&#92;mathbf{L}^{-1})^T(&#92;mathbf{L}^{-1}) = (&#92;mathbf{U}^{-1})(&#92;mathbf{U}^{-1})^T ' title='&#92;mathbf{A}^{-1} = (&#92;mathbf{L}^{-1})^T(&#92;mathbf{L}^{-1}) = (&#92;mathbf{U}^{-1})(&#92;mathbf{U}^{-1})^T ' class='latex' /></p>
<p>As bonus, the determinant is also much easier to compute.</p>
<p><img src='http://s0.wp.com/latex.php?latex=det%28%5Cmathbf%7BA%7D%29+%3D+det%28%5Cmathbf%7BL%7D%29%5E2+&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='det(&#92;mathbf{A}) = det(&#92;mathbf{L})^2 ' title='det(&#92;mathbf{A}) = det(&#92;mathbf{L})^2 ' class='latex' /></p>
<p>One can also use complex matrices, and just use a conjugate-transpose instead of transpose alone.
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/681/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=681&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/07/08/cholesky-decomposition-for-matrix-inversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>Clustering and Matlab</title>
		<link>http://makarandtapaswi.wordpress.com/2011/06/14/clustering-and-matlab/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/06/14/clustering-and-matlab/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 07:38:54 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Models & Pattern Recognition]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=647</guid>
		<description><![CDATA[Clustering data is a useful technique for compact representation (vector quantization), statistics (mean, variance of group of data) and pattern recognition(unsupervised classification). In this post, we shall briefly see the two major types of clustering techniques, and then look at how easily Matlab deals with them. One class of the techniques is Hierarchical, usually Agglomerative [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=647&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">Clustering data is a useful technique for <em>compact representation</em> (vector quantization), <em>statistics</em> (mean, variance of group of data) and <em>pattern recognition</em>(unsupervised classification). In this post, we shall briefly see the two major types of clustering techniques, and then look at how easily Matlab deals with them.</p>
<p>One class of the techniques is <strong>Hierarchical</strong>, usually Agglomerative clustering. As is clear from the words itself, agglomerative clustering involves grouping data points most &#8220;near&#8221; to each other. The measure of nearness is defined by a pre-defined measure of distance (usually Euclidean). A tree structure is built and we move from each data point being its own cluster to a 1-cluster system. The user then has to decide at which point should the clustering process stop. For example, one could stop the system when the next agglomeration involves combining clusters some <em>x</em> or more distance away. The other way would be to define a <em>maxclusters</em> criterion. However, as we shall see further that sort of defeats the purpose of hierarchical clustering.</p>
<p>In Matlab, <code>T = clusterdata(X,'cutoffType',cutoffThreshold)</code> does all the clustering work and returns the cluster classes in T. However more insight can be obtained by performing each task individually.</p>
<ol>
<li><code>Y = pdist(X,'type')</code> computes distance between data points</li>
<li><code>Z = linkage(Y,'average')</code> gets the tree linkages matrix</li>
<li><code>T = cluster(Z,'cutoffType',cutoffThreshold)</code> does the actual clustering</li>
</ol>
<p>The major advantage of breaking the steps is the ability to view awesome graphs, and observe the goodness of your clustering. <code>dendrogram(Z,'colorThreshold','default')</code> shows the tree structure with each cluster getting a unique colour. One should also try out the <code>silhouette()</code> and <code>cophenet()</code> functions.</p>
<p>The other major group is the standard <strong>Partition</strong> clustering. The classical algorithm is the <em>K-Means</em> where <em>K</em> clusters are formed. In this the user fixes the number of clusters at the start. Random initial cluster centers are picked (usually from the data points). The iterative process then involves assigning &#8220;nearest&#8221; points to the cluster center, followed by an update of the cluster center itself. This is repeated until convergence, usually such that the cluster assignment does not change (if data size is tractable).</p>
<p>In Matlab, the command <code>[T, C] = kmeans(X,k)</code> clusters the data points X into k groups, returning the centers C and the target assignment T. <a href="http://www.mathworks.com/help/toolbox/stats/kmeans.html" title="Matlab documentation for K-means clustering" target="_blank">More info</a></p>
<p>The difference between the two types is obvious. Partitional requires defining the number of clusters while the Hierarchical method needs the user to specify some sort of cutoff threshold to stop the agglomeration process. One needs to decide what is the more suitable criteria for a given problem.</p>
<p>PS: You can try out the functions by creating some data on your own by using mean-shifted Gaussians.<br />
<code>X = [-2+randn(100,1); randn(100,1); 2+randn(100,1)];</code>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/647/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/647/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=647&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/06/14/clustering-and-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>Census Transform and Faces</title>
		<link>http://makarandtapaswi.wordpress.com/2011/03/31/census-transform-and-faces/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/03/31/census-transform-and-faces/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 12:47:57 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Image Processing]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=635</guid>
		<description><![CDATA[Another transform to the bag of so many feature extraction methods, the Census Transform (CT) and Modified CT (MCT) seems to be quite an interesting way of representing images in a very local neighbourhood. The transform provides high resilience against global illumination changes and thus is quite useful for face detection across wide illumination problems. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=635&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">
Another transform to the bag of so many feature extraction methods, the Census Transform (CT) and Modified CT (MCT) seems to be quite an interesting way of representing images in a very local neighbourhood. The transform provides high resilience against global illumination changes and thus is quite useful for face detection across wide illumination problems. Combined with the standard AdaBoost it proves to be an effective face detector scheme. Additionally it seems to be also used in applications in image retrieval research too. Histograms of the transform too have been used for further analysis.</p>
<p>The concept of CT is extremely simple. Used on grayscale images, consider any pixel and its 8 neighbours. Just assign boolean values 0/1 to the pixels who have a value lower/higher than the center respectively. Scan them in row order and this generates an 8-bit stream for each pixel and is the new transform value at that pixel. The central pixel is ignored.</p>
<p>On the other hand, the MCT makes a small change in this by saying compare with the mean of the 3&#215;3 block rather than the center value. It can now also use the central pixel for comparison. A similar operation provides 9 bits which are the transform value for that pixel. A different block size like 5&#215;5 can be used too for both, however 3&#215;3 is usually the more favoured one.</p>
<p>An example figure from the paper &#8211; Face Detection with Modified Census Transform is shown here and clearly shows that the vast change in global illumination or gradient doesn&#8217;t affect the local pattern much.</p>
<div id="attachment_638" class="wp-caption aligncenter" style="width: 460px"><a href="http://makarandtapaswi.files.wordpress.com/2011/03/faces_mct1.png"><img src="http://makarandtapaswi.files.wordpress.com/2011/03/faces_mct1.png?w=450" alt="Face Detection with MCT" title="Face Detection with MCT"   class="size-full wp-image-638" /></a><p class="wp-caption-text">Face Detection with MCT</p></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/635/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/635/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/635/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=635&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/03/31/census-transform-and-faces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>

		<media:content url="http://makarandtapaswi.files.wordpress.com/2011/03/faces_mct1.png" medium="image">
			<media:title type="html">Face Detection with MCT</media:title>
		</media:content>
	</item>
		<item>
		<title>Markov Random Fields</title>
		<link>http://makarandtapaswi.wordpress.com/2011/03/11/markov-random-fields/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/03/11/markov-random-fields/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 14:47:09 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Models & Pattern Recognition]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=611</guid>
		<description><![CDATA[Graphical models are an interesting approach to pattern recognition. Most pattern recognition problems can be simplified to computation of the posterior probability of a class, given an observation. This conditional probability is represented in terms of a graphical model. Although both directed and undirected graphs can be used, Markov Random Fields (MRFs) deal with undirected [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=611&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">
Graphical models are an interesting approach to pattern recognition. Most pattern recognition problems can be simplified to computation of the posterior probability of a class, given an observation. This conditional probability is represented in terms of a graphical model. Although both directed and undirected graphs can be used, Markov Random Fields (MRFs) deal with undirected graphs. </p>
<p>Their main idea is quite a simple one. First, the problem is converted to a graph. An example would be to associate each random variable or observation with a node, and join edges of those nodes which seem to be related with each other. Then, <a href="http://en.wikipedia.org/wiki/Clique">cliques</a> of this graph are considered together. The maximal cliques in the graph (taking into account each node in atleast one of them) are associated with a strictly positive potential function. The joint probability of the model is then just a normalised product of the individual clique potential functions.</p>
<p>Now, since we require positive potential functions, a typical example is to use the exponential function. They are used as <img src='http://s0.wp.com/latex.php?latex=%5Cphi_%7BX_C%7D+%3D+e%5E%7B-E%28X_C%29%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;phi_{X_C} = e^{-E(X_C)}' title='&#92;phi_{X_C} = e^{-E(X_C)}' class='latex' /> where E is the &#8220;energy function&#8221;. It is easy to see that the joint probability (a product of individual potentials <img src='http://s0.wp.com/latex.php?latex=%5Cphi_%7BX_C%7D&amp;bg=ffffff&amp;fg=333333&amp;s=0' alt='&#92;phi_{X_C}' title='&#92;phi_{X_C}' class='latex' />) is now the exponential of a sum of energies; and following the entropy concept, we have the lower energies associated with higher probabilities. </p>
<p>These energy functions are chosen for each clique such that the desired response has lower energy, and the undesired has higher energy. Typically they could be functions of the random variables involved in that clique. They also include &#8220;constant&#8221; parameters (weights) so that more important cliques can exert dominance on the total probability of the model. These parameters then are learnt.</p>
<p>MRFs seem to be a really nice way of combining multiple observations or pattern recognition tasks intended towards a certain goal. The probabilistic approach followed here can be expected to beat the heuristics that would otherwise be employed. More on algorithms for training and testing in posts to come!</p>
<p>The book on Pattern Recognition and Machine Learning by Bishop, provides a brief idea about Graphical Models in Chapter 8 and is provided as the <a href="http://research.microsoft.com/en-us/um/people/cmbishop/prml/Bishop-PRML-sample.pdf">sample chapter</a>.
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/611/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/611/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/611/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=611&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/03/11/markov-random-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>On Distances&#8230;</title>
		<link>http://makarandtapaswi.wordpress.com/2011/02/11/on-distances/</link>
		<comments>http://makarandtapaswi.wordpress.com/2011/02/11/on-distances/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 08:40:24 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Models & Pattern Recognition]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=572</guid>
		<description><![CDATA[Distances are used every day in statistics and applied mathematics for comparing, seeing how far things are and also tend to be the classifying feature for several pattern recognition problems. Here&#8217;s a short overview of the distances I know or had heard of. Please help add others! Euclidean distance: Straight line distance between any 2 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=572&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">
Distances are used every day in statistics and applied mathematics for comparing, seeing how far things are and also tend to be the classifying feature for several pattern recognition problems. Here&#8217;s a short overview of the distances I know or had heard of. Please help add others!</p>
<p><strong>Euclidean distance</strong>: Straight line distance between any 2 points in n-dimensional Euclidean space (normally most spaces are Euclidean). Most commonly used. <a href="http://en.wikipedia.org/wiki/Euclidean_distance">More info</a><br />
<strong>Absolute distance</strong> (Manhattan distance): Follows the layout of a city while measuring distance. Basically the measure of distance while taking paths that are parallel to the axes. <a href="http://en.wikipedia.org/wiki/Manhattan_distance">More info</a><br />
<strong>p-norm distance</strong> (Minowski distance): Euclidean space distance, generalized to the order of p. (p=1: Absolute, p=2: Euclidean). Derived from the <a href="http://makarandtapaswi.wordpress.com/2009/09/18/p-norm-and-unit-circle-pics/">p-norm</a> concepts. <a href="http://en.wikipedia.org/wiki/Minkowski_distance">More info</a></p>
<p><strong>Chebyshev distance</strong>: The p-norm distance for p=infinity. It picks the axis with the maximum difference between the (corresponding) points of a vector. <a href="http://en.wikipedia.org/wiki/Chebyshev_distance">More info</a><br />
<strong>Mahalanobis distance</strong>: Similar in principle to the Euclidean distance, however takes into account the correlation between the data. Widely used in data clustering methods. <a href="http://en.wikipedia.org/wiki/Mahalanobis_distance">More info</a><br />
<strong>Algebraic distance</strong>: A popular distance metric for the Minimum Mean Square Error solutions. Represented easily with vectors and matrices, it makes this a very powerful tool. <a href="http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/FISHER/ALGDIST/alg.htm">More info</a></p>
<p><strong>Bhattacharya distance</strong>: A symmetric measure of distance used to compare probability distributions. eg. Could be used in images for comparing histograms. <a href="http://en.wikipedia.org/wiki/Bhattacharyya_distance">More info</a><br />
<strong>Kullback-Leibler distance</strong>: Used typically by the information theory people, it is an asymmetric measure between probability distributions. It can simplify a lot of Info. Theory proofs <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="http://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence">More info</a><br />
<strong>Earth Mover&#8217;s distance</strong>: Thought of as the amount of &#8220;Earth&#8221; one needs to move to make two probability distributions similar. Used typically with image histograms. <a href="http://en.wikipedia.org/wiki/Earth_mover%27s_distance">More info</a></p>
<p><strong>Hausdorff distance</strong>: Idea from set theory however, can be extended to matching shapes using edge images. It is also a measure of how similar two 3D models are in computer graphics. <a href="http://en.wikipedia.org/wiki/Hausdorff_distance">More info</a><br />
<strong>Hamming distance</strong>: The number of different symbols while comparing two strings (typically bits). Can be used to measure bit-flips or errors in a data. <a href="http://en.wikipedia.org/wiki/Hamming_distance">More info</a></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/572/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/572/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/572/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/572/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/572/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/572/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/572/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/572/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=572&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2011/02/11/on-distances/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>bsxfun</title>
		<link>http://makarandtapaswi.wordpress.com/2010/11/16/bsxfun/</link>
		<comments>http://makarandtapaswi.wordpress.com/2010/11/16/bsxfun/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 16:22:33 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=561</guid>
		<description><![CDATA[Just found this awesome function in Matlab called bsxfun. It is rather helpful, and fast too as illustrated below. Usage can be found at Matlab documentation (ofcourse!) or an example as below. It is called in a way a little similar to the late (deprecated) blkproc (or now, blockproc) function with an argument as a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=561&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">
Just found this awesome function in Matlab called <code>bsxfun</code>. It is rather helpful, and fast too as illustrated below. Usage can be found at Matlab documentation (ofcourse!) or an example as below. It is called in a way a little similar to the late (deprecated) <code>blkproc</code> (or now, <code>blockproc</code>) function with an argument as a function. The &#8220;@fun&#8221; part. </p>
<p>The example here basically computes the difference, B is subtracted from each row of A.<br />
<code><br />
&gt;&gt; A = rand(1000,3);<br />
&gt;&gt; B = rand(1,3);<br />
&gt;&gt; tic; C1 = bsxfun(@minus,A,B); toc;<br />
Elapsed time is 0.003523 seconds.<br />
&gt;&gt; tic; C2 = A - ones(1000,1)*B; toc;<br />
Elapsed time is 0.090703 seconds.<br />
</code></p>
<p>Note that it performs the subtraction on the columns, (length 3). In case you specify B as <code>B = rand(1000,1)</code> then it will perform the subtraction on the rows (length 1000).</p>
<p>Another way to achieve the same operation, without using a loop, would be using <code>repmat</code>, but it is the slowest of them all. Ofcourse, you should NOT even think of using a loop for such a thing in Matlab!
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/561/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=561&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2010/11/16/bsxfun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>SSH and screen</title>
		<link>http://makarandtapaswi.wordpress.com/2010/11/12/ssh-and-screen/</link>
		<comments>http://makarandtapaswi.wordpress.com/2010/11/12/ssh-and-screen/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 20:59:52 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[Linux Tools]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=551</guid>
		<description><![CDATA[I just learnt the amazing power of screen with ssh, and put it to use for my first time, so here&#8217;s a post Consider you are working on some data on a remote computer/server. You can access this server, but only intermittently. Also, you dont have the patience to keep some window open to stare [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=551&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">
I just learnt the amazing power of <code>screen</code> with <code>ssh</code>, and put it to use for my first time, so here&#8217;s a post <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Consider you are working on some data on a remote computer/server. You can access this server, but only intermittently. Also, you dont have the patience to keep some window open to stare at the progress of your work, but would like to visit it now and then to know how much of it is complete. Screen is the answer to your problem. The work could be from running simulations (C / C++ / other Terminal executable languages) and even can be extended to Matlab! On a console-only SSH, running <code>matlab</code> defaults to the terminal since it cannot open a graphical interface, and this aspect is exploited here.</p>
<p>The most useful feature of screen is the ability to disconnect / close the terminal, without quitting the associated programs. Further, you can reconnect to this &#8220;screen&#8221; whenever you wish. The terminology used is &#8220;detach&#8221; and &#8220;attach&#8221;. Here&#8217;s how its done.</p>
<ol>
<li>SSH to your account, wherever it is&#8230;</li>
<li>Start a session of screen by typing: <code>screen</code> This will auto-generate a weird session id. This can be renamed, but details later</li>
<li>Now, start your simulation/work in this terminal.</li>
<li><em>Detach</em>: Next, you can just close this terminal window, knowing well that your work is being carried out by the server</li>
<li>In case you want to look at the status, firstly SSH back to the account and do a <code>screen -ls</code> to get a list of running screens</li>
<li><em>Attach</em>: Connect to your screen by typing <code>screen -r &lt;name_as_in_list&gt;</code>, and you are back to your work!</li>
</ol>
<p>For more details on the usage of screen, visit <a href="http://en.gentoo-wiki.com/wiki/Screen">this</a> nice and short tutorial.</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/551/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=551&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2010/11/12/ssh-and-screen/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>
	</item>
		<item>
		<title>MPEG-7 Colour: Dominant Colour Descriptor</title>
		<link>http://makarandtapaswi.wordpress.com/2010/09/07/mpeg-7-colour-dominant-colour-descriptor/</link>
		<comments>http://makarandtapaswi.wordpress.com/2010/09/07/mpeg-7-colour-dominant-colour-descriptor/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 11:29:46 +0000</pubDate>
		<dc:creator>Makarand Tapaswi</dc:creator>
				<category><![CDATA[MPEG-7]]></category>

		<guid isPermaLink="false">http://makarandtapaswi.wordpress.com/?p=546</guid>
		<description><![CDATA[This post deals with another prominent image / video descriptor &#8211; Colour. The Dominant Colour Descriptor of the MPEG-7 is quite a useful tool for &#8220;query by example&#8221; applications. As the name indicates, the most dominant colour in the image is presented. The colour is tuned to be as close as possible to the original. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=546&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:justify;">
This post deals with another prominent image / video descriptor &#8211; Colour. The Dominant Colour Descriptor of the MPEG-7 is quite a useful tool for &#8220;query by example&#8221; applications. As the name indicates, the most dominant colour in the image is presented. The colour is tuned to be as close as possible to the original.</p>
<p>The main use can be for image retrieval. This colour and maybe amount could be used as a &#8220;feature&#8221; of the image, and then compared with the rest of the images to check for similarity. Also there are other descriptors like the colour structure descriptor, colour layout descriptor, and the basic histograms. Combined with these, an effective feature can be formed and used for the required application.</p>
<p>Firstly, the standard uses the <em>CIE L*a*b</em> colour space. This is because the Euclidean distances are more perceptual in this domain rather than the conventional RGB. (i.e. some distance X in RGB may not change the colour equally in all directions). The MPEG-7 standard suggests the so-called top-down technique. In this strategy, we first obtain one dominant colour, as the centroid of all pixels in the image. </p>
<p>The algorithm then follows by splitting this cluster. The cluster with the highest distortion is divided into two clusters by adding a small perturbation vector. However, note that this vector is not just any random vector. It is computed (using eigen values and vectors of the covariance matrix) in the direction of maximum variance. Thus we obtain two new centroid locations. These are further updated by the generalized <a href="http://en.wikipedia.org/wiki/Lloyd%27s_algorithm">Lloyd algorithm</a>, i.e. assign each point to cluster of closer proximity, and then re-compute the centroid for the given set of points.</p>
<p>Since, we pick and split the centroids with max distortion, it is possible to get any number of dominant colours for the image. Below are example images of the original image, and 3 (left top), 4 (right top), 5, 6, 7 (left bottom) and 8 (right bottom) dominant colour images (click for larger view).</p>
<div id="attachment_519" class="wp-caption aligncenter" style="width: 310px"><a href="http://makarandtapaswi.files.wordpress.com/2010/08/im.jpg"><img src="http://makarandtapaswi.files.wordpress.com/2010/08/im.jpg?w=300&#038;h=225" alt="Original Image" title="Original Image" width="300" height="225" class="size-medium wp-image-519" /></a><p class="wp-caption-text">Original Image</p></div>
<p><div id="attachment_545" class="wp-caption aligncenter" style="width: 460px"><a href="http://makarandtapaswi.files.wordpress.com/2010/09/montage_domcolour.jpg"><img src="http://makarandtapaswi.files.wordpress.com/2010/09/montage_domcolour.jpg?w=450&#038;h=500" alt="3 to 8 Dominant Colour Image" title="3 to 8 Dominant Colour Image" width="450" height="500" class="size-full wp-image-545" /></a><p class="wp-caption-text">3 to 8 Dominant Colour Image</p></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/makarandtapaswi.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/makarandtapaswi.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/makarandtapaswi.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/makarandtapaswi.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/makarandtapaswi.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/makarandtapaswi.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/makarandtapaswi.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/makarandtapaswi.wordpress.com/546/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=makarandtapaswi.wordpress.com&amp;blog=5953710&amp;post=546&amp;subd=makarandtapaswi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://makarandtapaswi.wordpress.com/2010/09/07/mpeg-7-colour-dominant-colour-descriptor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/abfc3660eaef752062608611691236ab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">makarandtapaswi</media:title>
		</media:content>

		<media:content url="http://makarandtapaswi.files.wordpress.com/2010/08/im.jpg?w=300" medium="image">
			<media:title type="html">Original Image</media:title>
		</media:content>

		<media:content url="http://makarandtapaswi.files.wordpress.com/2010/09/montage_domcolour.jpg" medium="image">
			<media:title type="html">3 to 8 Dominant Colour Image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
