Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am billyzs on github.
  • I am bzs (https://keybase.io/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
billyzs / load_imu_data.m
Last active Sep 23, 2016
MATLAB helper function to load IMU data into matrices
View load_imu_data.m
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] gmail.com
% 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
billyzs / stl_render.py
Created Aug 20, 2016
# A script to generate spherical rendering of STL Files
View stl_render.py
#!/usr/bin/env python
# A script to generate spherical rendering of STL Files
# Use with python STL_viewer.py /path/to/folder
# or python STL_viewer.py /path/to/file
# Written by Billy Zhou (billyzs.728 # gmail.com)
import vtk
import argparse, os
@billyzs
billyzs / kmeans.py
Created Aug 20, 2016
OpenCV Kmeans algorithm
View kmeans.py
#!/usr/bin/env python
import numpy as np
import cv2
CRITERIA = (cv2.TERM_CRITERIA_MAX_ITER + cv2.TERM_CRITERIA_EPS, 5, 1.0)
YCBCR_BLACK = np.array([[0, 128, 128]], dtype='uint8')
def k_means(img, k, criteria=CRITERIA, show=False, attempts=5):
"""
@billyzs
billyzs / cpp_file_io_pcd.cpp
Last active Jan 27, 2017
example of file io in C++, converts a .pcd file to a vector of PointXYZ
View cpp_file_io_pcd.cpp
#include "stdafx.h"
#include "util.h"
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
#include <cstdio>
#include <sstream>
@billyzs
billyzs / image_converter.py
Created Jun 7, 2016
a crude color segmentation
View image_converter.py
#!/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