I am Charmie

メモとログ

2015-03-01から1ヶ月間の記事一覧

use Meld for git diff

make a script, git-meld.sh #!/bin/bash meld "$2" "$5" > /dev/null 2>&1 put the script in the bin directory sudo mv git-meld.sh /usr/local/bin/ sudo chmod +x /usr/local/bin/git-meld.sh add diff settings in the $HOME/.gitconfig [diff] extern…

C++: count some elements of std::vector

count_if counts the number of elements that satisfies the specified condition. The result is like the following: 79, 55, 57, 44, 0, 14, -5, 52, 86, 95, -7, 100, 5, -5, 95, 19, 63, 59, 40, 51, numNegative = 3 numNonNegative = 17 numZero = 1…

Eigen: make matrix homogeneous and dehomogeneous

[code lang="cpp"] Eigen::MatrixXd M = Eigen::MatrixXd(3,10); // make each column homogeneous Eigen::MatrixXd Mh = M.colwise().homogeneous(); // make each column dehomogeneous Eigen::MatrixXd Md = Mh.colwise().hnormalized().topRows(Mh.rows(…

C++: warning suppression in the code

#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #include <Eigen/Geometry> #pragma GCC diagnostic pop</eigen/geometry>

make cv::findHomography stable

A friend of mine told me how to make cv::findHomography more stable. The solution is very easy, comment lines 91-121 of module/calib3d/fundam.cpp and then compile. The unstability is due to the new algorithm to compute the homography. From…

MatLab installation

sudo ./install # to enable the installer mkdir sudo apt-get install matlab-support # add matlab to the launcher

convert std::string to X

C++11 functions std::to_string(X) converts X to std::string. std::stoi(str) converts std::string str to int type data std::stof(str) converts std::string str to float type data std::stod(str) converts std::string str to double type data

English

bronchus - bronchi: 気管支(単複) alveolus - alveoli: 肺胞(単複)