Adding splitter method
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user