freealise commited on
Commit
58be8ed
1 Parent(s): f28cd01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -114,6 +114,15 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
114
  depth_color = cv2.applyColorMap(depth, cv2.COLORMAP_BONE)
115
  depth_color = cv2.cvtColor(depth_color, cv2.COLOR_RGBA2GRAY)
116
  depth_color = cv2.cvtColor(depth_color, cv2.COLOR_GRAY2RGB)
 
 
 
 
 
 
 
 
 
117
 
118
  # split_region = np.ones((frame_height, margin_width, 3), dtype=np.uint8) * 255
119
  # combined_frame = cv2.hconcat([raw_frame, split_region, depth_color])
 
114
  depth_color = cv2.applyColorMap(depth, cv2.COLORMAP_BONE)
115
  depth_color = cv2.cvtColor(depth_color, cv2.COLOR_RGBA2GRAY)
116
  depth_color = cv2.cvtColor(depth_color, cv2.COLOR_GRAY2RGB)
117
+
118
+ # Remove white border around map:
119
+ # define lower and upper limits of white
120
+ white_lo = np.array([255,255,255])
121
+ white_hi = np.array([255,255,255])
122
+ # mask image to only select white
123
+ mask = cv2.inRange(depth_color, white_lo, white_hi)
124
+ # change image to black where we found white
125
+ depth_color[mask>0] = (0,0,0)
126
 
127
  # split_region = np.ones((frame_height, margin_width, 3), dtype=np.uint8) * 255
128
  # combined_frame = cv2.hconcat([raw_frame, split_region, depth_color])