Python rewrite of phow_caltech101.m from http: //www.vlfeat.org/applications/caltech-101-code.html