OpenCv Python Image process: Image
cv2.imread() , cv2.imshow() , cv2.imwrite() Second argument is a flag which specifies the way image should be read. cv2.IMREAD_COLOR : Loads a color image. Any transparency of image will be neglected. It is the default flag. cv2.IMREAD_GRAYSCALE : Loads image in grayscale mode cv2.IMREAD_UNCHANGED : Loads image as such including alpha channel import numpy as np import cv2 # Load an color image in grayscale img = cv2 . imread ( 'messi5.jpg' , 0 ) cv2 . imshow ( 'image' , img ) cv2 . waitKey ( 0 ) cv2 . destroyAllWindows () http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_image_display/py_image_display.html