In [2]:
%matplotlib inline
In [2]:
import pyhog
import numpy as np
import matplotlib.pyplot as pl
from scipy.misc import imread, imrotate
In [5]:
# just a random VOC2012 image
img = (imread('2007_006449.jpg').astype(np.float64)/255.0)
pl.imshow(img)
pl.axis('off')
Out[5]:
In [6]:
hog = pyhog.features_pedro(img, 30)
hog.shape
Out[6]:
In [7]:
hog_pic = pyhog.hog_picture(hog)
In [8]:
pl.gray()
pl.imshow(hog_pic, vmin=0.0, vmax=3.0) # clip a bit for visibility
pl.axis('off')
Out[8]: