Adding splitter method

This commit is contained in:
2026-01-05 13:56:57 +02:00
parent 395d263900
commit 510eabfa94
2 changed files with 157 additions and 49 deletions

View File

@@ -91,11 +91,11 @@ def draw_annotations(img, labels, alpha=0.4, draw_bbox_for_poly=True):
cv2.rectangle(img, (x1, y1), (x2, y2), color, 1)
pts = poly_to_pts(coords[4:], w, h)
line = LineString(pts)
# Buffer distance in pixels
buffered = line.buffer(3, cap_style=2, join_style=2)
coords = np.array(buffered.exterior.coords, dtype=np.int32)
cv2.fillPoly(overlay, [coords], color=(255, 255, 255))
# line = LineString(pts)
# # Buffer distance in pixels
# buffered = line.buffer(3, cap_style=2, join_style=2)
# coords = np.array(buffered.exterior.coords, dtype=np.int32)
# cv2.fillPoly(overlay, [coords], color=(255, 255, 255))
# fill on overlay
cv2.fillPoly(overlay, [pts], color)