Skip to content

Instantly share code, notes, and snippets.

@GTimothee
Created June 14, 2018 10:21
Show Gist options
  • Save GTimothee/72be4e9900af94d7682bc61b8b680d19 to your computer and use it in GitHub Desktop.
Save GTimothee/72be4e9900af94d7682bc61b8b680d19 to your computer and use it in GitHub Desktop.
def drawMask(width, height, coordinatesList):
mask = np.zeros((height,width,3), np.uint8)
color = (255,255,255)
for coordinates in coordinatesList:
cv2.fillConvexPoly(mask, np.array(coordinates, 'int32'), color)
return mask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment