Guest User

Untitled

a guest
Feb 14th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import cv2
  2. import matplotlib.pyplot as plt
  3.  
  4. img = cv2.imread('images/barcode_01.jpg')
  5. b,g,r = cv2.split(img)
  6. img2 = cv2.merge([r,g,b])
  7. plt.subplot(121);plt.imshow(img) # expects distorted color
  8. plt.subplot(122);plt.imshow(img2) # expect true color
  9. plt.show()
  10.  
  11. cv2.imshow('bgr image',img) # expects true color
  12. cv2.imshow('rgb image',img2) # expects distorted color
  13. cv2.waitKey(0)
  14. cv2.destroyAllWindows()
Add Comment
Please, Sign In to add comment