comparison scripts/extract-appearance-images.py @ 946:e5970606066f

bug fix on list filtering (cannot remove while iterating) and motion prediction keeping the same features
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 21 Jul 2017 11:25:20 -0400
parents 3dd5acfa1899
children 053484e08947
comparison
equal deleted inserted replaced
945:05d4302bf67e 946:e5970606066f
78 img = cv2.remap(img, map1, map2, interpolation=cv2.INTER_LINEAR) 78 img = cv2.remap(img, map1, map2, interpolation=cv2.INTER_LINEAR)
79 distorted = False 79 distorted = False
80 croppedImg = cvutils.imageBox(img, obj, frameNum, invHomography, width, height, classifierParams.percentIncreaseCrop, classifierParams.percentIncreaseCrop, classifierParams.minNPixels) 80 croppedImg = cvutils.imageBox(img, obj, frameNum, invHomography, width, height, classifierParams.percentIncreaseCrop, classifierParams.percentIncreaseCrop, classifierParams.minNPixels)
81 if croppedImg is not None: 81 if croppedImg is not None:
82 cv2.imwrite(args.directoryName+os.sep+moving.userTypeNames[obj.getUserType()]+os.sep+args.imagePrefix+'-{}-{}.png'.format(obj.getNum(), frameNum), croppedImg) 82 cv2.imwrite(args.directoryName+os.sep+moving.userTypeNames[obj.getUserType()]+os.sep+args.imagePrefix+'-{}-{}.png'.format(obj.getNum(), frameNum), croppedImg)
83 elif obj.getLastInstant() == frameNum: 83 # elif obj.getLastInstant() == frameNum:
84 objects.remove(obj) 84 # objects.remove(obj)
85 objects[:] = [obj for obj in objects if obj.getLastInstant() != frameNum]
85 frameNum += 1 86 frameNum += 1
86 87
87 # todo speed info: distributions AND min speed equiprobable 88 # todo speed info: distributions AND min speed equiprobable
88 89