Skip to content

Instantly share code, notes, and snippets.

@heaven00
Created December 24, 2014 06:26
Show Gist options
  • Save heaven00/f1a8aab9349933765c20 to your computer and use it in GitHub Desktop.
Save heaven00/f1a8aab9349933765c20 to your computer and use it in GitHub Desktop.
Function to display contours
def show_contours(contours, img):
"""
Draw and display contours on the img provided.
:contours: - list of contours
:img: - on which the contour is suppose to be drawn
"""
color = np.random.randint(0, 255, (3)).tolist()
for cnt in contours:
cv2.drawContours(img, [cnt], 0, color, 2)
show_img(img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment