Mercurial > hg > nsaunier > traffic-intelligence
diff scripts/undistort-video.py @ 1294:3deeb42dffdd
corrected bug with multiply in undistort-videos
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 08 Oct 2024 15:41:20 -0400 |
| parents | 2aa56b101041 |
| children |
line wrap: on
line diff
--- a/scripts/undistort-video.py Wed Oct 02 12:19:12 2024 -0400 +++ b/scripts/undistort-video.py Tue Oct 08 15:41:20 2024 -0400 @@ -57,7 +57,7 @@ img = cv2.remap(img, map1, map2, interpolation=cv2.INTER_LINEAR) cv2.imwrite(str(destinationPath/Path('undistorted-{{:0{}}}.png'.format(nZerosFilename).format(frameNum))), img) if args.maskFilename is not None: - cv2.imwrite(str(destinationPath/Path('undistorted+mask-{{:0{}}}.png'.format(nZerosFilename).format(frameNum))), cv2.multiply(img, undistortedMask, dtype = 16)) + cv2.imwrite(str(destinationPath/Path('undistorted+mask-{{:0{}}}.png'.format(nZerosFilename).format(frameNum))), cv2.multiply(img, cv2.merge([undistortedMask]*3), dtype = 16)) frameNum += 1 if args.encodeVideo:
