Created
December 24, 2014 06:26
-
-
Save heaven00/f1a8aab9349933765c20 to your computer and use it in GitHub Desktop.
Function to display contours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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