Mercurial Hosting > traffic-intelligence
diff scripts/compute-homography.py @ 636:3058e00887bc
removed all issues because of tests with None, using is instead of == or !=
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 24 Mar 2015 18:11:28 +0100 |
parents | aded6c1c2ebd |
children | 852f5de42d01 |
line wrap: on
line diff
--- a/scripts/compute-homography.py Tue Mar 24 14:17:12 2015 +0100 +++ b/scripts/compute-homography.py Tue Mar 24 18:11:28 2015 +0100 @@ -75,10 +75,10 @@ homography = np.array([]) -if args.pointCorrespondencesFilename != None: +if args.pointCorrespondencesFilename is not None: worldPts, videoPts = cvutils.loadPointCorrespondences(args.pointCorrespondencesFilename) homography, mask = cv2.findHomography(videoPts, worldPts) # method=0, ransacReprojThreshold=3 -elif args.videoFrameFilename != None and args.worldFilename != None: +elif args.videoFrameFilename is not None and args.worldFilename is not None: worldImg = plt.imread(args.worldFilename) videoImg = plt.imread(args.videoFrameFilename) if args.undistort: @@ -103,7 +103,7 @@ if homography.size>0: np.savetxt('homography.txt',homography) -if args.displayPoints and args.videoFrameFilename != None and args.worldFilename != None and homography.size>0: +if args.displayPoints and args.videoFrameFilename is not None and args.worldFilename is not None and homography.size>0: worldImg = cv2.imread(args.worldFilename) videoImg = cv2.imread(args.videoFrameFilename) if args.undistort: