import cv2 as cv2
gray_img = cv2.imread('C:\\Users\\zzheng\\Pictures\\tiger.png', cv2.IMREAD_GRAYSCALE)
status = cv2.imwrite('C:\\Users\\zzheng\\Pictures\\tiger02.png', gray_img)
print("Image write status: '%s'." % status)
cv2.imwrite('/path/to/destination/image.png',image)
First Argument is Path to the destination on file system, where image is ought to be saved.
Second Argument is ndarray containing image
Returns True is returned if the image is written to file system, else False.
网友评论