nsaunier/traffic-intelligence
corrected bug with multiply in undistort-videos
Commit 3deeb42dffdd · Nicolas Saunier · 2024-10-08 15:41 -0400
Comments
No comments yet.
Diff
diff --git a/scripts/undistort-video.py b/scripts/undistort-video.py
--- a/scripts/undistort-video.py
+++ b/scripts/undistort-video.py
@@ -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: