Adding HOG features and visualization code.
Taken from VOC-DPM.