Loading ballontranslator/utils/imgproc_utils.py +2 −2 Original line number Diff line number Diff line Loading @@ -180,8 +180,8 @@ def enlarge_window(rect, im_w, im_h, ratio=2.5, aspect_ratio=1.0) -> List: delta_w = min(x1, im_w - x2, delta_w) delta = min(y1, im_h - y2, delta) rect = np.array([x1-delta_w, y1-delta, x2+delta_w, y2+delta], dtype=np.int64) rect[::2] = np.clip(rect[::2], 0, im_w - 1) rect[1::2] = np.clip(rect[1::2], 0, im_h - 1) rect[::2] = np.clip(rect[::2], 0, im_w) rect[1::2] = np.clip(rect[1::2], 0, im_h) return rect.tolist() def draw_connected_labels(num_labels, labels, stats, centroids, names="draw_connected_labels", skip_background=True): Loading Loading
ballontranslator/utils/imgproc_utils.py +2 −2 Original line number Diff line number Diff line Loading @@ -180,8 +180,8 @@ def enlarge_window(rect, im_w, im_h, ratio=2.5, aspect_ratio=1.0) -> List: delta_w = min(x1, im_w - x2, delta_w) delta = min(y1, im_h - y2, delta) rect = np.array([x1-delta_w, y1-delta, x2+delta_w, y2+delta], dtype=np.int64) rect[::2] = np.clip(rect[::2], 0, im_w - 1) rect[1::2] = np.clip(rect[1::2], 0, im_h - 1) rect[::2] = np.clip(rect[::2], 0, im_w) rect[1::2] = np.clip(rect[1::2], 0, im_h) return rect.tolist() def draw_connected_labels(num_labels, labels, stats, centroids, names="draw_connected_labels", skip_background=True): Loading