zhigangjiang
commited on
Commit
•
cb05369
1
Parent(s):
006fd2a
Update postprocessing/dula/layout.py
Browse files
postprocessing/dula/layout.py
CHANGED
@@ -44,9 +44,9 @@ def fit_layout(floor_xz, need_cube=False, show=False, block_eps=0.2):
|
|
44 |
polys = cv2.findContours(floorplan_sub, 1, 2)
|
45 |
if isinstance(polys, tuple):
|
46 |
if len(polys) == 3:
|
47 |
-
polys = polys[1]
|
48 |
else:
|
49 |
-
polys = polys[0]
|
50 |
poly = polys[0]
|
51 |
epsilon = 0.005 * cv2.arcLength(poly, True)
|
52 |
poly = cv2.approxPolyDP(poly, epsilon, True)
|
@@ -150,9 +150,9 @@ def fit_layout(floor_xz, need_cube=False, show=False, block_eps=0.2):
|
|
150 |
pred_polys = cv2.findContours(pred, 1, 3)
|
151 |
if isinstance(pred_polys, tuple):
|
152 |
if len(pred_polys) == 3:
|
153 |
-
pred_polys = pred_polys[1]
|
154 |
else:
|
155 |
-
pred_polys = pred_polys[0]
|
156 |
|
157 |
pred_polys.sort(key=lambda x: cv2.contourArea(x), reverse=True)
|
158 |
pred_polys = pred_polys[0]
|
|
|
44 |
polys = cv2.findContours(floorplan_sub, 1, 2)
|
45 |
if isinstance(polys, tuple):
|
46 |
if len(polys) == 3:
|
47 |
+
polys = list(polys[1])
|
48 |
else:
|
49 |
+
polys = list(polys[0])
|
50 |
poly = polys[0]
|
51 |
epsilon = 0.005 * cv2.arcLength(poly, True)
|
52 |
poly = cv2.approxPolyDP(poly, epsilon, True)
|
|
|
150 |
pred_polys = cv2.findContours(pred, 1, 3)
|
151 |
if isinstance(pred_polys, tuple):
|
152 |
if len(pred_polys) == 3:
|
153 |
+
pred_polys = list(pred_polys[1])
|
154 |
else:
|
155 |
+
pred_polys = list(pred_polys[0])
|
156 |
|
157 |
pred_polys.sort(key=lambda x: cv2.contourArea(x), reverse=True)
|
158 |
pred_polys = pred_polys[0]
|