comparison scripts/compute-homography.py @ 960:0c1d1eeef544

corrected bug on new computer
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 20 Oct 2017 16:59:32 -0400
parents 39691b460fca
children 933670761a57
comparison
equal deleted inserted replaced
959:4f32d82ca390 960:0c1d1eeef544
50 videoImg = plt.imread(args.videoFrameFilename) 50 videoImg = plt.imread(args.videoFrameFilename)
51 if args.undistort: 51 if args.undistort:
52 [map1, map2], newCameraMatrix = cvutils.computeUndistortMaps(videoImg.shape[1], videoImg.shape[0], args.undistortedImageMultiplication, np.loadtxt(args.intrinsicCameraMatrixFilename), args.distortionCoefficients) 52 [map1, map2], newCameraMatrix = cvutils.computeUndistortMaps(videoImg.shape[1], videoImg.shape[0], args.undistortedImageMultiplication, np.loadtxt(args.intrinsicCameraMatrixFilename), args.distortionCoefficients)
53 videoImg = cv2.remap(videoImg, map1, map2, interpolation=cv2.INTER_LINEAR) 53 videoImg = cv2.remap(videoImg, map1, map2, interpolation=cv2.INTER_LINEAR)
54 print('Click on {} points in the video frame'.format(args.nPoints)) 54 print('Click on {} points in the video frame'.format(args.nPoints))
55 plt.ion()
55 plt.figure() 56 plt.figure()
56 plt.imshow(videoImg) 57 plt.imshow(videoImg)
57 plt.tight_layout() 58 plt.tight_layout()
58 videoPts = np.array(plt.ginput(args.nPoints, timeout=3000)) 59 videoPts = np.array(plt.ginput(args.nPoints, timeout=3000))
59 if args.undistort: 60 if args.undistort: