diff 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
line wrap: on
line diff
--- a/scripts/extract-appearance-images.py	Thu Jul 20 14:29:46 2017 -0400
+++ b/scripts/extract-appearance-images.py	Fri Jul 21 11:25:20 2017 -0400
@@ -80,8 +80,9 @@
                             croppedImg = cvutils.imageBox(img, obj, frameNum, invHomography, width, height, classifierParams.percentIncreaseCrop, classifierParams.percentIncreaseCrop, classifierParams.minNPixels)
                             if croppedImg is not None:
                                 cv2.imwrite(args.directoryName+os.sep+moving.userTypeNames[obj.getUserType()]+os.sep+args.imagePrefix+'-{}-{}.png'.format(obj.getNum(), frameNum), croppedImg)
-                    elif obj.getLastInstant() == frameNum:
-                        objects.remove(obj)
+#                    elif obj.getLastInstant() == frameNum:
+#                        objects.remove(obj)
+            objects[:] = [obj for obj in objects if obj.getLastInstant() != frameNum]
         frameNum += 1
 
 # todo speed info: distributions AND min speed equiprobable