| |
|:-------------------------------------:|
|  |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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 |