Muhammad Usman Nazir commited on
Commit
6061e48
·
1 Parent(s): d348987

fix: ensure src array is converted to float32 in estimate_floor_plane function

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -751,7 +751,7 @@ def estimate_floor_plane(mask: np.ndarray, img_np: np.ndarray):
751
  src[1][0] = max(src[1][0], hull_right_x)
752
  src[0][1] = src[1][1] = max(src[0][1], hull_bottom_y)
753
  src[2][1] = src[3][1] = min(src[2][1], hull_top_y)
754
- src = np.clip(src, [0, 0], [w - 1, h - 1])
755
 
756
  if cv2.contourArea(src.reshape(-1, 1, 2)) < 100:
757
  return None, None
 
751
  src[1][0] = max(src[1][0], hull_right_x)
752
  src[0][1] = src[1][1] = max(src[0][1], hull_bottom_y)
753
  src[2][1] = src[3][1] = min(src[2][1], hull_top_y)
754
+ src = np.clip(src, [0, 0], [w - 1, h - 1]).astype(np.float32)
755
 
756
  if cv2.contourArea(src.reshape(-1, 1, 2)) < 100:
757
  return None, None