I am Charmie

メモとログ

2014-08-01から1ヶ月間の記事一覧

ImageMagick: align images

convert function with append option aligns multiple images either horizontally or vertically. convert +append does horizontally while convert -append vertically. [code lang="bash"] convert +append img1.jpg img2.jpg ... imgAlignHorizontally…

VXL installation on ubuntu 14.04

VXL is a C++ library for computer vision researches. The core libraries in VXL are: vnl for numerical algorithms vil for image handling vgl for geometry etc. VXL can be installed via package manager as [code lang="bash"] sudo apt-get insta…

C++: give std::vector as array

There exist several ways to give a std::vector as an array. Suppose we have a vector std::vector vec. The ways are &vec[0] &vec.front() vec.data() supported by C++11 The following code should output as print integer array: 0,1,2,3,4, print…

CImg: hello world

I implemented CImg hello world that loads an image, display on a CImg window, and save it. The complete code is available on my github. [code lang="cpp"] include <iostream> include <string> include <CImg.h> int main() { std::cout << "run CImg hello world..." << std</cimg.h></string></iostream>…

Blitz++: some sample code

I implemented some functions those are explained in Blitz++ documentation. The code is on my github.

Eigen: select columns with N largest norm 2

PTAM/Build/Linux/VideoSource_Linux_OpenCV.ccThis post is to measure the computation time of the previous post, in which I posted a C++ code using Eigen to select columns with N largest norm. My code is available here. Suppose we define a f…

Eigen: select columns with N largest norm

The following code selects columns with N largest norm. The output should be All data and its norm: data[0] = ( 68.0375 -21.1234) norm = 71.2412 data[1] = (56.6198 59.688) norm = 82.2707 data[2] = ( 82.3295 -60.4897) norm = 102.162 data[3]…

C++: lower bound and upper bound of std::vector

lower bound and upper bound of a std::vector can be found by functions lower_bound and upper_bound. The following code finds lower bound and upper bound of a std::vector data. The output should be Raw data: 0 3 7 2 9 1 5 4 8 3 1 2 Sorted d…

C++: initialize std::vector

The following code initializes 1 and 2 dimensional std::vector with its size and initial value. The output should be declare 1 dimensional vector of size 4 with initial value 3 generated vector is size 4 vector: vec[0] = 3 vec[1] = 3 vec[2…

C++ function pointer

[sourcecode language="cpp"] template <typename ValueType> struct funcPtr { typedef ValueType (*func)(const ValueType, const ValueType); }; template <typename ValueType> ValueType add( const ValueType a, const ValueType b ) { return a+b; } template <typename ValueType> ValueType sub( const ValueType</typename></typename></typename>…

Blitz++: documentation

./configure make pdfevince ./doc/blitz.pdf

Blitz++ installation on Ubuntu 14.04

Blitz++ is a c++ template library for array manipulation. I'm planning to use this library for some tensor computation. Fortunately, we can install the library via Ubuntu package manager as [code lang="bash"] sudo apt-get install libblitz-…

github: upload an empty directory

It's technically impossible to commit an empty directory to github because github only manages files. However, there exists a practical solution that stores a .gitignore file inside a directory and commit the .gitignore file so that the di…

github: delete a previous commit

suppose we would like to cancel N commits [code lang="bash"] git reset --hard HEAD~N git push origin -f [/code] ,where N is the number of revert. Note that this commands may be wrong. I'll check how git reset works and then put detailed in…

github: create a new repository

so far I cannot create a new repository from terminal... So, I first create a new repository via github web GUI. and then [code lang="bash"] git clone URL git add FILES git commit -m "MESSAGE" git push origin master [/code]

CodeSynthesis XSD installation 2

With Ubuntu package manager, we can install both CodeSynthesis XSD and Xerces-C as [code lang="bash"] sudo apt-get install libxerces-c-dev sudo apt-get install xsdcxx [/code] To generate a class, the command xsdcxx executes code synthesis …

桐光学園バスケットボール部OB会ホームページ

タイトル通り桐光学園バスケットボール部OB会のホームページを作成しました.現時点で以下のコンテンツを載せていますが,今後中身の変更が行われる可能性はあります. OB会SNSへの登録OB会イベント日程桐光学園バスケ部の試合予定及び結果桐光学園バスケ部…

ceres solver 1.9.0 compilation error related to Eigen with gcc > 4.8.0

ceres solver 1.9.0 compilation fails with gcc > 4.8.0. The error happens at line 505 in Eigen/src/Cholesky/LDLT.h and the error is typedef 'Scalar' locally defined but not used [-Werror=unused-local-typedefs]A solution is just to comment t…

mlpack compilation error related to LAPACK

mlpack compilation fails when LAPACK is not found by cmake. One solutions is to enable mlpack's CMakeLists.txt to find LAPACK. Namely, the solution is to add FindLAPACK.cmake in the directory mlpack-1.0.9/CMake so that cmake can find LAPAC…