Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/compute-homography.py @ 897:f5a49b603e8b
minor
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 14 Jun 2017 01:11:56 -0400 |
| parents | 739acd338cc0 |
| children | 8ac7f61c6e4f |
comparison
equal
deleted
inserted
replaced
| 896:6624484c0d55 | 897:f5a49b603e8b |
|---|---|
| 90 worldImg = plt.imread(args.worldFilename) | 90 worldImg = plt.imread(args.worldFilename) |
| 91 videoImg = plt.imread(args.videoFrameFilename) | 91 videoImg = plt.imread(args.videoFrameFilename) |
| 92 if args.undistort: | 92 if args.undistort: |
| 93 [map1, map2] = cvutils.computeUndistortMaps(videoImg.shape[1], videoImg.shape[0], args.undistortedImageMultiplication, np.loadtxt(args.intrinsicCameraMatrixFilename), args.distortionCoefficients) | 93 [map1, map2] = cvutils.computeUndistortMaps(videoImg.shape[1], videoImg.shape[0], args.undistortedImageMultiplication, np.loadtxt(args.intrinsicCameraMatrixFilename), args.distortionCoefficients) |
| 94 videoImg = cv2.remap(videoImg, map1, map2, interpolation=cv2.INTER_LINEAR) | 94 videoImg = cv2.remap(videoImg, map1, map2, interpolation=cv2.INTER_LINEAR) |
| 95 print('Click on {0} points in the video frame'.format(args.nPoints)) | 95 print('Click on {} points in the video frame'.format(args.nPoints)) |
| 96 plt.figure() | 96 plt.figure() |
| 97 plt.imshow(videoImg) | 97 plt.imshow(videoImg) |
| 98 plt.tight_layout() | 98 plt.tight_layout() |
| 99 videoPts = np.array(plt.ginput(args.nPoints, timeout=3000)) | 99 videoPts = np.array(plt.ginput(args.nPoints, timeout=3000)) |
| 100 print('Click on {0} points in the world image'.format(args.nPoints)) | 100 print('Click on {} points in the world image'.format(args.nPoints)) |
| 101 plt.figure() | 101 plt.figure() |
| 102 plt.imshow(worldImg) | 102 plt.imshow(worldImg) |
| 103 plt.tight_layout() | 103 plt.tight_layout() |
| 104 worldPts = args.unitsPerPixel*np.array(plt.ginput(args.nPoints, timeout=3000)) | 104 worldPts = args.unitsPerPixel*np.array(plt.ginput(args.nPoints, timeout=3000)) |
| 105 plt.close('all') | 105 plt.close('all') |
