fix path errors in setup.py
fix bugs in sample.py

d0 = min(h0, w0),d0 - w0 might be negative
Merge pull request #1 from zhongwen/master

fix bugs in API/python