Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/undistort-video.py @ 924:a71455bd8367
work in progress on undistortion acceleration
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Fri, 07 Jul 2017 18:01:45 -0400 |
| parents | 52aa03260f03 |
| children | dbd81710d515 |
comparison
equal
deleted
inserted
replaced
| 923:238008f81c16 | 924:a71455bd8367 |
|---|---|
| 41 | 41 |
| 42 capture = cv2.VideoCapture(args.videoFilename) | 42 capture = cv2.VideoCapture(args.videoFilename) |
| 43 width = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) | 43 width = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)) |
| 44 height = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)) | 44 height = int(capture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)) |
| 45 [map1, map2] = cvutils.computeUndistortMaps(width, height, args.undistortedImageMultiplication, intrinsicCameraMatrix, args.distortionCoefficients) | 45 [map1, map2] = cvutils.computeUndistortMaps(width, height, args.undistortedImageMultiplication, intrinsicCameraMatrix, args.distortionCoefficients) |
| 46 | |
| 46 if capture.isOpened(): | 47 if capture.isOpened(): |
| 47 ret = True | 48 ret = True |
| 48 frameNum = args.firstFrameNum | 49 frameNum = args.firstFrameNum |
| 49 capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, args.firstFrameNum) | 50 capture.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, args.firstFrameNum) |
| 50 if args.lastFrameNum is None: | 51 if args.lastFrameNum is None: |
