Advertisement
Pappu19

RGB to Gray

Sep 16th, 2021
672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement