Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am billyzs on github.
  • I am bzs ( on keybase.
  • I have a public key whose fingerprint is 17B5 6542 1A9C 50AF E3BD 1C7A 6EE4 DAA7 ACA1 FCAC

To claim this, I am signing this object:

billyzs / load_imu_data.m
Last active September 23, 2016 14:49
MATLAB helper function to load IMU data into matrices
function [ imu_data, gps_data ] = load_imu_data( file_name )
%load data from txt file containing IMU output
%written by Shao Zhou billyzs.728[at]
% imu_data is n * 13 matrix that contains data fileds in the following sequence:
% Time
% Acceleration (x, y, z) in m/s
% Angular Velocity (p, q, r) in rad/s
% Magnetic field strength (x, y, z) in muT
% Roll, Pitch, Yaw in deg
billyzs /
Created August 20, 2016 15:49
# A script to generate spherical rendering of STL Files
#!/usr/bin/env python
# A script to generate spherical rendering of STL Files
# Use with python /path/to/folder
# or python /path/to/file
# Written by Billy Zhou (billyzs.728 #
import vtk
import argparse, os
billyzs /
Created August 20, 2016 15:44
OpenCV Kmeans algorithm
#!/usr/bin/env python
import numpy as np
import cv2
YCBCR_BLACK = np.array([[0, 128, 128]], dtype='uint8')
def k_means(img, k, criteria=CRITERIA, show=False, attempts=5):
billyzs / cpp_file_io_pcd.cpp
Last active January 27, 2017 03:14
example of file io in C++, converts a .pcd file to a vector of PointXYZ
#include "stdafx.h"
#include "util.h"
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
#include <cstdio>
#include <sstream>
billyzs /
Created June 7, 2016 00:26
a crude color segmentation
#!/usr/bin/env python
import sys
import rospy
import cv2
import numpy as np
# from std_msgs.msg import String
from sensor_msgs.msg import Image, PointCloud2
from cv_bridge import CvBridge, CvBridgeError