diff python/moving.py @ 893:ff92801e5c54

updated hog to scikit-image 0.13 (needed to add a block_norm attribute in classifier.cfg)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 30 May 2017 16:10:18 -0400
parents e2452abba0e7
children 1fc901d983ed
line wrap: on
line diff
--- a/python/moving.py	Fri May 05 00:07:33 2017 -0400
+++ b/python/moving.py	Tue May 30 16:10:18 2017 -0400
@@ -1577,7 +1577,7 @@
         
         self.userTypes = {}
 
-    def classifyUserTypeHoGSVMAtInstant(self, img, instant, homography, width, height, px, py, minNPixels, rescaleSize, orientations, pixelsPerCell, cellsPerBlock):
+    def classifyUserTypeHoGSVMAtInstant(self, img, instant, homography, width, height, px, py, minNPixels, rescaleSize, orientations, pixelsPerCell, cellsPerBlock, blockNorm):
         '''Extracts the image box around the object
         (of square size max(width, height) of the box around the features, 
         with an added px or py for width and height (around the box))
@@ -1585,7 +1585,7 @@
         and applies the SVM model on it'''
         croppedImg, yCropMin, yCropMax, xCropMin, xCropMax = cvutils.imageBox(img, self, instant, homography, width, height, px, py, minNPixels)
         if croppedImg is not None and len(croppedImg) > 0:
-            hog = cvutils.HOG(croppedImg, rescaleSize, orientations, pixelsPerCell, cellsPerBlock, visualize=False, normalize=False)
+            hog = cvutils.HOG(croppedImg, rescaleSize, orientations, pixelsPerCell, cellsPerBlock, blockNorm, visualize=False, normalize=False)
             self.userTypes[instant] = int(self.appearanceClassifier.predict(hog))
         else:
             self.userTypes[instant] = userType2Num['unknown']