Skip to content

Instantly share code, notes, and snippets.

View Harold2017's full-sized avatar
😃

Harold Harold2017

😃
View GitHub Profile
@Harold2017
Harold2017 / Eigen2CV.h
Created December 14, 2020 04:17 — forked from BloodAxe/Eigen2CV.h
This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
/**
* @brief Mapping functions from Eigen data types to OpenCV
* @author Eugene Khvedchenya <ekhvedchenya@gmail.com>
* @details This header file contains code snippet for easy mapping Eigen types to OpenCV and back with minimal overhead.
* @more computer-vision.talks.com/articles/mapping-eigen-to-opencv/
* Features:
* - Mapping plain data types with no overhead (read/write access)
* - Mapping expressions via evaluation (read only acess)
*
* Known issues:
@Harold2017
Harold2017 / Open3d.md
Created November 27, 2020 09:48
Compile Open3d on macos

compile error occurs when link flann as follows:

[ 77%] Linking CXX executable ../../bin/ConvertPointCloud

Undefined symbols for architecture x86_64:

  "_LZ4_compress_HC_continue", referenced from:
@Harold2017
Harold2017 / qt-without-xcode.md
Created November 22, 2020 09:26 — forked from shoogle/qt-without-xcode.md
Qt without XCode - how to use Qt Creator for macOS software development without installing XCode

Qt without Xcode

How to use Qt Creator for software development on macOS without having to install Xcode

Justification

Qt refuses to install on macOS unless Apple's Xcode is installed beforehand. This is unfortunate because:

@Harold2017
Harold2017 / Eigen Cheat sheet
Created September 23, 2020 02:09 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.
mysql> create database db_name;
mysql> use db_name;
mysql> set autocommit=0;
mysql> source dump_file.sql;
mysql> commit;
@Harold2017
Harold2017 / fitting3D.cpp
Created August 24, 2020 03:39 — forked from ialhashim/fitting3D.cpp
Fitting 3D points to a plane or a line
template<class Vector3>
std::pair<Vector3, Vector3> best_plane_from_points(const std::vector<Vector3> & c)
{
// copy coordinates to matrix in Eigen format
size_t num_atoms = c.size();
Eigen::Matrix< Vector3::Scalar, Eigen::Dynamic, Eigen::Dynamic > coord(3, num_atoms);
for (size_t i = 0; i < num_atoms; ++i) coord.col(i) = c[i];
// calculate centroid
Vector3 centroid(coord.row(0).mean(), coord.row(1).mean(), coord.row(2).mean());
@Harold2017
Harold2017 / homebrew.md
Created August 17, 2020 04:56
replace brew default src with ustc mirror
@Harold2017
Harold2017 / tcmalloc on windows.md
Created July 11, 2020 04:01
tcmalloc on window

cmake

compile libtcmalloc_minimal with Release-Patch

link libtcmalloc_minimal.lib in CMakeList

copy libtcmalloc_minimal.dll to execution folder

without cmake

@Harold2017
Harold2017 / vcpkg.md
Last active June 16, 2020 08:28
vcpkg on mac
# install vcpkg
git clone https://github.com/Microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh -disableMetrics
sudo ln -s /xxx/vcpkg/vcpkg /usr/local/bin
vcpkg help

# use it in CMakeLists.txt
set(ENV{VCPKG_ROOT} "/xxx/vcpkg/vcpkg")
C++ 3 hrs 24 mins ██████████████████▍░░ 87.7%
JSON 15 mins █▍░░░░░░░░░░░░░░░░░░░ 6.7%
CMake 12 mins █░░░░░░░░░░░░░░░░░░░░ 5.3%
Other 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.2%
C 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.1%