I am Charmie

メモとログ

2011-01-01から1年間の記事一覧

pdflatexとplatexの自動切り替え

プレアンブルで以下のように記述すると,texのソース中でpdflatexかplatexかの判別が出来る. \ifx\pdfoutput\undefined \usepackage{mediabb} \usepackage{graphicx} \else \usepackage[pdftex]{graphicx} %pdflatex \fi

日本語latexでpdfファイルを画像ファイルとして読み込む

日本語LaTeX(w32tex)のコマンドplatexでpdfを画像としてインクルードしたい.PDFファイルに限らず,BMP,JPEG, PNGファイルをincludegraphics コマンドで読み込む時は,バウンディングボックスの設定を指定しなければならないそうだ.指定方法は [bb=0 0 横…

styleファイルの追加

styファイルの取得 以下のどちらかの方法でstyファイルを取得する. styファイルのダウンロード webで検索してダウンロードするだけ. styファイルの生成 CTAN等からinsファイルとdtxファイルをダウンロード. 以下のコマンドでinsファイルを処理 platex ***…

PCLでPLYファイルを表示

pcl::PointCloud::Ptr ptrCloud (new pcl::PointCloud); std::string file_name = "./bunny/reconstruction/bun_zipper.ply"; pcl::io::loadPLYFile(file_name, *ptrCloud); pcl::visualization::CloudViewer viewer("Point Cloud Viewer"); viewer.showClou…

Point Cloud Library (PCL)

Point Cloud Library (PCL)のインストールとセットアップ for Windows.1. PCLのインストールPCLのセットアップは2つの方法がある.プレビルド(あらかじめビルド)されたものをインストールするか,それとも自分でソースからコンパイルするか.プレビルド版は…

BV norm

BV norm is $latex l{1}$-norm of the gradient of its argument as $latex \Vert u \Vert{BV} = \Vert \nabla u \Vert_{1}$

im2col and col2im

Function im2col formats image blocks to columns and col2im does the inverse operation. When you independently apply some operation on each image patches and then merge the patches, these functions are useful. The code is like img = im2doub…

levmar with Visual Studio 2010

levmarのコンパイルには2つのステップが必要: LAPACKのインストールとlevmarのコンパイル.LAPACKではなくCLAPACKを使ってlevmarを使ってみる(LAPACKを自前でセットアップするにはfortranのコンパイラやら何やらが必要みたいだけど,調べてて頭が痛くなって…

Using levmar with Visual Studio 2010

levmar compilation requires two steps: LAPACK installation and levmar compilation. Here, I use CLAPACK instead of LAPACK for ease of setup but any types of CLAPACK might be fine. CLAPACK installation There are several options to build CLAP…

Normalize the columns/rows of a given matrix

A = randn(m, n); % for columns A = A ./ repmat(sqrt(sum(A.^2, 1)),m,1); % for rows A = A ./ repmat(sqrt(sum(A.^2, 2)),1,n);

Algorithmic package

If you want to number the lines, just add [1] option as \begin{algorithmic}[1] ... \end{algorithmic}

Algorithm in LaTeX

With a package algorithms, you can write algorithm in LaTeX. README file says that The "algorithms" bundle provides two environments, "algorithmic" and "algorithm", which are designed to be used together but may be used separately. The "al…

Number sets in LaTeX

To write number sets such as real numbers ($latex \mathbb{R}$), we need to use additional package either amssymb or amsfonts. In preamble, just type \usepackage{amssymb} or \usepackage{amsfonts}. Then, we can use the command mathbb like \m…

Basis Pursuit and Matching Pursuit

Suppose we observe a signal $latex x$. With a dictionary $latex D$, the signal $latex x$ is represented by a linear equation as $latex x = D\alpha$. Given the observed signal, our goal is to find the coefficients $latex \alpha$. Assuming $…

OpenGL (GLSL) + Visual Studio 2010 on 64bit

Visual Studio 2010 + OpenGL(GLSL)のセットアップ. 以下で{VC Root}は 32bit C:\Program Files\Microsoft Visual Studio 10\VC 64bit C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A を表すものとする. GLUTのインストール GLUT(OpenGL Utility To…

CurveLabのインストール

現在のバージョンはCurveLab 2.1.2. インストールマニュアル(curvelab.pdf)に従ってインストール. ファイルのダウンロード CurveLab-2.1.2.tar.gz ファイルの解凍 gunzip CurveLab-2.1.2.tar.gz tar xvf CurveLab-2.1.2.tar CurveLabのパスを設定 解凍した…

Wavelabのインストール

現在のバージョンはWavelab850. インストールマニュアルに従ってインストール. zipファイルのダウンロード Wavelab850.zip zipファイルの解凍 ダウンロードしたzipファイルをmatlab toolboxが保存されているフォルダに解凍. MATLAB\toolbox\Wavelab850 Wa…

OpenGL: 光源の設定

光源を利用する.2つの処理が必要.光源そのものに環境光,拡散光,鏡面光があって,それぞれ設定するというのは,何か違和感を感じるなぁ.光源の設定光源を有効にする: glEnable(GL_LIGHTING)をコールする.その後,glEnable(GL_LIGHT$i$)として,i番目の…

OpenGL: ダブルバッファリング

画面全体を一度に描画すると,表示がちらつく事があるらしい(レンダリングの速度が追いつかないから?).ダブル・バッファリングによって画面を2つにわけて,片方を表示している間にもう片方を描画して入れ換える・・・という作業を続けると,ちらつきがなくなる…

OpenGL: アニメーション

"GLでアニメーションをさせる=display関数を複数回呼ぶ"という事らしい.glutMainLoop関数は無限ループだけど,glutDisplayFunc関数はウィンドウを再描画するイベントが発生した時しかコールされないそうだ.そこで,アニメーションのようにdisplay関数を連…

OpenGL: Z buffer

複数の物体を描画する時,(カメラから見た時の)物体の前後関係を考慮する必要がある.初期化 glutInitDisplayMode()にGLUT_DEPTHを追加する描画時glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);...glEnable(GL_DEPTH_TEST);

OpenGL: 立体の描画

2つの処理に分かれている.オブジェクトの設定3次元空間内での位置や,オブジェクトの挙動(色,光の反射,etc.)などを設定する.視点の設定3次元空間を2次元の画像としてレンダリングするために,カメラに関する設定をする.ビューポート: window内で画像を…

OpenGL: window作成

OpenGLでwindowsを作成する.4つの処理に分かれている. glutの初期化glutInit関数をコールする. windowの設定glutCreateWindow関数をコールする. コールバック関数の設定glutDisplayFunc関数をglutDisplayFunc(display)のようにコールする.※ display関数…

OpenGL for Visual Studio 2010

Visual Studio 2010 + OpenGLのセットアップ.1. GLUTのインストールGLUT(OpenGL Utility Toolkit)はOpenGLでプログラムを書くためのツールキット.オリジナルのglutの開発は2001年ぐらいから進んでいなさそうなので,代わりにfreeglutをインストールする.1…

OpenCV 2.2 with Visual Studio 2010

Intel TBB (Threading Building Blocks)のインストールMulti coreを使うためのライブラリ?Download/Stable versionのページから最新のバージョン(tbb30_20110315oss)を選ぶ.http://threadingbuildingblocks.org/file.php?fid=77該当するOSのファイル(tbb3…

GeForce 9600M GT on Windows7

English text is later. 2年近く使っていたノートPCにWindows7を新規インストールしたら,GeForce 9600M GTを認識しなくなった. 試行錯誤の結果,解決. NVidiaのサイトで公開されている最新版のドライバ(270.61)ではなく,古いバージョン(258.96)でインス…

Multiple integral

To write multiple integral in latex, intuitive way is to use \int several times like \begin{equation} \int\int_{S} f(x,y)dxdy \end{equation} This code provides awful spacing between neighboring integral symbols. Alternative way is to use \…

Integral image

Compute an integral image using MatLab. img = im2double(imread('test.bmp')); IntegralImage = cumsum( cumsum(img,1),2); Inside cumsum works along y direction while outside cumsum does along x direction.

Core iの種類

今のところCore i3,i5,i7の3種類.グラフィックチップ搭載一部のモデルはグラフィックチップを搭載しているそうで,そのようなモデルはCPU単体でディスプレイ表示が可能となる.ターボブースト機能(TB機能)一部のコアの電源をOFFにして,残りのコアの動作周…

test

$latex $の間にlatexの式を書くと,数式が書ける. $latex i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>$ test done $latex B_{uv} \in {a,b,c}$