Code for knn matting. Matlab code ready to run. Searches for the optimal values of k and d for a given time.