Skip to content

Instantly share code, notes, and snippets.

@Yuktha-Majella
Created October 26, 2021 15:12
Show Gist options
  • Save Yuktha-Majella/1a055c331fb5fe10979bfd1dce7287b5 to your computer and use it in GitHub Desktop.
Save Yuktha-Majella/1a055c331fb5fe10979bfd1dce7287b5 to your computer and use it in GitHub Desktop.
#Splitting image into Blue, Green, Red channels
#Method 1
b,g,r = cv2.split(img)
#Method 2
b = img[:,:,0]
g = img[:,:,1]
r = img[:,:,2]
vis2 = np.concatenate((b, g, r), axis=1)
imS = cv2.resize(vis2, (1050, 350))
cv2.imshow('Blue vs Green vs Red', imS)
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment