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 os | |
import pandas | |
import time | |
import numpy as np | |
import array | |
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
import cv2 | |
from scipy.interpolate import griddata, Rbf, interpolate |
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 as np | |
from scipy.spatial import Delaunay | |
def calc_dis(x1, y1, x2, y2, x3, y3): | |
return np.sqrt(np.power(x1 - x2, 2) + np.power(y1 - y2, 2)) + \ | |
np.sqrt(np.power(x1 - x3, 2) + np.power(y1 - y3, 2)) + \ | |
np.sqrt(np.power(x2 - x3, 2) + np.power(y2 - y3, 2)) | |
def calc_triangle_area(x1, y1, x2, y2, x3, y3): | |
return 1 / 2 * ((x1 * y2 - x2 * y1) + (x2 * y3 - x3 * y2) + (x3 * y1 - x1 * y3)) |
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 multiprocessing | |
import os | |
import numpy as np | |
import array | |
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
import cv2 | |
from scipy.interpolate import griddata, Rbf, interpolate | |
from PIL import Image |
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
#include <iostream> | |
#include <pcl/visualization/cloud_viewer.h> | |
#include <pcl/kdtree/kdtree_flann.h> | |
#include <pcl/ModelCoefficients.h> | |
#include <cmath> | |
#include <fstream> | |
#include <vector> | |
#include <pcl/filters/passthrough.h> | |
#include <pcl/filters/extract_indices.h> | |
#include <pcl/filters/statistical_outlier_removal.h> |
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
__device__ float customAtomicMin( unsigned long long int* address, unsigned long long int newVal ) | |
{ | |
unsigned long long int old = *address, assumed; | |
if( *((float*)&old ) <= *((float*)&newVal) ) | |
return *((float*)&old); | |
do | |
{ | |
assumed = old; | |
if( *((float*)&assumed) <= *((float*)&newVal) ) |
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
#include <vector> | |
#include <algorithm> | |
/** | |
* Argsort(currently support ascending sort) | |
* @tparam T array element type | |
* @param array input array | |
* @return indices w.r.t sorted array | |
*/ | |
template<typename T> |
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 as np | |
x = np.arange(10) | |
y = np.arange(42) | |
cp = np.transpose([np.tile(x, len(y)), np.repeat(y, len(x))]) |
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
def project_points(x, y, z, a, b, c): | |
""" | |
Projects the points with coordinates x, y, z onto the plane | |
defined by a*x + b*y + c*z = 1 | |
""" | |
vector_norm = a * a + b * b + c * c | |
normal_vector = np.array([a, b, c]) / np.sqrt(vector_norm) | |
point_in_plane = np.array([a, b, c]) / vector_norm |
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 time | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def get_omega(position): | |
position_list = [] | |
for line in range(LINES): | |
new_position = np.copy(position) |
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) |