I am Charmie

メモとログ

Eigen

Eigen 3.2.9 compilation on Ubuntu 16.04

If you face a cmake error regarding GLUT_XMU_something, try the following installation and then retry the cmake compilation. sudo apt-get install libxmu-dev libxi-dev

convert Eigen::Matrix to flann::Matrix

The following functions convert (note the matrix size!!) a column-major NxM Eigen::Matrix to a row-major MxN flann::Matrix. a row-major NxM Eigen::Matrix to a row-major NxM flann::Matrix. [code lang="cpp"] template <typename ValueType> flann::Matrix<ValueType> convertEi</valuetype></typename>…

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(…

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]…

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…

Eigen3 with CMake

Eigen3 is not detectable by CMake findpackage macro. One solution for this problem is to self-create a file FindEigen3.cmake that enables CMake to find Eigen3.see here.

Eigen: random value

Same as a function rand(), functions Random() and setRandom() always generate same random values. Same as rand(), we can change seed of the random values by calling srand(). srand( (unsigned)time(NULL) ); // you need to include ctime or ti…