<?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>La Consigna</title>
	<atom:link href="http://laconsigna.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://laconsigna.wordpress.com</link>
	<description>la consigna es la consigna... there is, still, a lot to understand</description>
	<lastBuildDate>Wed, 25 Jan 2012 07:04:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='laconsigna.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/d3551c0d57de4bcadbc1eac0e733ed48?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>La Consigna</title>
		<link>http://laconsigna.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://laconsigna.wordpress.com/osd.xml" title="La Consigna" />
	<atom:link rel='hub' href='http://laconsigna.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Using TikZ Chains Library with labeled edges extension</title>
		<link>http://laconsigna.wordpress.com/2012/01/19/using-tikz-chains-library-with-labeled-edges-extension/</link>
		<comments>http://laconsigna.wordpress.com/2012/01/19/using-tikz-chains-library-with-labeled-edges-extension/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 10:51:25 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Explanations]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Latex]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[TikZ]]></category>
		<category><![CDATA[Chains]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Edges]]></category>
		<category><![CDATA[Nodes]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=322</guid>
		<description><![CDATA[The other day I need to create a diagram, and went in the TikZ way. I was using the chains library to produce the diagram. But I face some problems, I needed to add labels to the edges created by the chain. However, this is not supported natively by the library. I found a cool [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=322&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The other day I need to create a diagram, and went in the TikZ way. I was using the <a href="http://www.texample.net/tikz/examples/diagram-chains/" target="_blank">chains library</a> to produce the diagram. But I face some problems, I needed to add labels to the edges created by the chain. However, this is not supported natively by the library.</p>
<p>I found a<a href="http://www.texample.net/tikz/examples/labeled-chain/" target="_blank"> cool code</a> that exemplifies how to add the edges to the chain, but it removes the old notation</p>
<p><pre class="brush: latex;">
\chainin (node) [join=with srcNode by style]
</pre></p>
<p>and make you use a new definition. However, I still need to use the styles and the source node notation. So, I start digging in the chains library code and modify it to allow the use of the label notation from other examples. The fix is</p>
<p><pre class="brush: latex;">
\makeatletter
\def\tikz@lib@parse@join#1{%
  \def\tikz@temp{#1}%
  \ifx\tikz@temp\pgfutil@empty%
    \tikz@lib@parse@join@by by \pgf@stop%
  \else%
    \pgfutil@in@{with }{#1}%
    \ifpgfutil@in@%
      \pgfutil@in@{by }{#1}%
      \ifpgfutil@in@%
        \pgfutil@in@{label }{#1}%
        \ifpgfutil@in@%
          \tikz@lib@parse@join@with@by@label#1\pgf@stop%
        \else%
          \tikz@lib@parse@join@with@by#1\pgf@stop%
        \fi%
      \else% no by, check for label? (if needed add it :)
        \tikz@lib@parse@join@with@by#1 by \pgf@stop%
      \fi%
    \else% no with, check for label
      \pgfutil@in@{label }{#1}%
      \ifpgfutil@in@%
        \tikz@lib@parse@join@by@label#1\pgf@stop%
      \else%
        \tikz@lib@parse@join@by#1\pgf@stop%
      \fi%
    \fi%
  \fi%
}
\def\tikz@lib@parse@join@with@by@label with #1 by #2 label #3\pgf@stop{%
  \tikzset{after node path={(#1)edge[every join,#2]#3(\tikzchaincurrent)}}%
}
\def\tikz@lib@parse@join@by@label by #1 label #2\pgf@stop{%
  \tikzset{after node path={\ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)edge[every join,#1]#2(\tikzchaincurrent)\fi}}%
}
\makeatother
</pre></p>
<p>This allows one to use the chains like:</p>
<p><pre class="brush: latex;">
\chainin (node) [join=with anotherNode by myStyle label {node[above] {some Tag}}];
\chainin (node) [join=by myStyle label {node[above] {some Tag}}];
</pre></p>
<p>The option <code>with</code> and <code>label</code> (without <code>by</code>) is not supported in this version, but changing it is a matter of replacing the <code>else</code> that has a comment about it.</p>
<p>A minimal working example is below:</p>
<p><pre class="brush: latex;">
\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{shapes,chains,scopes,matrix}

\makeatletter
\def\tikz@lib@parse@join#1{%
  \def\tikz@temp{#1}%
  \ifx\tikz@temp\pgfutil@empty%
    \tikz@lib@parse@join@by by \pgf@stop%
  \else%
    \pgfutil@in@{with }{#1}%
    \ifpgfutil@in@%
      \pgfutil@in@{by }{#1}%
      \ifpgfutil@in@%
        \pgfutil@in@{label }{#1}%
        \ifpgfutil@in@%
          \tikz@lib@parse@join@with@by@label#1\pgf@stop%
        \else%
          \tikz@lib@parse@join@with@by#1\pgf@stop%
        \fi%
      \else% no by, check for label? (if needed add it :)
        \tikz@lib@parse@join@with@by#1 by \pgf@stop%
      \fi%
    \else% no with, check for label
      \pgfutil@in@{label }{#1}%
      \ifpgfutil@in@%
        \tikz@lib@parse@join@by@label#1\pgf@stop%
      \else%
        \tikz@lib@parse@join@by#1\pgf@stop%
      \fi%
    \fi%
  \fi%
}
\def\tikz@lib@parse@join@with@by@label with #1 by #2 label #3\pgf@stop{%
  \tikzset{after node path={(#1)edge[every join,#2]#3(\tikzchaincurrent)}}%
}
\def\tikz@lib@parse@join@by@label by #1 label #2\pgf@stop{%
  \tikzset{after node path={\ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)edge[every join,#1]#2(\tikzchaincurrent)\fi}}%
}
\makeatother

\begin{document}

\begin{tikzpicture}[auto,
  decision/.style = {draw,
                     diamond,
                     text badly centered,
                     fill          = blue!5,
                     text width    = 15mm,
                     node distance = 2.5cm,
                     inner sep     = 0pt},
  block/.style    = {draw,
                     rectangle,
                     text centered,
                     rounded corners,
                     fill           = blue!5,
                     text width     = 20mm,
                     minimum height = 10mm},
  tip/.style      = {-&gt;,
                     very thick,
                     color = black!50},
  tip2/.style      = {-&gt;,
                     very thick,
                     bend right,
                     color = black!50}
]

\matrix[row sep=1cm]{
\node [block] (blk) {A block here}; \\
\node [decision] (dec) {Is something?};\\
\node [block] (blk2) {Another block};\\
};

{ [start chain]
  \chainin (blk);
  \chainin (dec) [join=by tip label {node [left] {yes}}];
  \chainin (blk2) [join=by tip];
  \chainin (blk2) [join=with blk by {tip2} label {node[left]{my tag}}];
}

\end{tikzpicture}
\end{document}
</pre></p>
<p>HTH&#8230; <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/322/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=322&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2012/01/19/using-tikz-chains-library-with-labeled-edges-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
		<item>
		<title>MATLAB to PSTricks</title>
		<link>http://laconsigna.wordpress.com/2011/11/04/matlab-to-pstricks/</link>
		<comments>http://laconsigna.wordpress.com/2011/11/04/matlab-to-pstricks/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 07:10:50 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[Figures]]></category>
		<category><![CDATA[Latex]]></category>
		<category><![CDATA[pstricks]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=309</guid>
		<description><![CDATA[So, I&#8217;ve been trying to include more good looking figures into . I came across an script to convert from MATLAB to pstricks. However, it looks like it is not maintained anymore. However, I made some little changes and fix a bug that I found. So, I want to put it here for anyone who [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=309&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been trying to include more good looking figures into <img src='http://s0.wp.com/latex.php?latex=%5CLaTeX&amp;bg=ffffff&amp;fg=555555&amp;s=0' alt='&#92;LaTeX' title='&#92;LaTeX' class='latex' />. I came across <a href="http://www.mathworks.com/matlabcentral/fileexchange/25298-fig2texps-export-matlab-figure-to-latex" target="_blank">an script</a> to convert from MATLAB to pstricks. However, it looks like it is not maintained anymore.</p>
<p>However, I made some little changes and fix a bug that I found. So, I want to put it here for anyone who is interested in use it.</p>
<p>The changes from the original:</p>
<ul>
<li>The standalone file generation uses the <code>standalone</code> package, so (in theory) can compile faster. Because, for some strange reason, when I include these files into any document it takes forever to compile.</li>
<li>Now, the script can set any option from the options data structure (see the file to understand what I&#8217;m saying) individually, instead of passing the whole thing.</li>
<li>I fix a bug for data points outside of the axes not appearing.</li>
</ul>
<p>The script is really good, although it has some limitations. Still, I will try to keep this entry up to date if I made some changes to the file.</p>
<p>So the script is here: <a href="http://pastebin.com/xK6KxxBT" target="_blank">fig2texps</a>. To use the script easily call</p>
<p><pre class="brush: matlabkey;">
h = figure; % a handle for the figure
plot(...);  % your figure here
fig2texps(h,'file.tex'); % basic invocation
</pre></p>
<p>To check all the options you can set see the <code>globals</code> struct in line 187.</p>
<p>Hope that helps&#8230; <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<p><strong>Updates:</strong></p>
<p>(07.11.11) I found one bug, if the legend is outside of the figure the labels were place improperly. I hope it is fixed now.</p>
<p>(16.11.11) Fix bug when lines are out of the axis box. If two points were above or below the axis a line was drawn. Now, it is not.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=309&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/11/04/matlab-to-pstricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
		<item>
		<title>Decimal alignment in LaTex tables</title>
		<link>http://laconsigna.wordpress.com/2011/10/11/decimal-alignment-in-latex-tables/</link>
		<comments>http://laconsigna.wordpress.com/2011/10/11/decimal-alignment-in-latex-tables/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 06:07:40 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Explanations]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Writing]]></category>
		<category><![CDATA[Alignment]]></category>
		<category><![CDATA[Decimal point]]></category>
		<category><![CDATA[Latex]]></category>
		<category><![CDATA[Tables]]></category>
		<category><![CDATA[Writing tips]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=302</guid>
		<description><![CDATA[So, I always look for this when I need it. However, I always keep forgetting it. So I decide to put it here for a little reminder. Have you tried to align decimal in LaTex before? Did you do like this: Have you try to type a lot of numbers using this notation? Painful, isn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=302&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, I always look for this when I need it. However, I always keep forgetting it. So I decide to put it here for a little reminder.</p>
<p>Have you tried to align decimal in LaTex before? Did you do like this:</p>
<p><pre class="brush: latex;">
\begin{tabular}{r@{.}l}
  Heading\\
  3&amp;14159\\
  16&amp;2\\
  123&amp;456\\
\end{tabular}
</pre></p>
<p>Have you try to type a lot of numbers using this notation? Painful, isn&#8217;t it? Is there an easier way?, you may ask. Yes there is, <em>dcolumn</em> to the rescue! The package <em><a href="http://users.aims.ac.za/~kcolville/dcolumn.pdf" target="_blank">dcolumn</a></em> can save you a lot of typing time. The way to use it is really simple.</p>
<p><pre class="brush: latex; highlight: [3];">
\usepackage{dcolumn}
\begin{tabular}{D{.}{.}{3.5}}
  \multicolumn{1}{c}{Heading}\\
  3&amp;14159\\
  16&amp;2\\
  123&amp;456\\
\end{tabular}
</pre></p>
<p>Notice that in this example you need to use <code>\multicolumn</code> in the heading of that column. Nevertheless, <em>dcolumn</em> has a big notation, but you can replace it by a new definition using the <code>\newcolumntype</code> command. Then you would have something like this:</p>
<p><pre class="brush: latex; highlight: [2];">
\usepackage{dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{tabular}{d{3.5}}
  \multicolumn{1}{c}{Heading}\\
  3&amp;14159\\
  16&amp;2\\
  123&amp;456\\
\end{tabular}
</pre></p>
<p>Hope this helps! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=302&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/10/11/decimal-alignment-in-latex-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
		<item>
		<title>Remove white space from figures in MATLAB</title>
		<link>http://laconsigna.wordpress.com/2011/08/17/remove-white-space-from-figures-in-matlab/</link>
		<comments>http://laconsigna.wordpress.com/2011/08/17/remove-white-space-from-figures-in-matlab/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 12:05:21 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Crop]]></category>
		<category><![CDATA[Figures]]></category>
		<category><![CDATA[Tight Borders]]></category>
		<category><![CDATA[White space]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=293</guid>
		<description><![CDATA[Today I was struggling again with those annoying white spaces around the figures in MATLAB when you convert the figure to EPS, TIFF, PNG, JPEG or any other format. After some time, I discover the LooseInset property. This command will remove the white spaces and tight  the image borders. So, this will make the process [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=293&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was struggling again with those annoying white spaces around the figures in MATLAB when you convert the figure to EPS, TIFF, PNG, JPEG or any other format. After some time, I discover the LooseInset property. This command will remove the white spaces and tight  the image borders.</p>
<p><pre class="brush: matlabkey;">

set(gca,'LooseInset',get(gca,'TightInset'))

</pre></p>
<p>So, this will make the process of<a href="http://laconsigna.wordpress.com/2010/07/09/exporting-from-matlab-to-eps/"> creating EPS figures in MATLAB</a> easier. Sadly, <strong>it only work for square figures</strong>.</p>
<p>Hope that helps. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=293&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/08/17/remove-white-space-from-figures-in-matlab/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
		<item>
		<title>Compiling Poppler on Windows</title>
		<link>http://laconsigna.wordpress.com/2011/07/14/compiling-poppler-on-windows/</link>
		<comments>http://laconsigna.wordpress.com/2011/07/14/compiling-poppler-on-windows/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 06:33:23 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Poppler]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=282</guid>
		<description><![CDATA[I&#8217;ve been struggling trying to install Poppler under Windows, and there is no much information out there. And the few people who claim that works on Windows don&#8217;t say how they did it. Thus, today I will try to guide you on how to make Poppler works on Windows with QT. The goal of this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=282&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://poppler.freedesktop.org/"><img class="alignleft size-full wp-image-284" title="poppler" src="http://laconsigna.files.wordpress.com/2011/07/logo.png?w=600" alt="poppler"   /></a>I&#8217;ve been struggling trying to install <em><a href="http://poppler.freedesktop.org/" target="_blank">Poppler</a></em> under Windows, and there is <a href="http://freedesktop.org/wiki/Software/poppler" target="_blank">no much information</a> out there. And the few people who claim that works on Windows don&#8217;t say how they did it.</p>
<p>Thus, today I will try to guide you on how to make <em>Poppler</em> works on Windows with <em>QT</em>. The goal of this tutorial is to compile the <code>poppler_qt4viewer</code> demo.</p>
<h2>The things you will need</h2>
<p>Ok, let&#8217;s begin the journey. Before starting you need to download some libraries</p>
<ul>
<li><a href="http://qt.nokia.com/downloads/" target="_blank">QT</a> (4.7.4 source: <a href="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip" target="_blank">zip</a>, <a href="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz" target="_blank">tar.gz</a>)</li>
<li><a href="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype-dev_2.4.2-1_win32.zip" target="_blank">freetype </a></li>
<li><a href="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo-dev_1.10.2-1_win32.zip" target="_blank">cairo</a></li>
<li><a href="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib-dev_1.2.5-2_win32.zip" target="_blank">zlib</a></li>
<li><a href="http://code.google.com/p/openjpeg/downloads/detail?name=openjpeg_v1_4_sources_r697.tgz&amp;can=2&amp;q=" target="_blank">Openjpeg</a></li>
</ul>
<p>You will need <a href="http://qt.nokia.com/downloads/" target="_blank">QT</a>, at the time I&#8217;m writing the latest version is 4.7.4 (source <a href="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip" target="_blank">zip</a>, <a href="http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz" target="_blank">tar.gz</a>). I will recommend you to download the source because it gave me some problems when I downloaded the binaries. Then you need the <em>freetype</em>, <em>cairo</em>, and <em>zlib</em>. However, those are not that easy to find in Windows. So, you can download them from any site that maintains a build like <a href="http://www.gtk.org/download/win32.php" target="_blank">GTK+</a> or <a href="http://inkscape.modevia.com/win32libs/" target="_blank">Inkscape</a>. I got mine from the <a href="http://www.gtk.org/download/win32.php" target="_blank">GTK+ site</a> and used the developer version of them. You can use, however, the version of your choice. And finally the other library we need is <a href="http://code.google.com/p/openjpeg/" target="_blank">openjpeg</a>, and you can download the <a href="http://code.google.com/p/openjpeg/downloads/detail?name=openjpeg_v1_4_sources_r697.tgz&amp;can=2&amp;q=" target="_blank">source code</a> and build it from there.</p>
<p>Now that you have the libraries, you will need the tools to build them. So go and set Visual Studio or a compiler for Windows, and you will also need <a href="http://www.cmake.org/" target="_blank">CMake</a>.</p>
<h2>Building QT</h2>
<p>Before getting into <em>Poppler</em> or other libraries, you will need to build QT. I prefer to build it instead of downloading the binaries, because the compiled version didn&#8217;t work for me <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  . There is a detail instruction set in <a href="/qt/qt-4.7.3/doc/html/install-win.html" target="_blank">here</a>. So I will give you the short story.</p>
<ol>
<li>First unzip the sources into your hard drive, for here on I will call this path <code>$QT_PATH=c:\QT</code>.</li>
<li>Then you need to add the path to the environment variables. Go to <em>My Computer Properties,</em> in the <em>Advanced</em> Tab search for the <em>Environment Variables</em>. Then add to the <code>PATH</code> variable the path to the bin folder of your extracted QT files (<code>$QT_PATH\bin</code>).</li>
<li>Now open a console from Visual Studio, and then go to the <code>$QT_PATH</code> and execute <code>configure</code> and then <code>nmake</code>.<br />
<pre class="brush: bash;">
cd $QT_PATH
configure
nmake
</pre></p>
<p>If you have any problem in this part check the <a href="http://doc.qt.nokia.com/latest/install-win.html" target="_blank">installation page.</a></li>
</ol>
<h2>Preparing the environment</h2>
<p>After you get all the libraries (<em>cairo, freetype, zlib</em>, and <em>openjpeg</em>) you need to unzip them into a folder, I will call it <code>$TOOLS</code> from here on.</p>
<p>Then, for example, you will have <code>$TOOLS\cairo-dev_1.10.2-1_win32</code> if you choose the development version of <em>cairo</em> library. And all the other libraries can be in this folder too. We will use them later when compiling <em>Poppler</em>. In my case I used the dev versions of all the libraries, and in order to make it easier I will refer to them as follows</p>
<ul>
<li><code>$CAIRO = $TOOLS\cairo-dev_1.10.2-1_win32</code></li>
<li><code>$FREETYPE = $TOOLS\freetype-dev_2.4.2-1_win32</code></li>
<li><code>$ZLIB = $TOOLS\zlib-dev_1.2.5-2_win32</code></li>
<li><code>$OPENJPEG = $TOOLS\openjpeg_v1_4_sources_r697</code></li>
</ul>
<h2>Building Openjpeg</h2>
<p>Now we will build <em>Openjpeg</em> using CMake. Open CMake GUI and in the source path choose <code>$OPENJPEG</code> path; for the build binaries you need to create a folder, mine is <code>$OPENJPEG\build</code>. Then you just need to press <code>Configure</code>; select your version of Visual Studio and wait for it to end, and then just press it again. It should be no more red rows in the output. If there are, try to solve the problems it mention. After that press <code>Generate</code> and the project should be in <code>$OPENJPEG\build</code> or wherever you put it.</p>
<p>Then open <code>ALL_BUILD</code> project and compile it. The binaries will be in <code>$OPENJPEG\build\bin</code>.</p>
<h2>Building Poppler Library</h2>
<blockquote><p><em>Note</em>: <strong>Different target names for Debug and Release</strong>.<br />
In case you need to give a postfix to the debug and release libraries, e.g., popplerd.lib for debug and poppler.lib for release, you need to add this line to the CMakeList (after the <code>set(CMAKE_MODULE_PATH ... )</code> is OK)</p>
<p><pre class="brush: bash;">
set(CMAKE_DEBUG_POSTFIX d)
</pre></p>
<p>Just change the <code>d</code> for the postfix you want to use, maybe <code>_d</code>.
</p></blockquote>
<p>Now that we have all the prerequisites we are ready to build Poppler. Put the <a href="http://poppler.freedesktop.org/poppler-0.16.7.tar.gz" target="_blank">sources</a> in a folder, I will call it <code>$POPPLER</code>, and create a folder for the build like in the <em>openjpeg</em> step, mine it is in <code>$POPPLER\build</code>.</p>
<p>Now open CMake, and point the source-path to <code>$POPPLER</code> and the build-path to <code>$POPPLER\build</code>, and press <code>Configure</code>. Again, select the Visual Studio of your choice and then wait for it to configure. An error message will appear regarding the <em>freetype</em> library, don&#8217;t worry we are expecting it. You will see a lot of red rows in the output. Look for <code>FREETYPE_INCLUDE_DIR_freetype2</code>, <code>FREETYPE_INCLUDE_DIR_ft2build</code>, <code>FREETYPE_LIBRARY</code> and point them to:</p>
<ul>
<li><strong><code>FREETYPE_INCLUDE_DIR_freetype2</code></strong>: <code>$FREETYPE\include\freetype2</code> <code></code></li>
<li><strong><code>FREETYPE_INCLUDE_DIR_ft2build</code></strong>: <code>$FREETYPE\include</code></li>
<li><code><strong>FREETYPE_LIBRARY</strong>:</code><code>$FREETYPE\lib\freetype.lib</code></li>
</ul>
<p>Then hit <code>Configure</code> again and wait. An error will occur again, and we will need to set the <em>cairo</em> and <em>zlib</em> libraries. Look for the next variables and set them accordingly</p>
<ul>
<li><code><strong>CAIRO_INCLUDE_DIR</strong></code>: <code>$CAIRO\include</code></li>
<li><code><strong>CAIRO_LIBRARY</strong></code>: <code>$CAIRO\lib\cairo.lib</code></li>
<li><code><strong>LIBOPENJPEG_INCLUDE_DIR</strong></code>: <code>$OPENJPEG\libopenjpeg</code></li>
<li><code><strong>LIBOPENJPEG_LIBRARIES</strong></code>: <code>$OPENJPEG\bulid\bin\Release\openjpeg.lib</code> (this can be Release or Debug depends on you)</li>
</ul>
<p>Also, you need to change the <em>zlib</em> variables. If you don&#8217;t see them, mark the <em>Advance</em> option.</p>
<ul>
<li><code><strong>ZLIB_INCLUDE_DIR</strong></code>: <code>$ZLIB\include</code></li>
<li><code><strong>ZLIB_LIBRARY</strong></code>: <code>$ZLIB\lib\zdll.lib</code></li>
</ul>
<p>Take special attention to this variables if you have a LaTex related system in you computer because it will look for that binaries. However, if the include libraries are not there <em>Poppler</em> won&#8217;t compile.</p>
<p>After you change those variables, you need to <strong>disable</strong> the options <code><strong>WITH_Iconv</strong></code>, <code><strong>WITH_PNG</strong></code>, and <code><strong>WITH_GLIB</strong></code>. And then press <code>Configure</code> again, check for no red rows and then press <code>Generate</code>. Go to <code>$POPPLER\build</code> and execute <code>ALL_BUILD</code>, compile and that should be it for the <em>Poppler</em> library.</p>
<h2>Executing the Demo</h2>
<p>If you want to execute the demo, and you didn&#8217;t add everything to your path you will need some libraries in order to run it. The demo will be located at <code>$POPPLER\build\qt4\demos\Debug</code> or <code>Release</code> accordingly to your compiling settings. You will need the following libraries</p>
<ul>
<li><code><strong>poppler-qt4.dll</strong></code>: <code>$POPPLER\build\qt4\src\Debug</code></li>
<li><code><strong>openjpeg.dll</strong></code>: <code>$OPENJPEG\build\bin\Debug</code></li>
<li><code><strong>QtCored4.dll</strong></code>, <code><strong>QtGuid4.dll</strong></code>, <code><strong>QtTestd4.dll</strong></code>, <code><strong>QtXmld4.dll</strong></code>: <code>$QT_PATH\lib</code> (the &#8216;d&#8217; is needed if you are working with Debug version, if it is Release version loose it)</li>
</ul>
<p>If you want to port your demo, you will need to add the msvcpX.dll and msvcrX.dll where X is the number of your compiler (also the debug version of those libraries, the ones that includes the &#8216;d&#8217;), you can find those libraries in your system.</p>
<h2>Fonts problems?</h2>
<p>I encounter some problems with the demo. The application started, it open the PDFs but no fonts appeared. After struggling a little bit I found that I need the <strong>freetype6.dll</strong>, I found that library in my installation of <a href="www.inkscape.org/" target="_blank"><em>Inkscape</em></a>. However, I&#8217;m not sure why the Debug version doesn&#8217;t ask for the library. Nevertheless, if you put that library in your Release version the fonts start appearing.</p>
<h2>Concluding&#8230;</h2>
<p>Up to here I was able to build the <em>Poppler</em> library and run the demo inside. I will explore further to see the capabilities of the library and how can I incorporate it into my projects. I hope this help you, so you won&#8217;t waste your time trying to do things that, now that I know how to do them, look easy but are not when there is not enough documentation around.</p>
<p>It is hard at the beginning but if you struggle long enough it becomes easier.  <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=282&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/07/14/compiling-poppler-on-windows/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>

		<media:content url="http://laconsigna.files.wordpress.com/2011/07/logo.png" medium="image">
			<media:title type="html">poppler</media:title>
		</media:content>
	</item>
		<item>
		<title>Wine version mismatch error</title>
		<link>http://laconsigna.wordpress.com/2011/07/02/wine-version-mismatch-error/</link>
		<comments>http://laconsigna.wordpress.com/2011/07/02/wine-version-mismatch-error/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 10:40:01 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Version Mismatch]]></category>
		<category><![CDATA[Wine]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=278</guid>
		<description><![CDATA[I just update wine while running a couple of programs, and suddenly this error appeared: wine client error:0: version mismatch &#60;version1&#62;/&#60;version2&#62;. Your wineserver binary was not upgraded correctly, or you have an older one somewhere in your PATH. Or maybe the wrong wineserver is still running? It seams that wine is complaining because the binaries [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=278&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="winehq_logo_glass_break" src="http://laconsigna.files.wordpress.com/2011/07/winehq_logo_glass_break.png?w=100&#038;h=157" alt="" width="100" height="157" />I just update wine while running a couple of programs, and suddenly this error appeared:</p>
<blockquote><p>wine client error:0: version mismatch &lt;version1&gt;/&lt;version2&gt;.<br />
Your wineserver binary was not upgraded correctly,<br />
or you have an older one somewhere in your PATH.<br />
Or maybe the wrong wineserver is still running?</p></blockquote>
<p>It seams that wine is complaining because the binaries that are currently running does not match with the new ones installed. So, you can have only one version of wineserver running at the same time. To solve the problem you just need to kill the old wine and that&#8217;s it. You can achieve this using this commands</p>
<p><pre class="brush: bash;">
pkill wine
pkill exe
</pre></p>
<p>You can check that the process is really dead with</p>
<p><pre class="brush: bash;">
pstree
</pre></p>
<p>Hope that helps if you get the same error <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=278&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/07/02/wine-version-mismatch-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>

		<media:content url="http://laconsigna.files.wordpress.com/2011/07/winehq_logo_glass_break.png" medium="image">
			<media:title type="html">winehq_logo_glass_break</media:title>
		</media:content>
	</item>
		<item>
		<title>1D Histogram on OpenCV</title>
		<link>http://laconsigna.wordpress.com/2011/04/29/1d-histogram-on-opencv/</link>
		<comments>http://laconsigna.wordpress.com/2011/04/29/1d-histogram-on-opencv/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 12:46:21 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Image Processing]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[1D Histogram]]></category>
		<category><![CDATA[Histogram]]></category>
		<category><![CDATA[OpenCV]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=265</guid>
		<description><![CDATA[I started working on OpenCV this week, and it had been quite a journey. I started with some easy programs. However, there is a new (at least for me is new) version of OpenCV with wrappers for C++. Therefore, the examples in the web, most of the time, do not work as they are. So, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=265&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-272" title="Histogram OpenCV" src="http://laconsigna.files.wordpress.com/2011/04/result.png?w=300&#038;h=223" alt="Histogram OpenCV" width="300" height="223" /><br />
I started working on OpenCV this week, and it had been quite a journey.</p>
<p>I started with some easy programs. However, there is a new (at least for me is new) version of OpenCV with wrappers for C++. Therefore, the examples in the web, most of the time, do not work as they are.</p>
<p>So, today I will show you some of the work I&#8217;ve done deciphering the examples that work with the C code for the new wrappers.</p>
<p>OK, lets see. I wanted to do a simple histogram visualization of an image. But, all the examples in the web deal with two dimensional histograms, or with the old syntax. After checking a couple of webs I came up with a solution inspired by this <a href="http://www.aishack.in/2010/07/drawing-histograms-in-opencv/" target="_blank">post</a>.</p>
<p>The idea is the same, but I change the functionality to work with OpenCV v2.2.</p>
<p>First, you need to create the histogram options, I think is really annoying, but it gives you more control over your final histogram.</p>
<p><pre class="brush: cpp;">
  int nbins = 256; // lets hold 256 levels
  int hsize[] = { nbins }; // just one dimension
  float range[] = { 0, 255 };
  const float *ranges[] = { range };
  int chnls[] = {0};
</pre></p>
<p>with this code, you create only one dimensional histogram with 256 bins in the range of 0 to 255, and you specify to work with the channel 0 (the only channel). If you need more dimensions just add them in the <code>hsize</code> and <code>ranges</code> variables. If you see further, the histogram computation is designed to work with several dimensions, that&#8217;s why we need to pass arrays to it.</p>
<p>Then you just need to compute the histogram using</p>
<p><pre class="brush: cpp;">
&lt;pre&gt;  calcHist(&amp;colors[0], 1, chnls, Mat(), hist,1,hsize,ranges);&lt;/pre&gt;
</pre></p>
<p>Note that the histogram image <code>hist</code> must be a <code>MatND</code> or a <code>SparceMat</code>. Then to render the histogram just compute the rectangles for each bin using the <code>fillConvexPoly</code> function. The full code looks like this. You can download the <a href="http://laconsigna.files.wordpress.com/2011/04/histogram.pdf">files here</a>, please <strong>change the extension to rar</strong> to use them. It contains a CMakeLists to build it using CMake.</p>
<p>HTH <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> , I hope to be posting more on this topics soon.</p>
<p><pre class="brush: cpp;">
#include &quot;opencv2/highgui/highgui.hpp&quot;
#include &quot;opencv2/imgproc/imgproc.hpp&quot;
#include &lt;iostream&gt;

using namespace cv;
using namespace std;

Mat imHist(Mat hist, float scaleX=1, float scaleY=1){
  double maxVal=0;
  minMaxLoc(hist, 0, &amp;maxVal, 0, 0);
  int rows = 64; //default height size
  int cols = hist.rows; //get the width size from the histogram
  Mat histImg = Mat::zeros(rows*scaleX, cols*scaleY, CV_8UC3);
  //for each bin
  for(int i=0;i&lt;cols-1;i++) {
    float histValue = hist.at&lt;float&gt;(i,0);
    float nextValue = hist.at&lt;float&gt;(i+1,0);
    Point pt1 = Point(i*scaleX, rows*scaleY);
    Point pt2 = Point(i*scaleX+scaleX, rows*scaleY);
    Point pt3 = Point(i*scaleX+scaleX, (rows-nextValue*rows/maxVal)*scaleY);
    Point pt4 = Point(i*scaleX, (rows-nextValue*rows/maxVal)*scaleY);

    int numPts = 5;
    Point pts[] = {pt1, pt2, pt3, pt4, pt1};

    fillConvexPoly(histImg, pts, numPts, Scalar(255,255,255));
  }
  return histImg;
}

int main( int argc, char** argv ) {
  // check for supplied argument
  if( argc &lt; 2 ) {
    cout &lt;&lt; &quot;Usage: loadimg &lt;filename&gt;\n&quot; &lt;&lt; endl;
    return 1;
  }

  // load the image, load the image in grayscale
  Mat img = imread( argv[1], CV_LOAD_IMAGE_COLOR );

  // always check
  if( img.data == NULL ) {
    cout &lt;&lt; &quot;Cannot load file &quot; &lt;&lt; argv[1] &lt;&lt; endl;
    return 1;
  }

  //Hold the histogram
  MatND hist;
  Mat histImg;
  int nbins = 256; // lets hold 256 levels
  int hsize[] = { nbins }; // just one dimension
  float range[] = { 0, 255 };
  const float *ranges[] = { range };
  int chnls[] = {0};

  // create colors channels
  vector&lt;Mat&gt; colors;
  split(img, colors);

  // compute for all colors
  calcHist(&amp;colors[0], 1, chnls, Mat(), hist,1,hsize,ranges);
  histImg = imHist(hist,3,3);
  imshow(&quot;Blue&quot;,histImg);

  calcHist(&amp;colors[1], 1, chnls, Mat(), hist,1,hsize,ranges);
  histImg = imHist(hist,3,3);
  imshow(&quot;Green&quot;,histImg);

  calcHist(&amp;colors[2], 1, chnls, Mat(), hist,1,hsize,ranges);
  histImg = imHist(hist,3,3);
  imshow(&quot;Red&quot;,histImg);

  // show image
  imshow(&quot;Image&quot;, img);

  // wait until user press a key
  waitKey(0);

  // no need to release the memory, Mat do it for you
  return 0;
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=265&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/04/29/1d-histogram-on-opencv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>

		<media:content url="http://laconsigna.files.wordpress.com/2011/04/result.png?w=300" medium="image">
			<media:title type="html">Histogram OpenCV</media:title>
		</media:content>
	</item>
		<item>
		<title>Birth of a word</title>
		<link>http://laconsigna.wordpress.com/2011/03/11/birth-of-a-word/</link>
		<comments>http://laconsigna.wordpress.com/2011/03/11/birth-of-a-word/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 05:34:19 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Image Processing]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Thougth]]></category>
		<category><![CDATA[Speech Recognition]]></category>
		<category><![CDATA[Structures]]></category>
		<category><![CDATA[TED]]></category>
		<category><![CDATA[Words]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=262</guid>
		<description><![CDATA[When several disciplines are merged together, great things could happen. It is not only the context and frequencies of word repetition, for a new word to be learned by a kid, but all the things that can be unveiled from this work. A lot of anthropologist  and psychologist will have a lot of to play [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=262&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><object width="446" height="326"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param> <param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/DebRoy_2011-medium.flv&su=http://images.ted.com/images/ted/tedindex/embed-posters/DebRoy-2011.embed_thumbnail.jpg&vw=432&vh=240&ap=0&ti=1092&introDuration=15330&adDuration=4000&postAdDuration=830&adKeys=talk=deb_roy_the_birth_of_a_word;year=2011;theme=a_taste_of_ted2011;theme=new_on_ted_com;theme=how_we_learn;theme=words_about_words;event=TED2011;&preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/DebRoy_2011-medium.flv&su=http://images.ted.com/images/ted/tedindex/embed-posters/DebRoy-2011.embed_thumbnail.jpg&vw=432&vh=240&ap=0&ti=1092&introDuration=15330&adDuration=4000&postAdDuration=830&adKeys=talk=deb_roy_the_birth_of_a_word;year=2011;theme=a_taste_of_ted2011;theme=new_on_ted_com;theme=how_we_learn;theme=words_about_words;event=TED2011;"></embed></object></p>
<p>When several disciplines are merged together, great things could happen. It is not only the context and frequencies of word repetition, for a new word to be learned by a kid, but all the things that can be unveiled from this work. A lot of anthropologist  and psychologist will have a lot of to play with, if this technology can be scalable.</p>
<p>I just glad to see what people can do just with speech recognition, image analysis, and semantic analysis. You can mine and learn, not just words, but behavior. We can learn things about ourselves that we don&#8217;t even suspect.</p>
<p>I think that the limit is our imagination, on how we mix everything that is out there. The problem will be how to reach all that knowledge and being able to process it in a coherent way.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=262&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/03/11/birth-of-a-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
		<item>
		<title>Missing Effects Menu Inkscape</title>
		<link>http://laconsigna.wordpress.com/2011/03/07/missing-effects-menu-inkscape/</link>
		<comments>http://laconsigna.wordpress.com/2011/03/07/missing-effects-menu-inkscape/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 07:27:20 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Effect Menu]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[Interpolate]]></category>
		<category><![CDATA[Problems]]></category>
		<category><![CDATA[Solutions]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=259</guid>
		<description><![CDATA[I was trying to do an interpolate operation, and for my surprise there is no &#8220;Effects&#8221; menu, as the tutorial (ver. 0.48) and the Inkscape  page state. However, after looking around for a while I found the &#8220;Interpolate&#8221; effect in other place. Go to Extensions -&#62; Generate from Path -&#62; Interpolate I didn&#8217;t use the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=259&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was trying to do an interpolate operation, and for my surprise there is no &#8220;Effects&#8221; menu, as the tutorial (ver. 0.48) and the Inkscape  page state.</p>
<p>However, after looking around for a while I found the &#8220;Interpolate&#8221; effect in other place.</p>
<p>Go to <strong><code>Extensions -&gt; Generate from Path -&gt; Interpolate</code></strong></p>
<p>I didn&#8217;t use the &#8220;Effects&#8221; menu before, so I don&#8217;t know if all of them are moved to the &#8220;Extensions&#8221; menu. However, now you know where to start looking for.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=259&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/03/07/missing-effects-menu-inkscape/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
		<item>
		<title>TEDxCaltech: Quantum Computing</title>
		<link>http://laconsigna.wordpress.com/2011/02/28/tedxcaltech-quantum-computing/</link>
		<comments>http://laconsigna.wordpress.com/2011/02/28/tedxcaltech-quantum-computing/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 05:54:07 +0000</pubDate>
		<dc:creator>adin</dc:creator>
				<category><![CDATA[Explanations]]></category>
		<category><![CDATA[Thougth]]></category>
		<category><![CDATA[QC]]></category>
		<category><![CDATA[Quantum Computing]]></category>
		<category><![CDATA[Scott Aaronson]]></category>
		<category><![CDATA[TED]]></category>
		<category><![CDATA[TEDxCaltech]]></category>

		<guid isPermaLink="false">http://laconsigna.wordpress.com/?p=254</guid>
		<description><![CDATA[An awesome talk from Scott Aaronson at the Caltech TED event. He wrote about it here. At the end, cool talk&#8230; cool message&#8230; I liked it..<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=254&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://laconsigna.wordpress.com/2011/02/28/tedxcaltech-quantum-computing/"><img src="http://img.youtube.com/vi/SczraSQE3MY/2.jpg" alt="" /></a></span>
<p>An awesome talk from Scott Aaronson at the Caltech TED event.</p>
<p>He wrote about it <a href="http://www.scottaaronson.com/blog/?p=543">here</a>.</p>
<p>At the end, cool talk&#8230; cool message&#8230; I liked it.. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/laconsigna.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/laconsigna.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/laconsigna.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/laconsigna.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/laconsigna.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/laconsigna.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/laconsigna.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/laconsigna.wordpress.com/254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=laconsigna.wordpress.com&amp;blog=3445220&amp;post=254&amp;subd=laconsigna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://laconsigna.wordpress.com/2011/02/28/tedxcaltech-quantum-computing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3b5849a92110cd21391b45d82d2a11f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">adin</media:title>
		</media:content>
	</item>
	</channel>
</rss>
