Friday, November 23, 2012

How to read Chinese on Nook 2

Even though I am a Kindle fan, this year nook simple touch is only $49.00 from Target comparing to the regular $99.00. My wife decided to buy me one for fun.

Since nook is not selling in Chinese market officially. The Chinese support is not natively.

1. Download Sigil from: http://code.google.com/p/sigil/
2. Open a .epub file. select "Styles", click the .css file.
3. MOdify the @font-face section from :
@font-face {
font-family:"cnepub";
src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf), url(res:///tt0011m_.ttf);
}
to: 
@font-face {
font-family:"cnepub";
src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf), url(res:///tt0011m_.ttf),
url(res:///system/fonts/DroidSansFallback.ttf);
}
4. Copy the modified .epub file into your nook.
5. Open the file in nook. Click the pages like 5/233, select "text" -> check "Publisher Defaults".
Then you will notice the Chinese characters are showing up!!

Reference webpages:
1. http://www.hi-pda.com/forum/viewthread.php?tid=857877&extra=page%3D1
2. http://www.hi-pda.com/forum/viewthread.php?tid=812236
3. http://www.hi-pda.com/forum/viewthread.php?tid=800133
4. http://www.by-smart.com/forum.php?mod=viewthread&tid=2000

Wednesday, November 21, 2012

Install Emacs key-stroke in VS 2010 professional

Emacs key stroke will save operator's time for leaving keyboard fundamental key positions. This is critical for improving programmers' productivity.

Visual Studio for Emacs users might be a pain at the first glance due to the keystroke differences. This article will list the necessary information of how to utilize Emacs keystrokes in VS2010 Pro.

1. Go webpage: http://visualstudiogallery.msdn.microsoft.com/09dc58c4-6f47-413a-9176-742be7463f92/
2. Click "Download" button
3. The download file will be "EmacsEmulations.vsix"
4. Close Visual Studio 2010 Pro
5. Right click and select "open with" -> "Visual Studio 2010"
6. It should be installed automatically.
7. Re start Visual Studio 2010 Pro
8. Click OK for installation permit.
9. Go to Tools->Options-> Environment->Keyboard; Select "Emacs" from "Apply the following additional keyboard mapping scheme:"

Please pay attention to the webpage in step 1. It also includes keystrokes information you may be interested.

PS: This Emacs extension is NOT applied for VS 2010 Express version.

Friday, October 19, 2012

XCode 4.5.1 linking error with Opencv 2.4.2_1

I always keep my software updated to the latest version. Generally, it works perfectly fine. However, after I upgrade Xcode into 4.5.1 and Opencv to 2.4.2_1 though macports. The simple opencv 2.0 style compile will keep pushing out linking errors.

The solution is the attached image below, switch the selected item from libc++ (LLVM) into libstdc++(GNU C++ standard library)

Hope this is helpful.


Tuesday, October 16, 2012

Read CVML into MATLAB

CVML (CVML- An XML-based Computer Vision Markup Language), which is commonly used in AI community as the manual label format.  which is   which is commonly used in AI community as the manual label format. Popular CAVIAR and other datasets are using this as an standard. The output files will be .xml file, which might not be easy for MATLAB researchers to use. 

CoreLibrary does have a C++ based dataset to read from and write to CVML based .xml files, however, they are still not .mat file as MATLAB users expected. 
In this blog, we will utilize an easy and straight forward way to extract the objects bounding boxes.  All the knowledge are based on blog: http://www.gnebehay.com/?p=5




The first step, please use emacs or any editor you would prefer to copy and paste the following code in a file called: 'cvml_csv.xslt'.


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:variable name="sep" select="' '" />
<xsl:template match="/">
      <xsl:for-each select="dataset/frame">
    <xsl:for-each select="objectlist/object">
        <xsl:value-of select="../../@number"/>
        <xsl:copy-of select="$sep" />
        <xsl:value-of select="@id"/>
        <xsl:copy-of select="$sep" />
        <xsl:value-of select="box/@xc"/>
        <xsl:copy-of select="$sep" />
        <xsl:value-of select="box/@yc"/>
        <xsl:copy-of select="$sep" />
        <xsl:value-of select="box/@w"/>
        <xsl:copy-of select="$sep" />
        <xsl:value-of select="box/@h"/>
        <xsl:value-of select="'&#xA;'"/>
    </xsl:for-each>
      </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

2nd step: Let us assume, you CVML .xml file is called: fwbs1gt.xml. Then type in the following command in your terminal

                 xsltproc cvml_csv.xslt fwbs1gt.xml > fwbs1gt.csv

3rd step: read csv file into matlab, by typing the following command in MATLAB command windows.

                 A = dlmread('fwbs1gt.csv');

4th step: For A, there will be n rows 6 columns. The 1st columns is the frame number. 2nd is the object id within the frame. 3rd to 6th column is the bounding box information. 

Again, this blog is mainly for a record to myself. If you have confusion, please go to blog:  http://www.gnebehay.com/?p=5. The author has done a great work to introduce this whole topic. 
All credit goes to that author. 

prettify