We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bbox_masks = [] pos_mask = mask.copy() for bbox_idx, (bbox_xs, bbox_ys) in enumerate(zip(xs, ys)): if labels[bbox_idx] == background_label: continue bbox_mask = mask.copy() bbox_points = zip(bbox_xs, bbox_ys) bbox_contours = util.img.points_to_contours(bbox_points) util.img.draw_contours(bbox_mask, bbox_contours, idx = -1, color = 1, border_width = -1) bbox_masks.append(bbox_mask) if labels[bbox_idx] == text_label: pos_mask += bbox_mask # treat overlapped in-bbox pixels as negative, # and non-overlapped ones as positive pos_mask = np.asarray(pos_mask == 1, dtype = np.int32) num_positive_pixels = np.sum(pos_mask)
Here just draw contours and set contours to 1, but not set inside the contours to 1. I think here also need use cv2.fillPoly.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here just draw contours and set contours to 1, but not set inside the contours to 1.
I think here also need use cv2.fillPoly.
The text was updated successfully, but these errors were encountered: