Mercurial Hosting > traffic-intelligence
diff scripts/compute-clearmot.py @ 982:51d8406b2489
corrected bug when not using a homography and using a mask for CLEAR MOT metrics
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 27 Feb 2018 16:45:46 -0500 |
parents | 196a1fd498ba |
children | 933670761a57 |
line wrap: on
line diff
--- a/scripts/compute-clearmot.py Tue Feb 27 15:24:57 2018 -0500 +++ b/scripts/compute-clearmot.py Tue Feb 27 16:45:46 2018 -0500 @@ -33,9 +33,9 @@ args = parser.parse_args() if args.homographyFilename is not None: - homography = loadtxt(args.homographyFilename) + invHomography = inv(loadtxt(args.homographyFilename)) else: - homography = None + invHomography = None objects = storage.loadTrajectoriesFromSqlite(args.trackerDatabaseFilename, 'object') @@ -46,12 +46,12 @@ if len(mask) > 1: mask = mask[:,:,0] for obj in objects: - maskObjects += obj.getObjectsInMask(mask, inv(homography), 2) # TODO add option to keep object if at least one feature in mask + maskObjects += obj.getObjectsInMask(mask, invHomography, 10) # TODO add option to keep object if at least one feature in mask objects = maskObjects annotations = storage.loadBBMovingObjectsFromSqlite(args.groundTruthDatabaseFilename) for a in annotations: - a.computeCentroidTrajectory(homography) + a.computeCentroidTrajectory(invHomography) if args.nFramesOffsetAnnotations is not None: for a in annotations: @@ -81,7 +81,7 @@ intrinsicCameraMatrix = None firstInstant = args.firstInstant lastInstant = args.lastInstant - cvutils.displayTrajectories(args.videoFilename, objects, {}, inv(homography), firstInstant, lastInstant, annotations = annotations, undistort = args.undistort, intrinsicCameraMatrix = intrinsicCameraMatrix, distortionCoefficients = args.distortionCoefficients, undistortedImageMultiplication = args.undistortedImageMultiplication, gtMatches = gtMatches, toMatches = toMatches) + cvutils.displayTrajectories(args.videoFilename, objects, {}, invHomography, firstInstant, lastInstant, annotations = annotations, undistort = args.undistort, intrinsicCameraMatrix = intrinsicCameraMatrix, distortionCoefficients = args.distortionCoefficients, undistortedImageMultiplication = args.undistortedImageMultiplication, gtMatches = gtMatches, toMatches = toMatches) #print('Ground truth matches') #print(gtMatches) #print('Object matches')