diff python/moving.py @ 685:94b291a5f933 dev

several updates for display
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 05 Jun 2015 17:13:28 +0200
parents fbe29be25501
children f2b52355a286
line wrap: on
line diff
--- a/python/moving.py	Fri Jun 05 13:26:51 2015 +0200
+++ b/python/moving.py	Fri Jun 05 17:13:28 2015 +0200
@@ -1404,7 +1404,7 @@
         '''Extract the image box around the object and 
         applies the SVM model on it'''
         croppedImg, yCropMin, yCropMax, xCropMin, xCropMax = cvutils.imageBox(img, self, instant, homography, width, height, px, py, minNPixels)
-        if len(croppedImg) > 0:
+        if croppedImg is not None and len(croppedImg) > 0:
             hog = cvutils.HOG(croppedImg)#HOG(image, rescaleSize = (64, 64), orientations=9, pixelsPerCell=(8, 8), cellsPerBlock=(2, 2), visualize=False, normalize=False)
             self.userTypes[instant] = int(self.appearanceClassifier.predict(hog))
         else: