comparison 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
comparison
equal deleted inserted replaced
684:6d2ece4aed7c 685:94b291a5f933
1402 1402
1403 def classifyUserTypeHoGSVMAtInstant(self, img, instant, homography, width, height, px = 0.2, py = 0.2, minNPixels = 800): 1403 def classifyUserTypeHoGSVMAtInstant(self, img, instant, homography, width, height, px = 0.2, py = 0.2, minNPixels = 800):
1404 '''Extract the image box around the object and 1404 '''Extract the image box around the object and
1405 applies the SVM model on it''' 1405 applies the SVM model on it'''
1406 croppedImg, yCropMin, yCropMax, xCropMin, xCropMax = cvutils.imageBox(img, self, instant, homography, width, height, px, py, minNPixels) 1406 croppedImg, yCropMin, yCropMax, xCropMin, xCropMax = cvutils.imageBox(img, self, instant, homography, width, height, px, py, minNPixels)
1407 if len(croppedImg) > 0: 1407 if croppedImg is not None and len(croppedImg) > 0:
1408 hog = cvutils.HOG(croppedImg)#HOG(image, rescaleSize = (64, 64), orientations=9, pixelsPerCell=(8, 8), cellsPerBlock=(2, 2), visualize=False, normalize=False) 1408 hog = cvutils.HOG(croppedImg)#HOG(image, rescaleSize = (64, 64), orientations=9, pixelsPerCell=(8, 8), cellsPerBlock=(2, 2), visualize=False, normalize=False)
1409 self.userTypes[instant] = int(self.appearanceClassifier.predict(hog)) 1409 self.userTypes[instant] = int(self.appearanceClassifier.predict(hog))
1410 else: 1410 else:
1411 self.userTypes[instant] = userType2Num['unknown'] 1411 self.userTypes[instant] = userType2Num['unknown']
1412 1412