Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created May 11, 2020 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/f4975361608bd75cb36639459424fef1 to your computer and use it in GitHub Desktop.
Save prateekjoshi565/f4975361608bd75cb36639459424fef1 to your computer and use it in GitHub Desktop.
# create a zero array
stencil = np.zeros_like(col_images[idx][:,:,0])
# specify coordinates of the polygon
polygon = np.array([[50,270], [220,160], [360,160], [480,270]])
# fill polygon with ones
cv2.fillConvexPoly(stencil, polygon, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment