Skip to content

Instantly share code, notes, and snippets.

View bgshih's full-sized avatar

Baoguang Shi bgshih

  • Microsoft
  • Redmond, WA, USA
View GitHub Profile
@bgshih
bgshih / Makefile
Created September 2, 2016 03:47
Ubuntu software installer
nvim:
sudo apt-get -y install software-properties-common &&
sudo add-apt-repository -y ppa:neovim-ppa/unstable &&
sudo apt-get -y update &&
sudo apt-get -y install neovim
@bgshih
bgshih / tps-demo.py
Created October 21, 2015 09:48
A simple example of Thin Plate Spline (TPS) transformation in Numpy.
import ipdb
import numpy as np
import numpy.linalg as nl
import matplotlib.pyplot as plt
from scipy.spatial.distance import pdist, cdist, squareform
def makeT(cp):
# cp: [K x 2] control points
# T: [(K+3) x (K+3)]
K = cp.shape[0]