Pappu19

RGB to Gray

Sep 16th, 2021
606
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import cv2
  2.  
  3. img = cv2.imread('Image.png')
  4. gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  5.  
  6. print(img)
  7. cv2.imshow('Image', img)
  8. cv2.imshow('Gray', gray)
  9.  
  10. cv2.waitKey(0)        
  11.  
  12. cv2.destroyAllWindows()
RAW Paste Data