Mercurial > hg > nsaunier > traffic-intelligence
comparison python/cvutils.py @ 935:0e63a918a1ca
updated classify-objects
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 14 Jul 2017 16:30:57 -0400 |
| parents | 8ac7f61c6e4f |
| children | 56cc8a1f7082 |
comparison
equal
deleted
inserted
replaced
| 934:39691b460fca | 935:0e63a918a1ca |
|---|---|
| 670 from skimage import color, transform | 670 from skimage import color, transform |
| 671 | 671 |
| 672 def HOG(image, rescaleSize = (64, 64), orientations=9, pixelsPerCell=(8,8), cellsPerBlock=(2,2), blockNorm='L1', visualize=False, normalize=False): | 672 def HOG(image, rescaleSize = (64, 64), orientations=9, pixelsPerCell=(8,8), cellsPerBlock=(2,2), blockNorm='L1', visualize=False, normalize=False): |
| 673 bwImg = color.rgb2gray(image) | 673 bwImg = color.rgb2gray(image) |
| 674 inputImg = transform.resize(bwImg, rescaleSize) | 674 inputImg = transform.resize(bwImg, rescaleSize) |
| 675 features = hog(inputImg, orientations, pixelsPerCell, cellsPerBlock, blockNorm, visualize, normalize) | 675 features = hog(inputImg, orientations, pixelsPerCell, cellsPerBlock, blockNorm, visualize, normalize, True) |
| 676 if visualize: | 676 if visualize: |
| 677 from matplotlib.pyplot import imshow, figure, subplot | 677 from matplotlib.pyplot import imshow, figure, subplot |
| 678 hogViz = features[1] | 678 hogViz = features[1] |
| 679 features = features[0] | 679 features = features[0] |
| 680 figure() | 680 figure() |
