diff scripts/undistort-video.py @ 1249:2aa56b101041

added mask functionality for dltrack
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 15 Feb 2024 14:09:52 -0500
parents b684135d817f
children
line wrap: on
line diff
--- a/scripts/undistort-video.py	Thu Feb 15 14:09:23 2024 -0500
+++ b/scripts/undistort-video.py	Thu Feb 15 14:09:52 2024 -0500
@@ -39,7 +39,7 @@
 height = int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT))
 [map1, map2], newCameraMatrix = cvutils.computeUndistortMaps(width, height, args.undistortedImageMultiplication, intrinsicCameraMatrix, args.distortionCoefficients)
 if args.maskFilename is not None:
-    mask = cv2.imread(args.maskFilename)
+    mask = cv2.imread(args.maskFilename, cv2.IMREAD_GRAYSCALE)
     undistortedMask = cv2.remap(mask, map1, map2, interpolation=cv2.INTER_LINEAR)/255
 
 if capture.isOpened():