Skip to content

Instantly share code, notes, and snippets.

@pierric
Created June 11, 2019 20:34
Show Gist options
  • Save pierric/6d99e7e5739d16b567d1df2880caf987 to your computer and use it in GitHub Desktop.
Save pierric/6d99e7e5739d16b567d1df2880caf987 to your computer and use it in GitHub Desktop.
Replace all the black pixel to green.
arr = cv2.imread('img', -1)
arr[numpy.where((arr == [0,0,0]).all(axis=2))] = [0, 255, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment