Muhammad Usman Nazir commited on
Commit
22b3e8b
·
1 Parent(s): 608135a

Fix: handle 2D HoughLinesP output in detect_vanishing_point

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -1579,7 +1579,7 @@ def detect_vanishing_point(img_np: np.ndarray, floor_mask: np.ndarray):
1579
 
1580
  h, w = img_np.shape[:2]
1581
  candidates = []
1582
- for line in lines[:, 0, :]:
1583
  x1, y1, x2, y2 = [float(v) for v in line]
1584
  dx, dy = x2 - x1, y2 - y1
1585
  length = float(np.hypot(dx, dy))
 
1579
 
1580
  h, w = img_np.shape[:2]
1581
  candidates = []
1582
+ for line in lines.reshape(-1, 4):
1583
  x1, y1, x2, y2 = [float(v) for v in line]
1584
  dx, dy = x2 - x1, y2 - y1
1585
  length = float(np.hypot(dx, dy))