Skip to content

Instantly share code, notes, and snippets.

View HViktorTsoi's full-sized avatar

KINO HViktorTsoi

  • BUAA
View GitHub Profile
@ashwin
ashwin / build-cuda.cmake
Last active May 19, 2024 11:14
Sample CMakeLists.txt file to build a CUDA program
### CMakeLists.txt for CUDA
cmake_minimum_required(VERSION 2.8)
find_package(CUDA QUIET REQUIRED)
# Pass options to NVCC
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-O3 -gencode arch=compute_22,code=sm_22
@CarloNicolini
CarloNicolini / ralign
Created October 23, 2013 12:47
Umeyama algorithm for absolute orientation problem in Python
"""
RALIGN - Rigid alignment of two sets of points in k-dimensional
Euclidean space. Given two sets of points in
correspondence, this function computes the scaling,
rotation, and translation that define the transform TR
that minimizes the sum of squared errors between TR(X)
and its corresponding points in Y. This routine takes
O(n k^3)-time.
Inputs:
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active July 15, 2024 03:30 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@royshil
royshil / cylindricalWarping.py
Last active June 23, 2024 18:48
Warp an image to cylindrical coordinates for cylindrical panorama stitching, using Python OpenCV
import cv2
import numpy as np
def cylindricalWarp(img, K):
"""This function returns the cylindrical warp for a given image and intrinsics matrix K"""
h_,w_ = img.shape[:2]
# pixel coordinates
y_i, x_i = np.indices((h_,w_))
X = np.stack([x_i,y_i,np.ones_like(x_i)],axis=-1).reshape(h_*w_,3) # to homog
Kinv = np.linalg.inv(K)
@ialhashim
ialhashim / fill_depth_colorization.py
Last active May 27, 2024 21:23
Python implementation of depth filling from NYU Depth v2 toolbox
# Original Matlab code https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html
#
#
# Python port of depth filling code from NYU toolbox
# Speed needs to be improved
#
# Uses 'pypardiso' solver
#
import scipy
import skimage
@HViktorTsoi
HViktorTsoi / ToRing.py
Last active September 9, 2022 03:11
Any type of LiDAR point cloud to ring-based LiDAR style
import numpy.linalg as LA
import numpy as np
def any_LiDAR_to_ring(pc, num_beams=32, ring_height=8e-4):
"""
convert any type of LiDAR point cloud to ring-based LiDAR style
:param pc: input point cloud, shape of Nx4(x,y,z,intensity)
:param num_beams: number of beams
:param ring_height: the "line width" of a ring
:return: ring-stype point cloud, shape of Nx5(x,y,z,intensity, ring ID)
@HViktorTsoi
HViktorTsoi / GTO.py
Created April 21, 2023 07:48
hilti2022 experiment
import copy
import time
import open3d as o3d
import os
from collections import defaultdict
import numpy as np
import numpy.linalg as LA
import gtsam
import tqdm