changeset 528:5585ebd8ad61

corrected bugs for trajectory display for new code versions
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 25 Jun 2014 16:52:34 -0400
parents 37830a831818
children f527159815ab
files python/cvutils.py scripts/display-trajectories.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/cvutils.py	Sat Jun 21 14:46:20 2014 -0400
+++ b/python/cvutils.py	Wed Jun 25 16:52:34 2014 -0400
@@ -251,7 +251,7 @@
                             if frameNum in boundingBoxes.keys():
                                 for rect in boundingBoxes[frameNum]:
                                     cv2.rectangle(img, rect[0].asint().astuple(), rect[1].asint().astuple(), cvRed)
-                            elif obj.features != None:
+                            elif len(obj.features) != 0:
                                 imgcrop, yCropMin, yCropMax, xCropMin, xCropMax = imageBox(img, obj, frameNum, homography, width, height)
                                 cv2.rectangle(img, (xCropMin, yCropMin), (xCropMax, yCropMax), cvBlue, 1)
                             objDescription = '{} '.format(obj.num)
--- a/scripts/display-trajectories.py	Sat Jun 21 14:46:20 2014 -0400
+++ b/scripts/display-trajectories.py	Wed Jun 25 16:52:34 2014 -0400
@@ -29,7 +29,10 @@
     params = storage.TrackingParameters(args.configFilename)
     videoFilename = params.videoFilename
     databaseFilename = params.databaseFilename
-    homography = inv(params.homography)
+    if params.homography != None:
+        homography = inv(params.homography)
+    else:
+        homography = None
     intrinsicCameraMatrix = params.intrinsicCameraMatrix
     distortionCoefficients = params.distortionCoefficients
     undistortedImageMultiplication = params.undistortedImageMultiplication