I am Charmie

メモとログ

C++

Xerces-C++ XML Parser installation

Xerces-C++ XML parser is an XML parser for C++. This library is also required for using code synthesis XSD. The library provides instruction for a href="http://xerces.apache.org/xerces-c/install-3.html">installation and build. [sourcecode …

Expat installation

Expat is an XML parser library for C. Expat is required library for using code synthesis XSD. [sourcecode language="bash"] wget downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz tar -xvzf expat-2.1.0.tar.gz mkdir expat…

CodeSynthesis XSD

Here is an instruction how to use XSD with CMake. Following the first solution by Brad Howes, we need to prepare the following CMakeLists.txt as well as FindXercesC.cmake and FindXSD.cmake.

MLPack: generate random data from GMM

[code lang="cpp"] int numGauss = 3; int numDim = 3; int numObs = 1000; mlpack::gmm::GMM<> gmm(numGauss,numDim); arma::mat covar(numDim, numDim); gmm.Weights() = GenerateWeight(numGauss, 1.0/*1; // set j-th gmm's mean and covariance for(int…

Fusion Move implementation in OpenGM

OpenGM has two files, alphaexpansionfusion.hxx and fusion_mover.hxx, both of which seem to implement Fusion Move algorithm. Yes, both of the code in fact implement Fusion Move algorithm but they are different. 1. AlphaExpansionFusionThis w…

script for install OpenGM on Ubuntu

The following script downloads the source code of OpenGM it, and installs it. sudo apt-get -yV install libhdf5-serial-dev wget https://github.com/opengm/opengm/archive/master.zip -O opengm-master.zip unzip opengm-master.zip mkdir opengm-bu…

script for install libDAI on Ubuntu

The following script downloads the source code of libDAI it, and installs it. wget https://github.com/yesimon/libDAI/archive/master.zip -O libdai-master.zip unzip libdai-master.zip mkdir libdai-build cd libdai-build cmake ../libDAI-master …

script for install TinyXML2 on Ubuntu

The following script downloads the source code of TinyXML2, compiles it, and installs it. wget https://github.com/leethomason/tinyxml2/archive/master.zip -O tinyxml2-master.zip # download the source code unzip tinyxml2-master.zip mkdir tin…

Build OpenGM 2.3.1 on Ubuntu

Patch files for IBFS (MaxFlow-IBFS) and GCO were corrected in OpenGM 2.3.1!!

CImg: display image(s)

This code loads an image lena.bmp and shows the original image and its grayscaled one in a window, which shows text "Original image | Grayscale image" on its bar. [code lang="c"] std::string strFile = "lena.bmp"; cimg_library::CImg<unsigned char> img1(st</unsigned>…

CImg: convert an RGB image to a grayscale image

This code loads a image lena.bmp and converts the image to grayscale one. [code lang="c"] std::string strFile = "lena.bmp"; cimg_library::CImg<unsigned char> img1(strFile.c_str()); cimg_library::CImg<unsigned char> img2; int color = _imgInput.spectrum(); // to check th</unsigned></unsigned>…

CImg: open an image file

CImg provides several constructors for cimg_library::CImg type objects. [code lang="c"] std::string strFile = "lena.bmp"; cimg_library::CImg&lt;unsigned char&gt; img1(strFile.c_str()); cimg_library::CImg&lt;unsigned char&gt; img2; img2 = c…

CImg: CMakeLists.txt

CImg is provides as a single header file, however it requires several libraries to use CImg in C++ code. CMakeLists.txt and Makefile in ./CImg-1.5.8_rolling140227/examples tells us which libraries should be set.

Install CImg library on Ubuntu

CImg is a c++ template library for image processing provided as a huge but single header file. sudo apt-get install cimg-dev cimg-doc cimg-examples

a bit modified sample code using QPBO

I started using QPBO, published by Vladimir Kolmogorov, for solving discrete optimization problem. QPBO.h contains a sample code, which I couldn't understand at first moment. Since my colleague told me what the code means, I wrote a bit mo…

Build OpenGM 2.2.1 on Ubuntu

OpenGM is a C++ library for discrete optimization and inference. OpenGM uses several open source codes as external libraries. I compiled it on Ubuntu 12.04. Due to some reasons, I omitted some of the external libraries: CPlex: I spent 2-3 …

Install libDAI on Ubuntu

libDAI for OpenGM. The latest version, which contains CMakeLists.txt, is available on github. The following commands are for older versions. sudo apt-get install libgmp-dev cimg-dev wget http://cs.ru.nl/~jorism/libDAI/libDAI-0.3.1.tar.gz t…

Install CMake 2.8.12.2 from source

There are several ways for CMake installation from source. I tried to install CMake 2.8.12.2 from source using pre-installed CMake 2.8.7 but it failed. #!/bin/bash wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz tar zxvf cmake-2…

CMakeLists.txt for STASM version 4.1.0

STASM is a C++ library for face features detection using Active Shape Model. The version 4.1.0 contains a program, called TASM, that trains ASM given a set of face control points database such as MUCT. The version 4.1.0 lacks CMakeLists.tx…

CurveLab Installation (C++)

User guide of CurveLab explains how to install CurveLab C++. This post is a quick-note for CurveLab C++ installation w/o mex. It requires 2 main steps. 1. FFTW installationDownload FFTW version 2.1.5 from download page. Extract the compres…

mlpack: GMM fitting

mlpack::gmm::Estimate() estimates the probability distribution directly from the given observations, using the given algorithm in the FittingType class to fit the data. The fitting will be performed 'trials' times; from these trials, the m…

mlpack: create Gaussian Mixture Model

mlpack::gmm::GMM creates a Gaussian Mixture Model with different constructors. Create an empty Gaussian Mixture Model, with zero gaussians. [sourcecode language="cpp"] template<typename FittingType = EMFit<>> mlpack::gmm::GMM< FittingType >::GMM() [/sourcecode] Create a</typename>…

mlpack: how to compute Gaussian probability density function

mlpack::gmm::phi() computes univariate/multivariate Gaussian probability density functions. probability of a univariate Gaussian. [sourcecode language="cpp"] double mlpack::gmm::phi( const double x, // Observation. const double mean, // Me…

mlpack installation on Ubuntu 12.04

mlpack is a C++ machine learning library, which is developed by the fundamental algorithmic and statistical tools laboratory (FASTLab) at Georgia Tech. Machine learning methods implemented in mlpack are following: Density Estimation Trees …

ceres-solver

ceres-solver is non-linear least squares problems solver, which contains dense QR and Cholesky factorization for small problems using Eigensparse Cholesky factorization for large sparse problems using SuiteSparse and CXSparsespecialized so…

SuiteSparse library

SuiteSparse contains several packages for sparse non-linear least square systems. As README.txt says, some packages optionally use metis 4.0.1. To use metis, we need to put uncompressed metis directory metis-4.0 in the same directory conta…

install Magick++ on ubuntu

sudo apt-get install libmagick++-dev libmagickcore-dev libmagickwand-dev perlmagick

install mlpack 1.0.1-1 on ubuntu by package manager

mlpack version 1.0.1.1 can be installable with this unofficial ppa. sudo add-apt-repository ppa:sterling/mlpacksudo apt-get updatesudo apt-get install libmlpack-dev libmlpack1 mlpack-bin mlpack-doc

install boost 1.53 on ubuntu by package manager

Official repository supports boost installation. However, its version is 1.48.0 not latest one. Fortunately, I found unofficial repository here. sudo add-apt-repository ppa:apokluda/boost1.53 sudo apt-get update sudo apt-get install libboo…

C++ library and MatLab toolbox for Active Appearance Model

this is a note about free C++ libraries and MatLab toolboxes for Active Appearance Model. C++ libraries: DeMoLib implements several AAM fitting methods. Difference from other libraries is that DeMoLib provides several AAM fitting methods s…