<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pinglin&#039;s blog</title>
	<atom:link href="http://blog.pinglin.idv.tw/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pinglin.idv.tw</link>
	<description>Endless road...</description>
	<lastBuildDate>Wed, 05 Jan 2011 20:26:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>swscaler issue in FFmpeg in OpenCV</title>
		<link>http://blog.pinglin.idv.tw/20101208031323/</link>
		<comments>http://blog.pinglin.idv.tw/20101208031323/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 19:13:23 +0000</pubDate>
		<dc:creator>Pinglin</dc:creator>
				<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[opencv]]></category>

		<guid isPermaLink="false">http://blog.pinglin.idv.tw/?p=378</guid>
		<description><![CDATA[VideoCapture in both OpenCV 2.1 and 2.2 under the platform Ubuntu 10.10 64-bit keeps showing annoying warning messages when it reads some .avi files: [swscaler @ 0x81ac360]No accelerated colorspace conversion found from yuv420p to bgr24 Surprisingly, there are only few people have such a problem after I googled for a while, and no solution as [...]]]></description>
			<content:encoded><![CDATA[<p>VideoCapture in both OpenCV 2.1 and 2.2 under the platform Ubuntu 10.10 64-bit keeps showing annoying warning messages when it reads some .avi files:</p>
<p><span style="color: #000000;">[swscaler @ 0x81ac360]No accelerated colorspace conversion found from yuv420p to bgr24</span></p>
<p>Surprisingly, there are only few people have such a problem after I googled for a while, and no solution as well.</p>
<p>I then traced the code and found that the issue should belong to FFmpeg.<br />
<span id="more-378"></span><br />
The official FFmpeg library seems to be released without libswscale support in Ubuntu&#8230;</p>
<p>Anyway, the warning message can be removed by recompiling the FFmpeg with specifying<br />
<code>--enable-swscale</code>, and according to the <a href="http://ubuntuforums.org/showpost.php?p=9868359&amp;postcount=1289">instruction</a>:</p>
<div class="codecolorer-container bash default Pinglin" style="border:1px solid #9F9F9F;width:550px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-gpl</span> <span style="color: #660033;">--enable-version3</span> <span style="color: #660033;">--enable-nonfree</span> <span style="color: #660033;">--enable-postproc</span> <span style="color: #660033;">--enable-libfaac</span> <span style="color: #660033;">--enable-libopencore-amrnb</span> <span style="color: #660033;">--enable-libopencore-amrwb</span> <span style="color: #660033;">--enable-libtheora</span> <span style="color: #660033;">--enable-libvorbis</span> <span style="color: #660033;">--enable-libx264</span> <span style="color: #660033;">--enable-libxvid</span> <span style="color: #660033;">--enable-x11grab</span> <span style="color: #660033;">--enable-swscale</span></div></td></tr></tbody></table></div>
<p>Also note that <code>--enable-gpl</code> must be assigned since there is a condition in the libswscale/swscale.c source code:</p>
<div class="codecolorer-container cpp default Pinglin" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>2153<br />2154<br />2155<br />2156<br />2157<br />2158<br />2159<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="display:block;background-color:#ffff66"><span style="color: #339900;">#ifdef CONFIG_GPL</span><br /></span>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000; font-style: italic;">/* yuv2bgr */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>srcFormat<span style="color: #000080;">==</span>PIX_FMT_YUV420P <span style="color: #000040;">||</span> srcFormat<span style="color: #000080;">==</span>PIX_FMT_YUV422P<span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;&amp;</span> <span style="color: #008000;">&#40;</span>isBGR<span style="color: #008000;">&#40;</span>dstFormat<span style="color: #008000;">&#41;</span> <span style="color: #000040;">||</span> isRGB<span style="color: #008000;">&#40;</span>dstFormat<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>swScale <span style="color: #000080;">=</span> yuv2rgb_get_func_ptr<span style="color: #008000;">&#40;</span>c<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<span style="display:block;background-color:#ffff66"><span style="color: #339900;">#endif</span></span></div></td></tr></tbody></table></div>
<p>The function yuv2rgb_get_func_ptr is in charge of the yuv420 to bgr24 colorspace conversion I think.</p>
<p><b>05/01/2011</b></p>
<ol>
<li>you should recompile opencv to get the new FFmpeg work.
<li>configure <code>"--enable-shared" and "--enable-pic"</code> in each library if you want to use shared libraries.
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.pinglin.idv.tw/20101208031323/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Graphics vs. Vision</title>
		<link>http://blog.pinglin.idv.tw/20101208022006/</link>
		<comments>http://blog.pinglin.idv.tw/20101208022006/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 18:20:06 +0000</pubDate>
		<dc:creator>Pinglin</dc:creator>
				<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[study]]></category>

		<guid isPermaLink="false">http://blog.pinglin.idv.tw/20101208022006/</guid>
		<description><![CDATA[From Wikipedia: The traditional approach of computer graphics has been used to create a geometric model in 3D and try to reproject it onto a two-dimensional image. Computer vision, conversely, is mostly focused on detecting, grouping, and extracting features (edges, faces, etc.) present in a given picture and then trying to interpret them as three-dimensional [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">From Wikipedia:</p>
<blockquote><p align="justify">The traditional approach of computer graphics has been used to create a geometric model in 3D and try to reproject it onto a two-dimensional image. </p>
</blockquote>
<blockquote><p align="justify">Computer vision, conversely, is mostly focused on detecting, grouping, and extracting features (edges, faces, <i>etc.</i>) present in a given picture and then trying to interpret them as three-dimensional clues.</p>
</blockquote>
<p>So I am more like a vision guy…</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pinglin.idv.tw/20101208022006/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems with OpenCV on Windows 7 64-bit</title>
		<link>http://blog.pinglin.idv.tw/20101122050600/</link>
		<comments>http://blog.pinglin.idv.tw/20101122050600/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 21:06:00 +0000</pubDate>
		<dc:creator>Pinglin</dc:creator>
				<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[opencv]]></category>

		<guid isPermaLink="false">http://blog.pinglin.idv.tw/20101122050528/</guid>
		<description><![CDATA[Recently I tried to install OpenCV 2.1 with pre-built package released on the official website for my Windows 7 64-bit laptop. It turns out that OpevnCV 2.1 doesn’t marry well with 64-bit windows system (after 1 day googling). With VC++ 2010, compiling in debug mode is fine but the runtime kept crashing with some mysterious [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Recently I tried to install OpenCV 2.1 with pre-built package released on the official website for my Windows 7 64-bit laptop. It turns out that OpevnCV 2.1 doesn’t marry well with 64-bit windows system (after 1 day googling). </p>
<p>  <span id="more-371"></span>
<p align="justify">With VC++ 2010, compiling in debug mode is fine but the runtime kept crashing with some mysterious error code. The weird thing is with release mode both compiling and runtime is fine. Then I tried to compile OpenCV 2.1 by myself using VC++ 2010 (by CMake), the compiling process was OK, which gave me a number of *.lib and *.dll files, but it resulted in both modes runtime error. </p>
<p align="justify"><del datetime="2010-12-10T19:27:09+00:00">It might work with MinGW since with ubuntu 10.10 it is fairly smooth.&#160;</del> Let’s see if OpenCV 2.2.0 would fix the issue. </p>
<p align="justify">Currently I would focus on Linux version first.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pinglin.idv.tw/20101122050600/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Space-Filling Curve</title>
		<link>http://blog.pinglin.idv.tw/20101007024948/</link>
		<comments>http://blog.pinglin.idv.tw/20101007024948/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 18:49:48 +0000</pubDate>
		<dc:creator>Pinglin</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[algorithms]]></category>

		<guid isPermaLink="false">http://blog.pinglin.idv.tw/20101007024948/</guid>
		<description><![CDATA[這是我剛剛突然發現一年前存的草稿，當時居然忘了完成它@@！ 到底圖論裡面的碎形可以做什麼用途，一直是我心中的一個疑惑。直到接觸了關於高維資料的資料庫索引(indexing high-dimenional data)演算法，才發現除了碎形可以自身遞回產生神奇的美麗圖案外，一些特定的碎形規則還有一個特性，即是空間填滿(space-filling)。然而，當直接拿碎形來做索引應用時，會遇到許多根本與實作上的困難，前者包括邊界效應(boundary effect)、群集特性(clustering property)等；後者則有資料稀疏(sparsity)、大數(big number)等問題。這些都是我在實作時碰上的難題，其中邊界效應有許多研究特別針對此現象來做改善，這方面我相信已有不錯的解決方案，然其它議題仍有討論的空間。 如果上述這些問題都能克服的話，我相信用碎形所產生的空間填滿曲線(space-filling curve)，是一個很理想的高維資料索引演算法，尤其是當用其作近似最近鄰居搜尋(approximate neariest neibors search)。相較於常見的kd-tree、R-tree、Quad-tree等空間分割演算法，空間填滿曲線是直接將高維資料投影(mapping)進一維空間，於是我們即可利用所有針對一維資料索引所設計的資料結構(例如B+tree)，來完成高維資料的檢索！當然這是很理想的狀況，降維(dimensionality reduction)的過程中，會造成不可避免的資訊流失(information losing)，例如資料原來在高維空間時的拓撲(topology)關係，當投影進低維空間時遭到破壞，因此造成在低維度時的檢索錯誤，上述的邊界效應即是因此而產生。所以相關的前人研究裡，都儘可能地針對降維後所造成的破壞來做彌補，以提高檢索時的準確率。 以下從Wikipedia那邊貼幾個常見的curve，其中Z-curve是最簡單的例子。 於是二維資料到 mapping 進一維空間時就可以用以下的方式來索引： 三維資料的例子，四維以上就無法visualize了: 以下是另外兩個常見的space-filling curve，Hilbert curve有動畫可以示意： Sierpiński curve:]]></description>
			<content:encoded><![CDATA[<p>這是我剛剛突然發現一年前存的草稿，當時居然忘了完成它@@！</p>
<p style="text-align: justify;">到底圖論裡面的碎形可以做什麼用途，一直是我心中的一個疑惑。直到接觸了關於高維資料的資料庫索引(indexing high-dimenional data)演算法，才發現除了碎形可以自身遞回產生神奇的美麗圖案外，一些特定的碎形規則還有一個特性，即是空間填滿(space-filling)。然而，當直接拿碎形來做索引應用時，會遇到許多根本與實作上的困難，前者包括邊界效應(boundary effect)、群集特性(clustering property)等；後者則有資料稀疏(sparsity)、大數(big number)等問題。這些都是我在實作時碰上的難題，其中邊界效應有許多研究特別針對此現象來做改善，這方面我相信已有不錯的解決方案，然其它議題仍有討論的空間。</p>
<p style="text-align: justify;"><span id="more-355"></span>如果上述這些問題都能克服的話，我相信用碎形所產生的空間填滿曲線(space-filling curve)，是一個很理想的高維資料索引演算法，尤其是當用其作近似最近鄰居搜尋(approximate neariest neibors search)。相較於常見的kd-tree、R-tree、Quad-tree等空間分割演算法，空間填滿曲線是直接將高維資料投影(mapping)進一維空間，於是我們即可利用所有針對一維資料索引所設計的資料結構(例如B+tree)，來完成高維資料的檢索！當然這是很理想的狀況，降維(dimensionality reduction)的過程中，會造成不可避免的資訊流失(information losing)，例如資料原來在高維空間時的拓撲(topology)關係，當投影進低維空間時遭到破壞，因此造成在低維度時的檢索錯誤，上述的邊界效應即是因此而產生。所以相關的前人研究裡，都儘可能地針對降維後所造成的破壞來做彌補，以提高檢索時的準確率。</p>
<p>以下從Wikipedia那邊貼幾個常見的curve，其中Z-curve是最簡單的例子。</p>
<p style="text-align: center;"><a rel="lightbox" href="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image.png"><img style="display: inline; border: 0px;" title="image" src="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image_thumb.png" border="0" alt="image" width="404" height="404" /></a></p>
<p>於是二維資料到 mapping 進一維空間時就可以用以下的方式來索引：</p>
<p style="text-align: center;"><a rel="lightbox" href="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image1.png"><img style="display: inline; border: 0px;" title="image" src="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image_thumb1.png" border="0" alt="image" width="404" height="397" /></a></p>
<p>三維資料的例子，四維以上就無法visualize了:</p>
<p><a rel="lightbox" href="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image2.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="image" src="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image_thumb2.png" border="0" alt="image" width="404" height="384" /></a></p>
<p>以下是另外兩個常見的space-filling curve，Hilbert curve有動畫可以示意：</p>
<p style="text-align: center;"><a rel="lightbox" href="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/Hilbert_curve.gif"><img style="display: inline;" title="Hilbert_curve" src="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/Hilbert_curve_thumb.gif" alt="Hilbert_curve" width="400" height="400" /></a></p>
<p>Sierpiński curve:</p>
<p><a rel="lightbox" href="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image3.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border: 0px;" title="image" src="http://blog.pinglin.idv.tw/wp-content/uploads/2010/10/image_thumb3.png" border="0" alt="image" width="404" height="404" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pinglin.idv.tw/20101007024948/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update to WordPress 2.9.2</title>
		<link>http://blog.pinglin.idv.tw/20100417090748/</link>
		<comments>http://blog.pinglin.idv.tw/20100417090748/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 01:07:48 +0000</pubDate>
		<dc:creator>Pinglin</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[web tech]]></category>

		<guid isPermaLink="false">http://blog.pinglin.idv.tw/20100417090748/</guid>
		<description><![CDATA[Finally I have updated my WordPress. The previous one was 2.5.x, and now everything is changed. I need to get used to it again Q__Q Nevertheless, it is amazing that WordPress can automatically upgrade! Apture got a new version too!! Suddenly found that I have almost not blogged for one year&#8230;]]></description>
			<content:encoded><![CDATA[<p>Finally I have updated my WordPress. The previous one was 2.5.x, and now everything is changed.<br />
I need to get used to it again Q__Q<br />
Nevertheless, it is amazing that WordPress can automatically upgrade!<br />
Apture got a new version too!!</p>
<p>Suddenly found that I have almost not blogged for one year&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pinglin.idv.tw/20100417090748/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

