Skip to content

Instantly share code, notes, and snippets.

@Praveen76
Created April 15, 2022 16:41
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 Praveen76/75d2fbc88301a8903d56f6dd2e6ea985 to your computer and use it in GitHub Desktop.
Save Praveen76/75d2fbc88301a8903d56f6dd2e6ea985 to your computer and use it in GitHub Desktop.
img=cv.imread('D:\park.jpg')
cv.imshow('park',img)
b,g,r = cv.split(img)
cv.imshow('blue',b)
cv.imshow('blue',g)
cv.imshow('blue',r)
#actual single color
blank=np.zeros(img.shape[:2],'uint8')
blue1=cv.merge([b,blank,blank])
cv.imshow('bluea',blue1)
green1=cv.merge([blank,g,blank])
cv.imshow('greena',green1)
red1=cv.merge([blank,blank,r])
cv.imshow('reda',red1)
cv.waitKey(0)
cv.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment